Skip to content

Commit

Permalink
Feat: 랜딩 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsjsj1246 committed Nov 8, 2023
1 parent e823d58 commit f4e8814
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 137 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dutying-web",
"private": true,
"version": "0.5.0",
"version": "0.5.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
26 changes: 11 additions & 15 deletions src/hooks/auth/useAuth/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { shallow } from 'zustand/shallow';
import useAuthStore from './store';
import axiosInstance from '@libs/api/client';
import { useMutation } from '@tanstack/react-query';
import { demoStart, getAccountMe } from '@libs/api/auth';
import { useNavigate } from 'react-router';
import ROUTE from '@libs/constant/path';
Expand Down Expand Up @@ -48,24 +47,21 @@ const useAuth = (activeEffect = false) => {
setState('isAuth', true);
setState('accessToken', accessToken);
initEditShiftStore();
sendEvent(events.auth.login);
axiosInstance.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;
navigate(nextPageUrl || '/make');
location.replace(nextPageUrl || '/make');
sendEvent(events.auth.login);
};

const { mutate: demoTry } = useMutation(demoStart(), {
onSuccess: (data) => {
handleLogin(data.accessToken);
setState('accessToken', data.accessToken);
setState('accountId', data.accountResDto.accountId);
setState('nurseId', data.accountResDto.nurseId);
setState('wardId', data.accountResDto.wardId);
setState('isAuth', true);
setState('demoStartDate', new Date());
navigate(ROUTE.MAKE);
},
});
const demoTry = async () => {
const data = await demoStart();
setState('accessToken', data.accessToken);
setState('accountId', data.accountResDto.accountId);
setState('nurseId', data.accountResDto.nurseId);
setState('wardId', data.accountResDto.wardId);
setState('isAuth', true);
setState('demoStartDate', new Date());
navigate(ROUTE.MAKE);
};

const handleGetAccountMe = async () => {
const account = await getAccountMe();
Expand Down
2 changes: 1 addition & 1 deletion src/libs/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axiosInstance from './client';

const getAccountMe = async () => (await axiosInstance.get<Account>('/accounts/me')).data;
const demoStart = () => async () =>
const demoStart = async () =>
(
await axiosInstance.post<{ wardResDto: Ward; accountResDto: Account; accessToken: string }>(
'/demo/start'
Expand Down
224 changes: 115 additions & 109 deletions src/pages/LandingPage/index.tsx

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions src/pages/LoginPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useNavigate } from 'react-router';
const LoginPage = () => {
const navigate = useNavigate();
return (
<div className="bg- flex w-screen justify-center">
<div className="flex h-screen w-[100vh] flex-col items-center justify-between bg-white p-[4.5rem]">
<div className="flex w-screen justify-center">
<div className="flex h-screen w-[100vh] flex-col items-center justify-between p-[4.5rem]">
<div className="flex cursor-pointer" onClick={() => navigate(ROUTE.ROOT)}>
<LogoSymbolFill className="mr-[2.3438rem] h-[3.125rem] w-[2.9688rem]" />
<FullLogo className="h-[3.125rem] w-[11.3125rem]" />
Expand All @@ -23,12 +23,7 @@ const LoginPage = () => {
<div className="font-apple text-[1.7rem] text-sub-1">카카오로 3초 만에 시작하기</div>
</a>
</div>
<div className="flex">
<div className="mr-[3.125rem] font-apple text-[1.5rem] text-sub-2.5">
아직 듀팅을 시작하지 않으셨나요?
</div>
<div className="font-apple text-[1.5rem] text-main-2 underline">회원가입</div>
</div>
<div className="flex"></div>
</div>
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion src/pages/MemberPage/components/ConnectionManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function ConnectionManage({ open, setOpen }: ConnectionManageProps) {
<div className="mt-[1.5rem] flex h-[calc(100%-5.9375rem)] flex-col gap-[1rem] overflow-scroll scrollbar-hide">
{watingNurses?.map((waitingNurse) => (
<div className="flex h-[4.5rem] shrink-0 items-center rounded-[.625rem] border-[.0625rem] border-sub-4.5 bg-main-bg px-[1.25rem]">
<img className="rounded-full" src="" alt="" />
<img
className="h-[2rem] w-[2rem] rounded-full"
src={waitingNurse.profileImgBase64}
alt=""
/>
<p className="ml-[.625rem] font-apple text-[1.5rem] font-medium text-sub-1">
{waitingNurse.name}
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MemberPage/components/ShiftTeamList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function ShiftTeamList() {
borderBottom: '.625rem solid none',
}}
/>
연동 되지 않은 가상의 프로필입니다.
연동 되지 않은 가상의 간호사입니다.
<UnlinkedIcon className="h-[1.25rem] w-[1.25rem]" />
</div>
{index !== divisionNurses.length - 1 ? (
Expand Down
1 change: 0 additions & 1 deletion src/pages/MemberPage/components/WardInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function WardInfo() {
state: { watingNurses },
} = useEditWard();
const [open, setOpen] = useState(false);
console.log(watingNurses);
return (
<div className="flex gap-[1.25rem]">
<div className="flex flex-col gap-[.4375rem] ">
Expand Down
1 change: 1 addition & 0 deletions src/types/nurse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ type WaitingNurse = {
gender: string;
phoneNum: string;
employmentDate: boolean;
profileImgBase64: string;
};

0 comments on commit f4e8814

Please sign in to comment.