diff --git a/package-lock.json b/package-lock.json index 310113c..67a04ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,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", @@ -8477,6 +8478,14 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -8813,6 +8822,33 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zustand": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.2.tgz", + "integrity": "sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g==", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } } } } diff --git a/package.json b/package.json index 2a9e62f..c74d0a8 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app/_component/atom/BottomButton/index.tsx b/src/app/_component/atom/BottomButton/index.tsx index f40871a..c1f2183 100644 --- a/src/app/_component/atom/BottomButton/index.tsx +++ b/src/app/_component/atom/BottomButton/index.tsx @@ -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; @@ -25,8 +26,9 @@ const BottomButton: React.FC = ({ - 다음 + {loading ? : '다음'} ); }; diff --git a/src/app/_component/atom/Loading/index.tsx b/src/app/_component/atom/Loading/index.tsx new file mode 100644 index 0000000..1bf41a6 --- /dev/null +++ b/src/app/_component/atom/Loading/index.tsx @@ -0,0 +1,13 @@ +import { LoadingSection } from '../Loading/styles'; + +const Loading = () => { + return ( + +
+
+
+ + ); +}; + +export default Loading; diff --git a/src/app/_component/atom/Loading/styles.ts b/src/app/_component/atom/Loading/styles.ts new file mode 100644 index 0000000..7fcabe9 --- /dev/null +++ b/src/app/_component/atom/Loading/styles.ts @@ -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); + } + } +`; diff --git a/src/app/page.tsx b/src/app/page.tsx index bc161fb..6cceb7d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -50,7 +50,19 @@ export default function Home(): React.JSX.Element { alt={'백곰 스플래시 이미지'} />
-
현재 일시적으로 서비스 제공이 중단되었습니다 :)
+
+
); } diff --git a/src/app/signup/more/page.tsx b/src/app/signup/more/page.tsx index cda97bd..529d2be 100644 --- a/src/app/signup/more/page.tsx +++ b/src/app/signup/more/page.tsx @@ -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); } }; diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx index a4326f3..a466c14 100644 --- a/src/app/signup/page.tsx +++ b/src/app/signup/page.tsx @@ -63,16 +63,7 @@ export default function Signup(): React.JSX.Element { return ( - + { diff --git a/src/store/auth/index.ts b/src/store/auth/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/store/auth/signupInfo.ts b/src/store/auth/signupInfo.ts new file mode 100644 index 0000000..e7d00cc --- /dev/null +++ b/src/store/auth/signupInfo.ts @@ -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((set) => ({ + // state + id: '', + password: '', + // actions + setID: (id) => set(() => ({ id })), + setPassword: (password) => set(() => ({ password })), +})); + +export default create(useSignupStore);