Skip to content

Commit

Permalink
Feat(user): 의사 상세 페이지 수정
Browse files Browse the repository at this point in the history
- 예약 시간 데이터 변경
- 공공 데이터 포털의 api로 변경해야 ㅎㅏa
  • Loading branch information
hwna00 committed Sep 25, 2023
1 parent 53c019a commit bedddf2
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 82 deletions.
7 changes: 4 additions & 3 deletions packages/apps/user/src/components/Root/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { Box, Text } from '@chakra-ui/react';

import StatusBar from '../StatusBar/StatusBar';
import SideBar from '../SideBar/SideBar';
import useUser from '../../hooks/useUser';

const Root = function () {
const navigate = useNavigate();
const { userLoading, user, isLoggedIn } = useUser();
console.log(userLoading, user, isLoggedIn);
const userLoading = false;
const user = {
username: '하철환',
};

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
import { DoctorList } from '../dataList';
import { setAppointDatetime } from '../../../store';
import BackButton from '../../../components/BackButton/BackButton';
import reservatons from '../../../../fixture/reservation.json';

function RadioCard({ remainingSeats, ...radioProps }) {
const { getInputProps, getRadioProps } = useRadio(radioProps);
Expand Down Expand Up @@ -79,13 +78,6 @@ const AppointmentDetail = function () {
const [reservationOfDay, setReservationOfDay] = useState({});
const dispatch = useDispatch();

useEffect(() => {
// Todo: 추후에 id를 이용한 axios get 함수로 변경해야 함.
const found = DoctorList.find(d => d?.id === id);
setDoctor(found);
setReservationOfDay(reservatons[appointDate]);
}, [id, appointDate]);

const onDateChange = useCallback(e => {
setAppointDate(e.target.value);
}, []);
Expand All @@ -107,13 +99,38 @@ const AppointmentDetail = function () {
}, [doctor]);

const { getRootProps, getRadioProps } = useRadioGroup({
name: 'framework',
defaultValue: 'react',
name: 'timeGroup',
onChange: onTimeChange,
});

const group = getRootProps();

useEffect(() => {
// Todo: 추후에 id를 이용한 axios get 함수로 변경해야 함.
const found = DoctorList.find(d => d?.id === id);
setDoctor(found);
setReservationOfDay({
'09:00': 2,
'09:30': 1,
'10:00': 0,
'10:30': 3,
'11:00': 3,
'11:30': 3,
'12:00': 2,
'12:30': 1,
'13:00': 0,
'13:30': 0,
'14:00': 0,
'14:30': 0,
'15:00': 3,
'15:30': 0,
'16:00': 1,
'16:30': 0,
'17:00': 0,
'17:30': 0,
});
}, [id, appointDate]);

return (
<HStack height="full" gap="6">
<VStack height="full" justifyContent="flex-start" alignItems="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function AppointmentList() {
defaultValue: [],
onChange: setSelectedSpecialties,
});

return (
<VStack width="full" height="full" gap="4">
<Box width="100%">
Expand Down
140 changes: 71 additions & 69 deletions packages/apps/user/src/views/AppointmentHistory/AppointmentHistory.js
Original file line number Diff line number Diff line change
@@ -1,79 +1,81 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';

import { Box, Divider, HStack, VStack } from '@chakra-ui/react';

import AppointmentHistoryItem from '../../components/AppointmentHistoryItem/AppointmentHistoryItem';

const AppointmentHistory = function () {
const [histories, setHistories] = useState([]);
setHistories([
{
prescriptionDate: '2023.07.31',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.20',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
]);
useEffect(() => {
setHistories([
{
prescriptionDate: '2023.07.31',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.20',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
{
prescriptionDate: '2023.07.23',
hospitalName: '힘내라힘 병원',
pharmacyName: '다나아 약국',
favorites: '등록',
},
]);
}, []);

return (
<VStack mx="5" align="stretch">
Expand Down

0 comments on commit bedddf2

Please sign in to comment.