Skip to content

Commit

Permalink
fix: correct directions
Browse files Browse the repository at this point in the history
  • Loading branch information
awesthouse committed Feb 8, 2024
1 parent 641924c commit adcfa34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/dm-core-plugins/src/stack/StackPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export const StackPlugin = (props: IUIPlugin) => {

// map plugin language to stack props/css language
const configMap: { [name: string]: string } = {
horizontal: 'column',
vertical: 'row',
verticalPlacement:
config.direction === 'horizontal' ? 'alignItems' : 'justifyContent',
vertical: 'column',
horizontal: 'row',
horizontalPlacement:
config.direction === 'horizontal' ? 'alignItems' : 'justifyContent',
verticalPlacement:
config.direction === 'horizontal' ? 'justifyContent' : 'alignItems',
left: 'flex-start',
center: 'center',
Expand All @@ -30,7 +30,7 @@ export const StackPlugin = (props: IUIPlugin) => {
[configMap.verticalPlacement]: configMap[config.verticalPlacement],
[configMap.horizontalPlacement]: configMap[config.horizontalPlacement],
className: config.classNames?.join(' '),
spacing: config.spacing !== undefined ? config.spacing : 1.5,
spacing: config.spacing,
wrap: config.wrap ? 'wrap' : 'no-wrap',
style: { maxWidth: config.maxWidth },
}
Expand Down
10 changes: 5 additions & 5 deletions packages/dm-core-plugins/src/stack/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { TViewConfig } from '@development-framework/dm-core'
export type StackPluginConfig = {
items: TViewConfig[]
direction: 'horizontal' | 'vertical'
verticalPlacement: 'left' | 'center' | 'right' | 'spaceItems'
horizontalPlacement: 'top' | 'center' | 'bottom'
horizontalPlacement: 'left' | 'center' | 'right' | 'spaceItems'
verticalPlacement: 'top' | 'center' | 'bottom'
spacing: number
maxWidth: string
wrap: boolean
Expand All @@ -13,9 +13,9 @@ export type StackPluginConfig = {

export const defaultConfig: StackPluginConfig = {
items: [],
direction: 'horizontal',
verticalPlacement: 'left',
horizontalPlacement: 'top',
direction: 'vertical',
horizontalPlacement: 'left',
verticalPlacement: 'top',
spacing: 2,
maxWidth: 'none',
wrap: false,
Expand Down

0 comments on commit adcfa34

Please sign in to comment.