Skip to content

Commit

Permalink
style(shelter, volunteer): @anifriends library 추가에 따른 import 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sukvvon committed Jan 16, 2024
1 parent 2503ca3 commit e3af51d
Show file tree
Hide file tree
Showing 72 changed files with 237 additions and 254 deletions.
7 changes: 4 additions & 3 deletions apps/shelter/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import Fonts from '@anifriends/fonts';
import theme from '@anifriends/theme';
import { ChakraProvider } from '@chakra-ui/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { RouterProvider } from 'react-router-dom';
import Fonts from 'shared/fonts';
import theme from 'shared/theme';

import { router } from '@/routes';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 50000,
staleTime: 10 * 1000,
gcTime: 10 * 1000,
},
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/shelter/src/apis/auth.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';
import type {
ChangePasswordRequestData,
CheckDuplicatedEmailRequestData,
CheckDuplicatedEmailResponseData,
SigninRequestData,
SigninResponseData,
} from 'shared/types/apis/auth';
} from '@anifriends/types';

import { SignupRequestData } from '@/types/apis/auth';

Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/recruitment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import {
ApplicantsApprovalRequest,
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/shelter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import { ShelterInfo, UpdateShelterInfo } from '@/types/apis/shetler';

Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/volunteers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import {
VolunteerCompletedsRequestParams,
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useDetailHeaderStore } from '@anifriends/store';
import { useEffect } from 'react';
import useDetailHeaderStore from 'shared/store/detailHeaderStore';

const handleDeletePost = (postId: number) => {
// TODO: AnimalPost delete API 호출
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function AnimalsPage() {
return <NotReady />;
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/search/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useSearchHeaderStore } from '@anifriends/store';
import { useEffect } from 'react';
import useSearchHeaderStore from 'shared/store/searchHeaderStore';

const handleSearchkeyword = (keyword: string) => {
// TODO: AnimalList 검색 API 호출
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/chattings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function ChattingsPage() {
return <NotReady />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicantStatus } from '@anifriends/components';
import { Flex, Text } from '@chakra-ui/react';
import ApplicantStatus from 'shared/components/ApplicantStatus';

type ApplyInfoItemProps = {
currentRecuritmentCount: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Label } from '@anifriends/components';
import { PERSON_GENDER_KOR } from '@anifriends/constants';
import { getAge, updateToast } from '@anifriends/utils';
import { Button, Flex, HStack, Text, useToast, VStack } from '@chakra-ui/react';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import Label from 'shared/components/Label';
import { PERSON_GENDER_KOR } from 'shared/constants/gender';
import { getAge } from 'shared/utils/date';
import { updateToast } from 'shared/utils/toast';

import { updateShelterRecruitmentApplicant } from '@/apis/recruitment';
import CkCheck from '@/assets/CkCheck';
Expand Down
18 changes: 10 additions & 8 deletions apps/shelter/src/pages/my/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import {
InfoItem,
InfoList,
InfoTextItem,
ProfileInfo,
SettingGroup,
} from '@anifriends/components';
import { APP_TYPE } from '@anifriends/constants';
import { useAuthStore } from '@anifriends/store';
import { removeItemFromStorage } from '@anifriends/utils';
import { Box, Divider, Switch, useToast, VStack } from '@chakra-ui/react';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { ChangeEvent, Suspense, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import InfoItem from 'shared/components/InfoItem';
import InfoList from 'shared/components/InfoList';
import InfoTextItem from 'shared/components/InfoTextItem';
import ProfileInfo from 'shared/components/ProfileInfo';
import SettingGroup from 'shared/components/SettingGroup';
import APP_TYPE from 'shared/constants/appType';
import useAuthStore from 'shared/store/authStore';
import { removeItemFromStorage } from 'shared/utils/localStorage';

import { updateAddressStatusAPI } from '@/apis/shelter';
import { ShelterInfo } from '@/types/apis/shetler';
Expand Down
5 changes: 2 additions & 3 deletions apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import NextIcon from '@anifriends/assets/icon_review_next.svg';
import { InfoSubtext, Label } from '@anifriends/components';
import { Avatar, Box, HStack, Image, Text } from '@chakra-ui/react';
import NextIcon from 'shared/assets/icon_review_next.svg';
import InfoSubtext from 'shared/components/InfoSubtext';
import Label from 'shared/components/Label';

type VolunteerProfileprops = {
volunteerName: string;
Expand Down
7 changes: 3 additions & 4 deletions apps/shelter/src/pages/my/reviews/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ReviewItem, ReviewItemSkeletonList } from '@anifriends/components';
import { useIntersect } from '@anifriends/hooks';
import { createFormattedTime } from '@anifriends/utils';
import { Box, Heading, VStack } from '@chakra-ui/react';
import { Suspense } from 'react';
import { useNavigate } from 'react-router-dom';
import ReviewItem from 'shared/components/ReviewItem';
import ReviewItemSkeletonList from 'shared/components/ReviewItemSkeletonList';
import useIntersect from 'shared/hooks/useIntersection';
import { createFormattedTime } from 'shared/utils/date';

import useFetchShelterReviews from './hooks/useFetchShelterReviews';
import VolunteerProfile from './VolunteerProfile';
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/notifications/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function NotificationsPage() {
return <NotReady />;
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/settings/account/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { usePhotoUpload } from '@anifriends/hooks';
import {
Avatar,
Box,
Expand All @@ -17,7 +18,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { Suspense, useCallback, useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { usePhotoUpload } from 'shared/hooks/usePhotoUpload';
import { z } from 'zod';

import { updateShelterInfo } from '@/apis/shelter';
Expand Down
19 changes: 9 additions & 10 deletions apps/shelter/src/pages/settings/password/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import { LogoImageBox } from '@anifriends/components';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { ChangePasswordRequestData } from '@anifriends/types';
import {
newPassword,
newPasswordConfirm,
oldPassword,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -14,16 +23,6 @@ import {
import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation } from '@tanstack/react-query';
import { useForm } from 'react-hook-form';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import LogoImageBox from 'shared/components/LogoImageBox';
import useToggle from 'shared/hooks/useToggle';
import { ChangePasswordRequestData } from 'shared/types/apis/auth';
import {
newPassword,
newPasswordConfirm,
oldPassword,
} from 'shared/utils/validations';
import * as z from 'zod';

import { changeShelterPassword } from '@/apis/auth';
Expand Down
26 changes: 13 additions & 13 deletions apps/shelter/src/pages/signin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
import { APP_TYPE } from '@anifriends/constants';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { useAuthStore } from '@anifriends/store';
import type { SigninRequestData } from '@anifriends/types';
import {
email,
password,
removeItemFromStorage,
setItemToStorage,
updateToast,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -18,19 +31,6 @@ import { useMutation } from '@tanstack/react-query';
import { useEffect, useId } from 'react';
import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import AnimalfriendsLogo from 'shared/assets/image-anifriends-logo.png';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import APP_TYPE from 'shared/constants/appType';
import useToggle from 'shared/hooks/useToggle';
import useAuthStore from 'shared/store/authStore';
import { SigninRequestData } from 'shared/types/apis/auth';
import {
removeItemFromStorage,
setItemToStorage,
} from 'shared/utils/localStorage';
import { updateToast } from 'shared/utils/toast';
import { email, password } from 'shared/utils/validations';
import * as z from 'zod';

import { signinShelter } from '@/apis/auth';
Expand Down
35 changes: 17 additions & 18 deletions apps/shelter/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { CheckDuplicatedEmailRequestData } from '@anifriends/types';
import {
address,
addressDetail,
email,
isEmailDuplicated,
isOpenedAddress,
name,
password,
passwordConfirm,
phoneNumber,
sparePhoneNumber,
updateToast,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -22,24 +39,6 @@ import { useMutation } from '@tanstack/react-query';
import { useId } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import AnimalfriendsLogo from 'shared/assets/image-anifriends-logo.png';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import useToggle from 'shared/hooks/useToggle';
import { CheckDuplicatedEmailRequestData } from 'shared/types/apis/auth';
import { updateToast } from 'shared/utils/toast';
import {
address,
addressDetail,
email,
isEmailDuplicated,
isOpenedAddress,
name,
password,
passwordConfirm,
phoneNumber,
sparePhoneNumber,
} from 'shared/utils/validations';
import * as z from 'zod';

import { checkDuplicatedShelterEmail, signupShelter } from '@/apis/auth';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
ApplicantStatus,
Label,
LabelText,
OptionMenu,
} from '@anifriends/components';
import { Box, HStack, MenuItem, Text, VStack } from '@chakra-ui/react';
import ApplicantStatus from 'shared/components/ApplicantStatus';
import Label from 'shared/components/Label';
import LabelText from 'shared/components/LabelText';
import OptionMenu from 'shared/components/OptionMenu';

import VolunteerRecruitItemButton from '@/pages/volunteers/_components/VolunteerRecruitItemButton';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ErrorResponseData } from '@anifriends/types';
import {
InfiniteData,
infiniteQueryOptions,
UseInfiniteQueryOptions,
} from '@tanstack/react-query';
import { AxiosError, AxiosResponse } from 'axios';
import { ErrorResponseData } from 'shared/types/apis/error';

import { getShelterRecruitments } from '@/apis/recruitment';
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/volunteers/_utils/recruitment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createFormattedTime, getDDay } from 'shared/utils/date';
import { createFormattedTime, getDDay } from '@anifriends/utils';

import { Recruitment } from '@/types/apis/recruitment';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useSuspenseQuery } from '@tanstack/react-query';
import {
getRecruitmentDetail,
RecruitmentDetailResponse,
} from 'shared/apis/common/Recruitments';
} from '@anifriends/apis';
import { useSuspenseQuery } from '@tanstack/react-query';

export type RecruitmentDetail = {
title: string;
Expand Down
24 changes: 13 additions & 11 deletions apps/shelter/src/pages/volunteers/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import {
AlertModal,
ImageCarousel,
InfoTextList,
Label,
LabelText,
} from '@anifriends/components';
import { useDetailHeaderStore } from '@anifriends/store';
import {
createFormattedTime,
createWeekDayLocalString,
getDDay,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -11,17 +24,6 @@ import {
import { useMutation } from '@tanstack/react-query';
import { Suspense, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import AlertModal from 'shared/components/AlertModal';
import ImageCarousel from 'shared/components/ImageCarousel';
import InfoTextList from 'shared/components/InfoTextList';
import Label from 'shared/components/Label';
import LabelText from 'shared/components/LabelText';
import useDetailHeaderStore from 'shared/store/detailHeaderStore';
import {
createFormattedTime,
createWeekDayLocalString,
getDDay,
} from 'shared/utils/date';

import {
closeShelterRecruitment,
Expand Down
4 changes: 2 additions & 2 deletions apps/shelter/src/pages/volunteers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AlertModal } from '@anifriends/components';
import { useIntersect } from '@anifriends/hooks';
import { Box, IconButton } from '@chakra-ui/react';
import { useSuspenseInfiniteQuery } from '@tanstack/react-query';
import { Suspense } from 'react';
import { useNavigate } from 'react-router-dom';
import AlertModal from 'shared/components/AlertModal';
import useIntersect from 'shared/hooks/useIntersection';

import { useVolunteerRecruitItem } from '@/pages/volunteers/_hooks/useVolunteerRecruitItem';
import recruitmentQueryOptions from '@/pages/volunteers/_queryOptions/recruitment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useIntersect } from '@anifriends/hooks';
import { createFormattedTime } from '@anifriends/utils';
import { Box, Card, CardBody, Heading, Text } from '@chakra-ui/react';
import { useSuspenseInfiniteQuery } from '@tanstack/react-query';
import useIntersect from 'shared/hooks/useIntersection';
import { createFormattedTime } from 'shared/utils/date';

import { getVolunteerRecruitmentsOnVolunteer } from '@/apis/volunteers';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { InfoSubtext, ReviewItem } from '@anifriends/components';
import { useIntersect } from '@anifriends/hooks';
import { createFormattedTime } from '@anifriends/utils';
import { Box, Heading, HStack, Text, VStack } from '@chakra-ui/react';
import { useSuspenseInfiniteQuery } from '@tanstack/react-query';
import InfoSubtext from 'shared/components/InfoSubtext';
import ReviewItem from 'shared/components/ReviewItem';
import useIntersect from 'shared/hooks/useIntersection';
import { createFormattedTime } from 'shared/utils/date';

import { getVolunteerReviewsOnVolunteer } from '@/apis/volunteers';

Expand Down
Loading

0 comments on commit e3af51d

Please sign in to comment.