Skip to content

Commit

Permalink
feat(shred/button): add fit size
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Jul 18, 2024
1 parent fb3ad29 commit 2a3b237
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/processes/shortcut/Shortcut.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.Header {
display: flex;
width: 100%;
padding: 12px 4px 0;
padding: 20px 20px 0;
}

.CloseButton {
Expand Down
9 changes: 8 additions & 1 deletion src/processes/shortcut/Shortcut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export const Shortcut = () => {
<Sheet.Container>
<Sheet.Header className={styles.Header}>
{selectedKey && (
<Button variant={'ghost'} color={'neutral'} widthType={'hug'} onClick={() => setSelectedKey(null)}>
<Button
variant={'ghost'}
color={'neutral'}
widthType={'hug'}
size={'fit'}
onClick={() => setSelectedKey(null)}
>
<ArrowLeft width={24} />
</Button>
)}
Expand All @@ -54,6 +60,7 @@ export const Shortcut = () => {
variant={'ghost'}
color={'neutral'}
widthType={'hug'}
size={'fit'}
onClick={onClose}
>
<Close width={24} />
Expand Down
3 changes: 3 additions & 0 deletions src/shared/ui/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
border-radius: 40px;
padding: 8px 12px;
}
.Button[data-size='fit'] {
}


.Button[data-width-type='fill'] {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HT
suffixSlot?: ReactNode;
prefixSlot?: ReactNode;
textAlign?: 'left' | 'center' | 'right';
size?: 'S' | 'M';
size?: 'fit' | 'S' | 'M';
};

export const Button = ({
Expand Down
8 changes: 6 additions & 2 deletions src/shared/ui/InputBottomSheet/InputBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ export const InputBottomSheet = ({
<Sheet detent={'content-height'} isOpen={open} onClose={onClose}>
<Sheet.Container>
<Sheet.Header className={styles.Header}>
<ArrowLeft width={24} />
<Close width={24} />
<Button variant={'ghost'} color={'neutral'} widthType={'hug'} size={'fit'} onClick={onClose}>
<ArrowLeft width={24} />
</Button>
<Button variant={'ghost'} color={'neutral'} widthType={'hug'} size={'fit'} onClick={onClose}>
<Close width={24} />
</Button>
</Sheet.Header>
<Sheet.Content className={styles.Content}>
<h2>{title}</h2>
Expand Down

0 comments on commit 2a3b237

Please sign in to comment.