Skip to content

Commit 4d89d78

Browse files
authored
Merge pull request #19 from DevKor-github/feat/#11/button
feat: λ²„νŠΌ κ΅¬ν˜„
2 parents db19331 + 5dd2f50 commit 4d89d78

4 files changed

Lines changed: 70 additions & 3 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { HTMLAttributes, PropsWithChildren } from 'react';
2+
import * as s from './style.css';
3+
4+
interface Props extends PropsWithChildren {
5+
color?: 'gray' | 'main' | 'softgray' | 'deemedgray';
6+
onClick?: () => void;
7+
style? : HTMLAttributes<HTMLDivElement>['style'];
8+
}
9+
const Btn = ({ children, color = 'softgray', onClick, style }: Props) => {
10+
return (
11+
<div className={s.Button({ color })} style={style} onClick={onClick}>
12+
{children}
13+
</div>
14+
);
15+
};
16+
export default Btn;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { cva } from '@styled-system/css';
2+
3+
export const Button = cva({
4+
base: {
5+
display: 'flex',
6+
gap: '0.625rem',
7+
flexShrink: '0',
8+
justifyContent: 'center',
9+
padding: '0.625rem',
10+
borderRadius: '0.375rem',
11+
width: '100%',
12+
height: '3.125rem',
13+
fontFamily: 'Pretendard',
14+
fontSize: '1.25rem',
15+
fontStyle: 'normal',
16+
fontWeight: '500',
17+
lineHeight: 'normal',
18+
letterSpacing: '-0.05rem'
19+
},
20+
variants: {
21+
color: {
22+
main: {
23+
backgroundColor: 'main',
24+
color: '100',
25+
},
26+
gray: {
27+
backgroundColor: 'systemGray5',
28+
color: '100'
29+
},
30+
softgray: {
31+
backgroundColor: 'systemGray5',
32+
color: '80'
33+
},
34+
deemedgray: {
35+
backgroundColor: 'systemGray5',
36+
color: '54'
37+
}
38+
}
39+
}
40+
})

β€Žsrc/pages/HomePage/index.tsxβ€Ž

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import type { ActivityComponentType } from '@stackflow/react';
3+
import Btn from '@/common/components/Button';
34
import { useFlow } from '@/libs/routes/stack';
45

56
// CSS μ‚¬μš©ν•˜λŠ” μ»΄ν¬λ„ŒνŠΈμ—μ„œλŠ” 이런 μ‹μœΌλ‘œ 뢈러였기
@@ -11,6 +12,7 @@ import SelectButton from '@/common/components/SelectButton';
1112
import TestAPIButton from '@/common/components/TestAPIButton';
1213
import useGetIsLogin from '@/common/hooks/apis/useGetIsLogin';
1314

15+
1416
const HomePage: ActivityComponentType = () => {
1517
const { push } = useFlow();
1618
const { data: isLogin } = useGetIsLogin();
@@ -24,17 +26,26 @@ const HomePage: ActivityComponentType = () => {
2426
{isLogin ? (
2527
<TestAPIButton />
2628
) : (
27-
<div className={s.LoginBtn}>
29+
<div className={s.LoginBtn} style={{margin: '1rem'}}>
2830
<a href={`${import.meta.env.VITE_API_URL}/oauth2/authorization/kakao`}>μΉ΄μΉ΄μ˜€ν†‘ 둜그인</a>
2931
<a href={`${import.meta.env.VITE_API_URL}/oauth2/authorization/google`}>ꡬ글 둜그인</a>
32+
<i className={s.Container}>λ°±μ—”λ“œμ—λͺ½ 둜그인 고쳐쀘</i>
33+
<button onClick={() => push('PostPage', {})}>이동</button>
3034
</div>
3135
)}
32-
<button onClick={() => push('PostPage', {})}>이동</button>
3336
</div>
3437
<Chip color="main">좕ꡬ</Chip>
3538
<SelectButton active={active} onClick={() => setActive(!active)}>
3639
μ’…λͺ©
3740
</SelectButton>
41+
<div style={{display: 'flex', justifyContent: 'space-evenly'}}>
42+
<Btn color = 'softgray' style = {{width : '5.875rem'}}>γ…‡ μ±„νŒ…</Btn>
43+
<Btn color='main' style = {{width: '15.8125rem'}} >λŒ€μ—¬μΌμžμ„ νƒ</Btn>
44+
</div>
45+
<div style={{display: 'flex', flexDirection:'column', marginTop: '1rem', gap: '0.5rem'}}>
46+
<Btn color='gray'>μ•ˆλ…•ν•˜μ„Έμš”</Btn>
47+
<Btn color='deemedgray'>λ°˜κ°€μ›Œμš”...</Btn>
48+
</div>
3849
</AppScreenWithSafeArea>
3950
);
4051
};

β€Žsrc/pages/HomePage/style.css.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export const Title = css({
88
color: 'main',
99
});
1010

11-
export const LoginBtn = css({ display: 'flex', flexDirection: 'column', gap: '1rem' });
11+
export const LoginBtn = css({ display: 'flex', flexDirection: 'column', gap: '1rem', alignItems: 'center' });
1212

1313
export const Container = css({ color: 'systemGray' });

0 commit comments

Comments
Β (0)