-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/263/fix-game-tag-state
- Loading branch information
Showing
59 changed files
with
1,463 additions
and
59 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import color from '@/styles/color'; | ||
import typo from '@/styles/typo'; | ||
import { css } from '@emotion/react'; | ||
import type { ButtonProps } from './Button'; | ||
|
||
export const getVariantStyling = ( | ||
variant: Required<ButtonProps>['variant'], | ||
active: boolean, | ||
) => { | ||
const style = { | ||
primary: css({ | ||
borderRadius: '10px', | ||
backgroundColor: active ? color.MAIN : color.GY[2], | ||
color: color.WT, | ||
}), | ||
roundPrimary: css({ | ||
borderRadius: '80px', | ||
backgroundColor: active ? color.MAIN : color.GY[2], | ||
color: color.WT, | ||
}), | ||
Primary2: css({ | ||
borderRadius: '6px', | ||
backgroundColor: color.MAIN, | ||
color: color.WT, | ||
}), | ||
outlineShadow: css({ | ||
border: `1px solid ${color.GY[4]}`, | ||
borderRadius: '6px', | ||
backgroundColor: color.GY[5], | ||
color: color.GY[1], | ||
}), | ||
}; | ||
|
||
return style[variant]; | ||
}; | ||
|
||
export const getSizeByVariantStyling = ( | ||
variant: Required<ButtonProps>['variant'], | ||
size: Required<ButtonProps>['size'], | ||
) => { | ||
const style = { | ||
primary: { | ||
large: css(typo.Main.SemiBold, { | ||
width: '335px', | ||
height: '50px', | ||
}), | ||
medium: css(typo.Main.SemiBold, { | ||
width: '130px', | ||
height: '50px', | ||
}), | ||
}, | ||
roundPrimary: { | ||
large: css(typo.Mobile.Text.SemiBold_14, { | ||
width: '295px', | ||
height: '40px', | ||
}), | ||
medium: css({}), | ||
}, | ||
Primary2: { | ||
large: css({}), | ||
medium: css({ | ||
width: '64px', | ||
height: '34px', | ||
}), | ||
}, | ||
outlineShadow: { | ||
large: css({}), | ||
medium: css({ | ||
width: '64px', | ||
height: '34px', | ||
}), | ||
}, | ||
}; | ||
|
||
return style[variant][size]; | ||
}; | ||
|
||
export const buttonStyling = css({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
border: 'none', | ||
whiteSpace: 'nowrap', | ||
cursor: 'pointer', | ||
}); |
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,35 @@ | ||
import React, { forwardRef } from 'react'; | ||
import type { ComponentPropsWithRef, ForwardedRef } from 'react'; | ||
import * as S from './Button.style'; | ||
|
||
export interface ButtonProps extends ComponentPropsWithRef<'button'> { | ||
size?: 'large' | 'medium'; | ||
variant?: 'primary' | 'roundPrimary' | 'Primary2' | 'outlineShadow'; | ||
active?: boolean; | ||
} | ||
|
||
const Button = ( | ||
{ | ||
size = 'medium', | ||
variant = 'primary', | ||
active = true, | ||
children, | ||
...attributes | ||
}: ButtonProps, | ||
ref: ForwardedRef<HTMLButtonElement>, | ||
) => ( | ||
<button | ||
type="button" | ||
ref={ref} | ||
css={[ | ||
S.buttonStyling, | ||
S.getVariantStyling(variant, active), | ||
S.getSizeByVariantStyling(variant, size), | ||
]} | ||
{...attributes} | ||
> | ||
{children} | ||
</button> | ||
); | ||
|
||
export default forwardRef(Button); |
9 changes: 9 additions & 0 deletions
9
src/components/mobile/atoms/GameStageLabel/GameStageLabel.style.ts
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,9 @@ | ||
import { css } from '@emotion/react'; | ||
import color from '@/styles/color'; | ||
import typo from '@/styles/typo'; | ||
|
||
export const getStageLabelColor = (labelColor: string) => { | ||
return css(typo.Mobile.Text.SemiBold_14, { | ||
color: labelColor === 'main' ? color.MAIN : color.GY[1], | ||
}); | ||
}; |
13 changes: 13 additions & 0 deletions
13
src/components/mobile/atoms/GameStageLabel/GameStageLabel.tsx
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,13 @@ | ||
import React from 'react'; | ||
import * as S from './GameStageLabel.style'; | ||
|
||
export interface GameStageLabelProps { | ||
stage: number; | ||
color?: 'main' | 'default'; | ||
} | ||
|
||
const GameStageLabel = ({ stage, color = 'default' }: GameStageLabelProps) => ( | ||
<div css={S.getStageLabelColor(color)}>{stage + 1} / 10</div> | ||
); | ||
|
||
export default GameStageLabel; |
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,8 @@ | ||
import { css } from '@emotion/react'; | ||
import color from '@/styles/color'; | ||
import typo from '@/styles/typo'; | ||
|
||
export const tagStyle = css(typo.Mobile.Text.SemiBold_20, { | ||
color: color.MAIN, | ||
gap: '5px', | ||
}); |
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,14 @@ | ||
import React from 'react'; | ||
import * as S from './GameTag.style'; | ||
|
||
export interface GameTagProps { | ||
tag: string; | ||
} | ||
|
||
const GameTag = ({ tag }: GameTagProps) => ( | ||
<div css={S.tagStyle}> | ||
<span>#</span> <span>{tag}</span> | ||
</div> | ||
); | ||
|
||
export default GameTag; |
15 changes: 15 additions & 0 deletions
15
src/components/mobile/atoms/GameTagChip/GameTagChip.style.ts
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,15 @@ | ||
import { css } from '@emotion/react'; | ||
import color from '@/styles/color'; | ||
import typo from '@/styles/typo'; | ||
|
||
export const tagStyle = css(typo.Mobile.Text.Medium_12, { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
padding: '6px 14px', | ||
borderRadius: '6px', | ||
border: `1px solid ${color.WT_VIOLET}`, | ||
color: color.MAIN, | ||
fontSize: '14px', | ||
gap: '5px', | ||
}); |
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,14 @@ | ||
import React from 'react'; | ||
import * as S from './GameTagChip.style'; | ||
|
||
export interface GameTagChipProps { | ||
tag: string; | ||
} | ||
|
||
const GameTagChip = ({ tag }: GameTagChipProps) => ( | ||
<div css={S.tagStyle}> | ||
<span>#{tag}</span> | ||
</div> | ||
); | ||
|
||
export default GameTagChip; |
14 changes: 14 additions & 0 deletions
14
src/components/mobile/atoms/IconButton/IconButton.style.ts
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,14 @@ | ||
import { css } from '@emotion/react'; | ||
import color from '@/styles/color'; | ||
|
||
export const buttonStyle = css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
justifyContent: ' center', | ||
width: '54px', | ||
height: '34px', | ||
border: `1px solid ${color.GY[3]}`, | ||
borderRadius: '4px', | ||
cursor: 'pointer', | ||
}); |
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,23 @@ | ||
import React, { | ||
ComponentPropsWithoutRef, | ||
ForwardedRef, | ||
forwardRef, | ||
} from 'react'; | ||
import * as S from './IconButton.style'; | ||
|
||
interface IconButtonProps extends ComponentPropsWithoutRef<'button'> { | ||
icon: React.ReactNode; | ||
} | ||
|
||
const IconButton = ( | ||
{ icon, onClick, ...props }: IconButtonProps, | ||
ref: ForwardedRef<HTMLButtonElement>, | ||
) => { | ||
return ( | ||
<button type="button" css={S.buttonStyle} ref={ref} {...props}> | ||
{icon} | ||
</button> | ||
); | ||
}; | ||
|
||
export default forwardRef(IconButton); |
46 changes: 46 additions & 0 deletions
46
src/components/mobile/atoms/InteractionButton/InteractionButton.style.ts
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,46 @@ | ||
import { css } from '@emotion/react'; | ||
import color from '@/styles/color'; | ||
import typo from '@/styles/typo'; | ||
|
||
export const buttonStyle = css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
width: '163px', | ||
height: '58px', | ||
borderRadius: '12px', | ||
border: `1px solid ${color.GY[2]}`, | ||
boxShadow: '1px 1px 4px rgba(0, 0, 0, 0.15)', | ||
cursor: 'pointer', | ||
}); | ||
|
||
export const itemWrapper = css({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
paddingTop: '10px', | ||
gap: '3px', | ||
}); | ||
|
||
export const buttonLabelStyle = css(typo.Mobile.Text.Medium_12, { | ||
color: color.MAIN, | ||
fontSize: '11px', | ||
fontWeight: '700', | ||
}); | ||
|
||
export const iconWrapper = css({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
gap: '3px', | ||
}); | ||
|
||
export const iconStyle = css({ | ||
width: '24px', | ||
height: '24px', | ||
flexShrink: '0', | ||
}); | ||
|
||
export const iconLabelStyle = css(typo.Mobile.Text.Medium_12, { | ||
color: color.GY[1], | ||
fontWeight: '600', | ||
}); |
Oops, something went wrong.