Skip to content

Commit

Permalink
fix: responsive ui + ui props fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
awesthouse committed Jun 24, 2024
1 parent 0a8b905 commit 822d891
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/dm-core-plugins/src/common/Stack/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ export const defaultProps: StackProps = {
grow: 0,
shrink: 1,
fullWidth: false,
spacing: 0,
}
2 changes: 1 addition & 1 deletion packages/dm-core-plugins/src/data-grid/DataGridPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function DataGridPlugin(props: IUIPlugin) {

return !data ? null : (
<div className='dm-plugin-padding'>
<Stack fullWidth alignItems='flex-start' spacing={1}>
<Stack fullWidth alignItems='flex-start' spacing={1} scrollX>
<DataGrid
attributeType={attribute?.attributeType || 'string'}
config={userConfig}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const MediaContent = (props: MediaContentProps): ReactElement => {
src={blobUrl}
alt={meta.title}
style={{
width: config.width ?? '100%',
maxWidth: config.width ?? '100%',
width: '100%',
height: config.height ?? 'auto',
maxWidth: 'unset',
}}
/>
)
Expand Down
7 changes: 5 additions & 2 deletions packages/dm-core-plugins/src/stack/StackPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ export const StackPlugin = (props: IUIPlugin) => {
direction: configMap[config.direction] as DirectionTypes,
[configMap.verticalPlacement]: configMap[config.verticalPlacement],
[configMap.horizontalPlacement]: configMap[config.horizontalPlacement],
className: config.classNames?.join(' '),
className: config.classNames.join(' '),
spacing: config.spacing,
wrap: config.wrap ? 'wrap' : 'no-wrap',
style: { maxWidth: config.maxWidth },
}

return (
<Stack className='dm-parent-plugin' {...stackProps}>
<Stack
{...stackProps}
className={`dm-plugin-padding dm-parent-plugin ${config.classNames}`}
>
{config.items?.map((item, index) => (
<ViewCreator
key={`${item.recipe}_${index}`}
Expand Down
2 changes: 1 addition & 1 deletion packages/dm-core-plugins/src/stack/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const defaultConfig: StackPluginConfig = {
direction: 'vertical',
horizontalPlacement: 'left',
verticalPlacement: 'top',
spacing: 2,
spacing: 1,
maxWidth: 'none',
wrap: false,
classNames: [],
Expand Down

0 comments on commit 822d891

Please sign in to comment.