Skip to content

Commit

Permalink
Merge pull request #87 from minjeoong/feat/NewSignup_init
Browse files Browse the repository at this point in the history
Feat/new signup init
  • Loading branch information
minjeoong authored Jul 20, 2024
2 parents 7fa9e11 + 6baba30 commit 052f06b
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 17 deletions.
38 changes: 37 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"react-dom": "^18",
"react-router-dom": "^6.22.3",
"react-secure-storage": "^1.3.2",
"react-tooltip": "^5.26.3"
"react-tooltip": "^5.26.3",
"zustand": "^4.5.2"
},
"devDependencies": {
"@playwright/test": "^1.44.1",
Expand Down
4 changes: 3 additions & 1 deletion src/app/_component/atom/BottomButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { BottomButtonWrap } from './style';
import BackHeader from '@/app/_component/molecule/BackHeader';
import JoinTemplate from '@/app/_component/temp/JoinTemplate';
import { ButtonType } from '@/app/_component/atom/atomType';
import Loading from '@/app/_component/atom/Loading';
type props = {
loading: boolean;
filled: boolean;
Expand All @@ -25,8 +26,9 @@ const BottomButton: React.FC<props> = ({
<BottomButtonWrap
className={filled ? 'confirm_button_Filled' : 'confirm_button'}
onClick={onClickValid}
data-loading={loading}
>
다음
{loading ? <Loading /> : '다음'}
</BottomButtonWrap>
);
};
Expand Down
13 changes: 13 additions & 0 deletions src/app/_component/atom/Loading/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { LoadingSection } from '../Loading/styles';

const Loading = () => {
return (
<LoadingSection>
<div />
<div />
<div />
</LoadingSection>
);
};

export default Loading;
36 changes: 36 additions & 0 deletions src/app/_component/atom/Loading/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Colors, fontGenerator } from '@/styles';
import styled from '@emotion/styled';

export const LoadingSection = styled.section`
display: flex;
justify-content: center;
align-items: center;
gap: 6px;
& > div {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: $gray-100;
animation: loading 1s linear infinite;
&:nth-child(2) {
animation-delay: 0.1s;
}
&:nth-child(3) {
animation-delay: 0.2s;
}
}
@keyframes loading {
0% {
transform: scale(0.8);
}
50% {
transform: scale(1);
}
100% {
transform: scale(0.8);
}
}
`;
14 changes: 13 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@ export default function Home(): React.JSX.Element {
alt={'백곰 스플래시 이미지'}
/>
</div>
<div className="desc">현재 일시적으로 서비스 제공이 중단되었습니다 :)</div>
<div className={`bottom ${showContent ? 'show-content' : ''} `}>
<Button
label={'카카오로 계속하기'}
variant={'kakao'}
size={'kakao'}
prevIcon={Icons.kakao}
iconSize={'20'}
onClick={handleKakaoLogin}
/>
<a className="privacy" href={PATH.NOTION_TERMS}>
개인정보처리방침
</a>
</div>
</HomeWrap>
);
}
6 changes: 3 additions & 3 deletions src/app/signup/more/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export default function Signup(): React.JSX.Element {
if (allConditionsTrue) {
SecureLocalStorage.setItem('id', params.id);
SecureLocalStorage.setItem('password', params.password);
localStorage.setItem('id', params.id);
localStorage.setItem('password', params.password);
// localStorage.setItem('id', params.id);
// localStorage.setItem('password', params.password);

router.push('/signup/info');
router.push(PATH.SIGNUP_MORE);
}
};

Expand Down
11 changes: 1 addition & 10 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,7 @@ export default function Signup(): React.JSX.Element {
return (
<JoinWrap>
<BackHeader title={' '} url={'/'} />
<JoinTemplate
title={'예방접종도우미에 가입한 적이 있나요?'}
subTop={'백곰을 이용하기 위해서는'}
subBottom={'질병관리청의 예방접종도우미 가입이 필요해요'}
falseLabel={'아니요, 가입한 적이 없어요'}
trueLabel={'네, 가입한 적이 있어요'}
params={params}
field={'signupState'}
onChangeValue={onChangeValue}
/>

<BottomButton
filled={params.signupState !== undefined}
handleNextButtonClick={() => {
Expand Down
Empty file added src/store/auth/index.ts
Empty file.
22 changes: 22 additions & 0 deletions src/store/auth/signupInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { create } from 'zustand';
import { devtools } from 'zustand/middleware';

interface State {
id: string;
password: string;
}
interface Action {
setID: (id: string) => void;
setPassword: (password: string) => void;
}

const useSignupStore = devtools<State & Action>((set) => ({
// state
id: '',
password: '',
// actions
setID: (id) => set(() => ({ id })),
setPassword: (password) => set(() => ({ password })),
}));

export default create(useSignupStore);

0 comments on commit 052f06b

Please sign in to comment.