Skip to content

Commit

Permalink
feat: add shoppingList detail
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-liu-smile committed Dec 20, 2022
1 parent 992082c commit 589dac7
Show file tree
Hide file tree
Showing 57 changed files with 4,915 additions and 508 deletions.
33 changes: 33 additions & 0 deletions apps/storefront/src/components/B3CustomForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
B3ControlSelect,
B3ControlPicker,
B3ControlFileUpload,
B3ControlRectangle,
B3ControlProductRadio,
B3ControlSwatchRadio,
} from './form'

import B3UI from './form/ui'
Expand Down Expand Up @@ -89,6 +92,36 @@ export function B3CustomForm(props: B3UI.B3CustomFormProps) {
/>
)
}
{
['rectangle'].includes(fieldType) && (
<B3ControlRectangle
{...field}
errors={errors}
control={control}
setValue={setValue}
/>
)
}
{
['productRadio'].includes(fieldType) && (
<B3ControlProductRadio
{...field}
errors={errors}
control={control}
setValue={setValue}
/>
)
}
{
['swatch'].includes(fieldType) && (
<B3ControlSwatchRadio
{...field}
errors={errors}
control={control}
setValue={setValue}
/>
)
}
</>
</Grid>
)
Expand Down
41 changes: 26 additions & 15 deletions apps/storefront/src/components/B3Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ interface B3DialogProps<T> {
loading?: boolean
row?: T
isShowBordered?: boolean
showRightBtn?: boolean
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false
}

export const B3Dialog:<T> ({
Expand All @@ -55,6 +57,8 @@ export const B3Dialog:<T> ({
loading,
row,
isShowBordered,
showRightBtn,
maxWidth,
}: B3DialogProps<T>) => ReactElement = ({
customActions,
isOpen,
Expand All @@ -69,6 +73,8 @@ export const B3Dialog:<T> ({
loading = false,
row,
isShowBordered = false,
showRightBtn = true,
maxWidth = 'sm',
}) => {
const container = useRef<HTMLInputElement | null>(null)

Expand Down Expand Up @@ -105,6 +111,7 @@ export const B3Dialog:<T> ({
container={container.current}
onClose={handleCloseClick}
fullScreen={isMobile}
maxWidth={maxWidth}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
Expand Down Expand Up @@ -147,21 +154,25 @@ export const B3Dialog:<T> ({

</Button>

<Button
sx={{
...rightStyleBtn,
}}
onClick={handleSaveClick}
autoFocus
>
<B3Sping
isSpinning={loading}
tip=""
size={16}
>
{rightSizeBtn || 'save'}
</B3Sping>
</Button>
{
showRightBtn && (
<Button
sx={{
...rightStyleBtn,
}}
onClick={handleSaveClick}
autoFocus
>
<B3Sping
isSpinning={loading}
tip=""
size={16}
>
{rightSizeBtn || 'save'}
</B3Sping>
</Button>
)
}
</>
)
}
Expand Down
Loading

0 comments on commit 589dac7

Please sign in to comment.