Skip to content

Commit

Permalink
♻️ #241 - IconButton 컴포넌트 스타일 코드 리팩토링 (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bori-github authored May 6, 2024
1 parent 539db6f commit 97efab8
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/components/common/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { css } from '@emotion/react';
import type { ButtonHTMLAttributes, ReactNode } from 'react';

interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
Expand All @@ -15,17 +16,16 @@ export const IconButton = ({
return (
<button
type="button"
style={{
// TODO: #186 PR 머지 후 css 속성으로 수정
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: `${SIZE_STYLES[size]}px`,
height: `${SIZE_STYLES[size]}px`,
borderRadius: '50%',
backgroundColor,
userSelect: 'none',
}}
css={css`
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: ${backgroundColor};
user-select: none;
${SIZE_STYLES[size]}
`}
{...props}
>
{icon}
Expand All @@ -34,6 +34,12 @@ export const IconButton = ({
};

const SIZE_STYLES = {
md: 48,
lg: 60,
md: css`
width: 48px;
height: 48px;
`,
lg: css`
width: 60px;
height: 60px;
`,
};

0 comments on commit 97efab8

Please sign in to comment.