-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: test page ctaBottomBtn 추가 * feat: CTABottomButton 컴포넌트 작성
- Loading branch information
1 parent
5c3b6e1
commit 2955f7c
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentProps } from 'react'; | ||
import { css, Theme, useTheme } from '@emotion/react'; | ||
|
||
import { useUserAgent } from '~/hooks/common/useUserAgent'; | ||
|
||
import { CTAButton } from './CTAButton'; | ||
|
||
interface CTABottomButtonProps extends ComponentProps<typeof CTAButton> {} | ||
|
||
export function CTABottomButton(props: CTABottomButtonProps) { | ||
const { isIos } = useUserAgent(); | ||
const theme = useTheme(); | ||
const { children, ...rest } = props; | ||
|
||
return ( | ||
<div css={ctaBottomButtonCss(isIos(), theme)}> | ||
<CTAButton {...rest}>{children}</CTAButton> | ||
</div> | ||
); | ||
} | ||
|
||
const ctaBottomButtonCss = (isIos: boolean, theme: Theme) => css` | ||
padding: ${isIos ? `8px 0 0 0` : `8px 0`}; | ||
background: ${theme.color.background}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters