diff --git a/.eslintrc.js b/.eslintrc.js
index 03ee7431..306e895a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,4 +1,4 @@
module.exports = {
root: true,
- extends: ['custom'],
+ extends: ['anifriends'],
};
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..d1f96a44
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,14 @@
+{
+ "arrowParens": "always",
+ "bracketSameLine": false,
+ "bracketSpacing": true,
+ "endOfLine": "auto",
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "semi": true,
+ "singleAttributePerLine": false,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "all",
+ "useTabs": false
+}
diff --git a/.prettierrc.cjs b/.prettierrc.cjs
deleted file mode 100644
index bc542e5f..00000000
--- a/.prettierrc.cjs
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = {
- tabWidth: 2,
- printWidth: 80,
- jsxBracketSameLine: false,
- semi: true,
- singleQuote: true,
- trailingComma: 'all',
- useTabs: false,
- bracketSpacing: true,
- arrowParens: 'always',
- endOfLine: 'auto',
- singleAttributePerLine: false,
-};
diff --git a/apps/shelter/.eslintrc.cjs b/apps/shelter/.eslintrc.cjs
index a3664714..69ea8439 100644
--- a/apps/shelter/.eslintrc.cjs
+++ b/apps/shelter/.eslintrc.cjs
@@ -1,6 +1,6 @@
module.exports = {
root: true,
- extends: ['custom'],
+ extends: ['anifriends'],
overrides: [
{
files: ['__mocks__/**.ts', 'src/**/*.spec.ts', 'src/**/*.spec.tsx'],
diff --git a/apps/shelter/package.json b/apps/shelter/package.json
index 4a86ef01..6b014d1b 100644
--- a/apps/shelter/package.json
+++ b/apps/shelter/package.json
@@ -14,6 +14,17 @@
"test:ui": "vitest --ui"
},
"dependencies": {
+ "@anifriends/apis": "workspace:*",
+ "@anifriends/assets": "workspace:*",
+ "@anifriends/components": "workspace:*",
+ "@anifriends/constants": "workspace:*",
+ "@anifriends/fonts": "workspace:*",
+ "@anifriends/hooks": "workspace:*",
+ "@anifriends/icons": "workspace:*",
+ "@anifriends/layout": "workspace:*",
+ "@anifriends/store": "workspace:*",
+ "@anifriends/theme": "workspace:*",
+ "@anifriends/utils": "workspace:*",
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
@@ -27,11 +38,12 @@
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-router-dom": "^6.17.0",
- "shared": "workspace:*",
"zod": "^3.22.4",
"zustand": "^4.4.4"
},
"devDependencies": {
+ "@anifriends/tsconfig": "workspace:*",
+ "@anifriends/types": "workspace:*",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
@@ -41,11 +53,11 @@
"@vitejs/plugin-react-swc": "^3.4.0",
"@vitest/ui": "^1.2.0",
"eslint": "^8.45.0",
+ "eslint-config-anifriends": "workspace:*",
"eslint-config-custom": "workspace:*",
"eslint-plugin-vitest": "^0.3.20",
"jsdom": "^23.2.0",
"msw": "^2.0.1",
- "tsconfig": "workspace:*",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vitest": "^1.2.0"
diff --git a/apps/shelter/src/App.tsx b/apps/shelter/src/App.tsx
index 9051013a..c2b0f50e 100644
--- a/apps/shelter/src/App.tsx
+++ b/apps/shelter/src/App.tsx
@@ -1,16 +1,16 @@
+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: 50 * 1000,
retry: false,
},
},
diff --git a/apps/shelter/src/apis/auth.ts b/apps/shelter/src/apis/auth.ts
index 66df5a2c..a34a74cd 100644
--- a/apps/shelter/src/apis/auth.ts
+++ b/apps/shelter/src/apis/auth.ts
@@ -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';
diff --git a/apps/shelter/src/apis/recruitment.ts b/apps/shelter/src/apis/recruitment.ts
index 3e3b47aa..d18fae0e 100644
--- a/apps/shelter/src/apis/recruitment.ts
+++ b/apps/shelter/src/apis/recruitment.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import {
ApplicantsApprovalRequest,
diff --git a/apps/shelter/src/apis/shelter.ts b/apps/shelter/src/apis/shelter.ts
index 5da11b21..534e2f47 100644
--- a/apps/shelter/src/apis/shelter.ts
+++ b/apps/shelter/src/apis/shelter.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import { ShelterInfo, UpdateShelterInfo } from '@/types/apis/shetler';
diff --git a/apps/shelter/src/apis/volunteers.ts b/apps/shelter/src/apis/volunteers.ts
index 43ce4fae..a1ce6d9e 100644
--- a/apps/shelter/src/apis/volunteers.ts
+++ b/apps/shelter/src/apis/volunteers.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import {
VolunteerCompletedsRequestParams,
diff --git a/apps/shelter/src/pages/animals/detail/index.tsx b/apps/shelter/src/pages/animals/detail/index.tsx
index e36382be..ca1135d5 100644
--- a/apps/shelter/src/pages/animals/detail/index.tsx
+++ b/apps/shelter/src/pages/animals/detail/index.tsx
@@ -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 호출
diff --git a/apps/shelter/src/pages/animals/index.tsx b/apps/shelter/src/pages/animals/index.tsx
index 877008d2..63b05e1d 100644
--- a/apps/shelter/src/pages/animals/index.tsx
+++ b/apps/shelter/src/pages/animals/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function AnimalsPage() {
return ;
diff --git a/apps/shelter/src/pages/animals/search/index.tsx b/apps/shelter/src/pages/animals/search/index.tsx
index 5bbff8b6..1780a671 100644
--- a/apps/shelter/src/pages/animals/search/index.tsx
+++ b/apps/shelter/src/pages/animals/search/index.tsx
@@ -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 호출
diff --git a/apps/shelter/src/pages/chattings/index.tsx b/apps/shelter/src/pages/chattings/index.tsx
index 25178c78..9016463e 100644
--- a/apps/shelter/src/pages/chattings/index.tsx
+++ b/apps/shelter/src/pages/chattings/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function ChattingsPage() {
return ;
diff --git a/apps/shelter/src/pages/manage/apply/_components/ApplyInfoItem.tsx b/apps/shelter/src/pages/manage/apply/_components/ApplyInfoItem.tsx
index 745392ee..7ac105b5 100644
--- a/apps/shelter/src/pages/manage/apply/_components/ApplyInfoItem.tsx
+++ b/apps/shelter/src/pages/manage/apply/_components/ApplyInfoItem.tsx
@@ -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;
diff --git a/apps/shelter/src/pages/manage/apply/_components/ManageApplyItem.tsx b/apps/shelter/src/pages/manage/apply/_components/ManageApplyItem.tsx
index 3b6655d1..0b6e7318 100644
--- a/apps/shelter/src/pages/manage/apply/_components/ManageApplyItem.tsx
+++ b/apps/shelter/src/pages/manage/apply/_components/ManageApplyItem.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/my/index.tsx b/apps/shelter/src/pages/my/index.tsx
index b6198145..b17d3350 100644
--- a/apps/shelter/src/pages/my/index.tsx
+++ b/apps/shelter/src/pages/my/index.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx b/apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx
index d557d386..175e7107 100644
--- a/apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx
+++ b/apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx
@@ -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;
diff --git a/apps/shelter/src/pages/my/reviews/index.tsx b/apps/shelter/src/pages/my/reviews/index.tsx
index b991d0b3..e6c6a4a2 100644
--- a/apps/shelter/src/pages/my/reviews/index.tsx
+++ b/apps/shelter/src/pages/my/reviews/index.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/notifications/index.tsx b/apps/shelter/src/pages/notifications/index.tsx
index e9151cfa..d6e808fb 100644
--- a/apps/shelter/src/pages/notifications/index.tsx
+++ b/apps/shelter/src/pages/notifications/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function NotificationsPage() {
return ;
diff --git a/apps/shelter/src/pages/settings/account/index.tsx b/apps/shelter/src/pages/settings/account/index.tsx
index 6a41a987..9ab6ecc5 100644
--- a/apps/shelter/src/pages/settings/account/index.tsx
+++ b/apps/shelter/src/pages/settings/account/index.tsx
@@ -1,3 +1,4 @@
+import { usePhotoUpload } from '@anifriends/hooks';
import {
Avatar,
Box,
@@ -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';
diff --git a/apps/shelter/src/pages/settings/password/index.tsx b/apps/shelter/src/pages/settings/password/index.tsx
index 0d9ff65a..95234bdd 100644
--- a/apps/shelter/src/pages/settings/password/index.tsx
+++ b/apps/shelter/src/pages/settings/password/index.tsx
@@ -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,
@@ -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';
diff --git a/apps/shelter/src/pages/signin/index.tsx b/apps/shelter/src/pages/signin/index.tsx
index 523cea12..fb773aea 100644
--- a/apps/shelter/src/pages/signin/index.tsx
+++ b/apps/shelter/src/pages/signin/index.tsx
@@ -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,
@@ -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';
diff --git a/apps/shelter/src/pages/signup/index.tsx b/apps/shelter/src/pages/signup/index.tsx
index 13ced648..075d103b 100644
--- a/apps/shelter/src/pages/signup/index.tsx
+++ b/apps/shelter/src/pages/signup/index.tsx
@@ -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,
@@ -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';
diff --git a/apps/shelter/src/pages/volunteers/_components/VolunteerRecruitItem.tsx b/apps/shelter/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
index 58e0eac0..0f4d2a49 100644
--- a/apps/shelter/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
+++ b/apps/shelter/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/volunteers/_queryOptions/recruitment.ts b/apps/shelter/src/pages/volunteers/_queryOptions/recruitment.ts
index ec90374d..4cc77c06 100644
--- a/apps/shelter/src/pages/volunteers/_queryOptions/recruitment.ts
+++ b/apps/shelter/src/pages/volunteers/_queryOptions/recruitment.ts
@@ -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 {
diff --git a/apps/shelter/src/pages/volunteers/_utils/recruitment.ts b/apps/shelter/src/pages/volunteers/_utils/recruitment.ts
index d609847e..337c5fa5 100644
--- a/apps/shelter/src/pages/volunteers/_utils/recruitment.ts
+++ b/apps/shelter/src/pages/volunteers/_utils/recruitment.ts
@@ -1,4 +1,4 @@
-import { createFormattedTime, getDDay } from 'shared/utils/date';
+import { createFormattedTime, getDDay } from '@anifriends/utils';
import { Recruitment } from '@/types/apis/recruitment';
diff --git a/apps/shelter/src/pages/volunteers/detail/_hooks/useGetVolunteerDetail.ts b/apps/shelter/src/pages/volunteers/detail/_hooks/useGetVolunteerDetail.ts
index d60d20ac..1deb14cc 100644
--- a/apps/shelter/src/pages/volunteers/detail/_hooks/useGetVolunteerDetail.ts
+++ b/apps/shelter/src/pages/volunteers/detail/_hooks/useGetVolunteerDetail.ts
@@ -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;
diff --git a/apps/shelter/src/pages/volunteers/detail/index.tsx b/apps/shelter/src/pages/volunteers/detail/index.tsx
index 036fa5ba..69eb533c 100644
--- a/apps/shelter/src/pages/volunteers/detail/index.tsx
+++ b/apps/shelter/src/pages/volunteers/detail/index.tsx
@@ -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,
@@ -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,
diff --git a/apps/shelter/src/pages/volunteers/index.tsx b/apps/shelter/src/pages/volunteers/index.tsx
index 910f97a7..f24f1bde 100644
--- a/apps/shelter/src/pages/volunteers/index.tsx
+++ b/apps/shelter/src/pages/volunteers/index.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/volunteers/profile/_components/VolunteerRecruitments.tsx b/apps/shelter/src/pages/volunteers/profile/_components/VolunteerRecruitments.tsx
index 4a75c7c4..c87ccff5 100644
--- a/apps/shelter/src/pages/volunteers/profile/_components/VolunteerRecruitments.tsx
+++ b/apps/shelter/src/pages/volunteers/profile/_components/VolunteerRecruitments.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/volunteers/profile/_components/VolunteerReviews.tsx b/apps/shelter/src/pages/volunteers/profile/_components/VolunteerReviews.tsx
index 3d6fc0f5..f22690a7 100644
--- a/apps/shelter/src/pages/volunteers/profile/_components/VolunteerReviews.tsx
+++ b/apps/shelter/src/pages/volunteers/profile/_components/VolunteerReviews.tsx
@@ -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';
diff --git a/apps/shelter/src/pages/volunteers/profile/index.tsx b/apps/shelter/src/pages/volunteers/profile/index.tsx
index bf4335cf..fa789166 100644
--- a/apps/shelter/src/pages/volunteers/profile/index.tsx
+++ b/apps/shelter/src/pages/volunteers/profile/index.tsx
@@ -1,10 +1,8 @@
+import { Label, ProfileInfo, Tabs } from '@anifriends/components';
import { Box, useToken } from '@chakra-ui/react';
import { useSuspenseQuery } from '@tanstack/react-query';
import { Suspense } from 'react';
import { useParams } from 'react-router-dom';
-import Label from 'shared/components/Label';
-import ProfileInfo from 'shared/components/ProfileInfo';
-import Tabs from 'shared/components/Tabs';
import { getVolunteerProfile } from '@/apis/volunteers';
diff --git a/apps/shelter/src/pages/volunteers/search/_components/RecruitmentsSearchFilter.tsx b/apps/shelter/src/pages/volunteers/search/_components/RecruitmentsSearchFilter.tsx
index 65415aa6..1c0f24a1 100644
--- a/apps/shelter/src/pages/volunteers/search/_components/RecruitmentsSearchFilter.tsx
+++ b/apps/shelter/src/pages/volunteers/search/_components/RecruitmentsSearchFilter.tsx
@@ -1,8 +1,6 @@
+import { SearchFilters, SearchFilterSelectData } from '@anifriends/components';
+import { PERIOD } from '@anifriends/constants';
import { ChangeEvent } from 'react';
-import SearchFilters, {
- SearchFilterSelectData,
-} from 'shared/components/SearchFilters';
-import { PERIOD } from 'shared/constants/period';
import {
RECRUITMENT_STATUS,
diff --git a/apps/shelter/src/pages/volunteers/search/_hooks/useRecruitmentSearch.ts b/apps/shelter/src/pages/volunteers/search/_hooks/useRecruitmentSearch.ts
index 0ee4ed46..d1d9ea7b 100644
--- a/apps/shelter/src/pages/volunteers/search/_hooks/useRecruitmentSearch.ts
+++ b/apps/shelter/src/pages/volunteers/search/_hooks/useRecruitmentSearch.ts
@@ -1,6 +1,5 @@
+import { useSearchFilter, useSearchKeyword } from '@anifriends/hooks';
import { ChangeEvent } from 'react';
-import { useSearchFilter } from 'shared/hooks/useSearchFilter';
-import { useSearchKeyword } from 'shared/hooks/useSearchKeyword';
import { SearchFilter } from '@/pages/volunteers/search/_types/filter';
diff --git a/apps/shelter/src/pages/volunteers/search/_types/filter.ts b/apps/shelter/src/pages/volunteers/search/_types/filter.ts
index b1712e71..1642cf1f 100644
--- a/apps/shelter/src/pages/volunteers/search/_types/filter.ts
+++ b/apps/shelter/src/pages/volunteers/search/_types/filter.ts
@@ -1,4 +1,4 @@
-import { Period } from 'shared/types/period';
+import { Period } from '@anifriends/types';
import {
RECRUITMENT_STATUS,
diff --git a/apps/shelter/src/pages/volunteers/search/index.tsx b/apps/shelter/src/pages/volunteers/search/index.tsx
index cefae708..711f65fe 100644
--- a/apps/shelter/src/pages/volunteers/search/index.tsx
+++ b/apps/shelter/src/pages/volunteers/search/index.tsx
@@ -1,8 +1,8 @@
+import { AlertModal } from '@anifriends/components';
+import { useIntersect } from '@anifriends/hooks';
+import { getDatesFromPeriod } from '@anifriends/utils';
import { Box } from '@chakra-ui/react';
import { useInfiniteQuery } from '@tanstack/react-query';
-import AlertModal from 'shared/components/AlertModal';
-import useIntersect from 'shared/hooks/useIntersection';
-import { getDatesFromPeriod } from 'shared/utils/period';
import VolunteerRecruitItem from '@/pages/volunteers/_components/VolunteerRecruitItem';
import { useVolunteerRecruitItem } from '@/pages/volunteers/_hooks/useVolunteerRecruitItem';
diff --git a/apps/shelter/src/pages/volunteers/update/index.tsx b/apps/shelter/src/pages/volunteers/update/index.tsx
index 51e88a35..aa87aa29 100644
--- a/apps/shelter/src/pages/volunteers/update/index.tsx
+++ b/apps/shelter/src/pages/volunteers/update/index.tsx
@@ -1,3 +1,6 @@
+import { EditPhotoList, Loader } from '@anifriends/components';
+import { usePhotosUpload } from '@anifriends/hooks';
+import { getKoreanTime } from '@anifriends/utils';
import {
Box,
Button,
@@ -16,10 +19,6 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
import { Suspense, useCallback, useEffect } from 'react';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router-dom';
-import EditPhotoList from 'shared/components/EditPhotoList';
-import Loader from 'shared/components/Loader';
-import { usePhotosUpload } from 'shared/hooks/usePhotosUpload';
-import { getKoreanTime } from 'shared/utils/date';
import * as z from 'zod';
import { updateShelterRecruitment } from '@/apis/recruitment';
diff --git a/apps/shelter/src/pages/volunteers/write/index.tsx b/apps/shelter/src/pages/volunteers/write/index.tsx
index 047bda77..cee779a0 100644
--- a/apps/shelter/src/pages/volunteers/write/index.tsx
+++ b/apps/shelter/src/pages/volunteers/write/index.tsx
@@ -1,3 +1,6 @@
+import { EditPhotoList } from '@anifriends/components';
+import { usePhotosUpload } from '@anifriends/hooks';
+import { getKoreanTime } from '@anifriends/utils';
import {
Box,
Button,
@@ -15,9 +18,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation } from '@tanstack/react-query';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
-import EditPhotoList from 'shared/components/EditPhotoList';
-import { usePhotosUpload } from 'shared/hooks/usePhotosUpload';
-import { getKoreanTime } from 'shared/utils/date';
import * as z from 'zod';
import { createShelterRecruitment } from '@/apis/recruitment';
diff --git a/apps/shelter/src/routes/index.tsx b/apps/shelter/src/routes/index.tsx
index 8d9bf0a6..393f63bc 100644
--- a/apps/shelter/src/routes/index.tsx
+++ b/apps/shelter/src/routes/index.tsx
@@ -1,8 +1,7 @@
+import { WithLogin } from '@anifriends/components';
+import { APP_TYPE, PAGE_TYPE } from '@anifriends/constants';
+import Layout from '@anifriends/layout';
import { createBrowserRouter, RouterProviderProps } from 'react-router-dom';
-import WithLogin from 'shared/components/WithLogin';
-import APP_TYPE from 'shared/constants/appType';
-import PAGE_TYPE from 'shared/constants/pageType';
-import Layout from 'shared/layout';
import PATH from '@/constants/path';
import AnimalsPage from '@/pages/animals';
diff --git a/apps/shelter/src/types/apis/auth.ts b/apps/shelter/src/types/apis/auth.ts
index 80d03996..c7479e4c 100644
--- a/apps/shelter/src/types/apis/auth.ts
+++ b/apps/shelter/src/types/apis/auth.ts
@@ -1,4 +1,4 @@
-import { SigninRequestData } from 'shared/types/apis/auth';
+import { SigninRequestData } from '@anifriends/types';
export type SignupRequestData = SigninRequestData & {
name: string;
diff --git a/apps/shelter/src/types/apis/recruitment.ts b/apps/shelter/src/types/apis/recruitment.ts
index 45c0d9bf..00460d77 100644
--- a/apps/shelter/src/types/apis/recruitment.ts
+++ b/apps/shelter/src/types/apis/recruitment.ts
@@ -1,4 +1,4 @@
-import { PersonGenderEng } from 'shared/types/gender';
+import { PersonGenderEng } from '@anifriends/types';
import { applicantStatusEng as RecruitmentApplicantStatus } from '../recruitment';
diff --git a/apps/shelter/tsconfig.json b/apps/shelter/tsconfig.json
index a34b7c39..4f0b2cd9 100644
--- a/apps/shelter/tsconfig.json
+++ b/apps/shelter/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "tsconfig/vite.json",
+ "extends": "@anifriends/tsconfig/vite.json",
"include": ["src"],
"compilerOptions": {
"baseUrl": ".",
diff --git a/apps/volunteer/.eslintrc.cjs b/apps/volunteer/.eslintrc.cjs
index a3664714..69ea8439 100644
--- a/apps/volunteer/.eslintrc.cjs
+++ b/apps/volunteer/.eslintrc.cjs
@@ -1,6 +1,6 @@
module.exports = {
root: true,
- extends: ['custom'],
+ extends: ['anifriends'],
overrides: [
{
files: ['__mocks__/**.ts', 'src/**/*.spec.ts', 'src/**/*.spec.tsx'],
diff --git a/apps/volunteer/package.json b/apps/volunteer/package.json
index 59a258bc..e238bed5 100644
--- a/apps/volunteer/package.json
+++ b/apps/volunteer/package.json
@@ -14,6 +14,17 @@
"test:ui": "vitest --ui"
},
"dependencies": {
+ "@anifriends/apis": "workspace:*",
+ "@anifriends/assets": "workspace:*",
+ "@anifriends/components": "workspace:*",
+ "@anifriends/constants": "workspace:*",
+ "@anifriends/fonts": "workspace:*",
+ "@anifriends/hooks": "workspace:*",
+ "@anifriends/icons": "workspace:*",
+ "@anifriends/layout": "workspace:*",
+ "@anifriends/store": "workspace:*",
+ "@anifriends/theme": "workspace:*",
+ "@anifriends/utils": "workspace:*",
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
@@ -27,11 +38,12 @@
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-router-dom": "^6.17.0",
- "shared": "workspace:*",
"zod": "^3.22.4",
"zustand": "^4.4.4"
},
"devDependencies": {
+ "@anifriends/tsconfig": "workspace:*",
+ "@anifriends/types": "workspace:*",
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
@@ -41,11 +53,11 @@
"@vitejs/plugin-react-swc": "^3.4.0",
"@vitest/ui": "^1.2.0",
"eslint": "^8.45.0",
+ "eslint-config-anifriends": "workspace:*",
"eslint-config-custom": "workspace:*",
"eslint-plugin-vitest": "^0.3.20",
"jsdom": "^23.2.0",
"msw": "^2.0.1",
- "tsconfig": "workspace:*",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vitest": "^1.2.0"
diff --git a/apps/volunteer/src/App.tsx b/apps/volunteer/src/App.tsx
index f0519e23..c03e316b 100644
--- a/apps/volunteer/src/App.tsx
+++ b/apps/volunteer/src/App.tsx
@@ -1,16 +1,16 @@
+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: 50 * 1000,
retry: false,
},
},
diff --git a/apps/volunteer/src/apis/animal.ts b/apps/volunteer/src/apis/animal.ts
index 218c55ad..bf3ea820 100644
--- a/apps/volunteer/src/apis/animal.ts
+++ b/apps/volunteer/src/apis/animal.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
type PageInfo = {
totalElements: number;
diff --git a/apps/volunteer/src/apis/auth.ts b/apps/volunteer/src/apis/auth.ts
index f3c64281..48aeecd7 100644
--- a/apps/volunteer/src/apis/auth.ts
+++ b/apps/volunteer/src/apis/auth.ts
@@ -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';
diff --git a/apps/volunteer/src/apis/recruitment.ts b/apps/volunteer/src/apis/recruitment.ts
index 321f0374..2e5533a6 100644
--- a/apps/volunteer/src/apis/recruitment.ts
+++ b/apps/volunteer/src/apis/recruitment.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import {
RecruitementsResponse,
diff --git a/apps/volunteer/src/apis/review.ts b/apps/volunteer/src/apis/review.ts
index a5e0fd18..2ab049a8 100644
--- a/apps/volunteer/src/apis/review.ts
+++ b/apps/volunteer/src/apis/review.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import {
ReviewCreateRequest,
diff --git a/apps/volunteer/src/apis/shelter.ts b/apps/volunteer/src/apis/shelter.ts
index 8cf13a93..e91a355f 100644
--- a/apps/volunteer/src/apis/shelter.ts
+++ b/apps/volunteer/src/apis/shelter.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
export type SimpleShelterProfile = {
shelterName: string;
diff --git a/apps/volunteer/src/apis/volunteer.ts b/apps/volunteer/src/apis/volunteer.ts
index 10028367..914b1faf 100644
--- a/apps/volunteer/src/apis/volunteer.ts
+++ b/apps/volunteer/src/apis/volunteer.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'shared/apis/axiosInstance';
+import { axiosInstance } from '@anifriends/apis';
import { PageInfo } from '@/types/apis/recruitment';
import {
diff --git a/apps/volunteer/src/pages/animals/index.tsx b/apps/volunteer/src/pages/animals/index.tsx
index 877008d2..63b05e1d 100644
--- a/apps/volunteer/src/pages/animals/index.tsx
+++ b/apps/volunteer/src/pages/animals/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function AnimalsPage() {
return ;
diff --git a/apps/volunteer/src/pages/chattings/index.tsx b/apps/volunteer/src/pages/chattings/index.tsx
index 25178c78..9016463e 100644
--- a/apps/volunteer/src/pages/chattings/index.tsx
+++ b/apps/volunteer/src/pages/chattings/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function ChattingsPage() {
return ;
diff --git a/apps/volunteer/src/pages/my/_components/ApplyRecruitments.tsx b/apps/volunteer/src/pages/my/_components/ApplyRecruitments.tsx
index a55225bb..e035513a 100644
--- a/apps/volunteer/src/pages/my/_components/ApplyRecruitments.tsx
+++ b/apps/volunteer/src/pages/my/_components/ApplyRecruitments.tsx
@@ -1,3 +1,6 @@
+import { Label } from '@anifriends/components';
+import { useIntersect } from '@anifriends/hooks';
+import { createFormattedTime } from '@anifriends/utils';
import {
Box,
Button,
@@ -9,9 +12,6 @@ import {
} from '@chakra-ui/react';
import { useSuspenseInfiniteQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
-import Label from 'shared/components/Label';
-import useIntersect from 'shared/hooks/useIntersection';
-import { createFormattedTime } from 'shared/utils/date';
import { getVolunteerApplicants } from '@/apis/volunteer';
import { APPLICANT_STATUS } from '@/constants/applicantStatus';
diff --git a/apps/volunteer/src/pages/my/_components/MyReviews.tsx b/apps/volunteer/src/pages/my/_components/MyReviews.tsx
index e12d66d9..682addf6 100644
--- a/apps/volunteer/src/pages/my/_components/MyReviews.tsx
+++ b/apps/volunteer/src/pages/my/_components/MyReviews.tsx
@@ -1,3 +1,6 @@
+import { AlertModal, InfoSubtext, ReviewItem } from '@anifriends/components';
+import { useIntersect } from '@anifriends/hooks';
+import { createFormattedTime } from '@anifriends/utils';
import {
Box,
Heading,
@@ -13,11 +16,6 @@ import {
} from '@tanstack/react-query';
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
-import AlertModal from 'shared/components/AlertModal';
-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 { deleteVolunteerReview } from '@/apis/review';
import { getMyReviewsAPI } from '@/apis/volunteer';
diff --git a/apps/volunteer/src/pages/my/index.tsx b/apps/volunteer/src/pages/my/index.tsx
index ec3d03d3..02edd04d 100644
--- a/apps/volunteer/src/pages/my/index.tsx
+++ b/apps/volunteer/src/pages/my/index.tsx
@@ -1,8 +1,6 @@
+import { Label, ProfileInfo, Tabs } from '@anifriends/components';
import { Box, Divider, Highlight } from '@chakra-ui/react';
import { Suspense } from 'react';
-import Label from 'shared/components/Label';
-import ProfileInfo from 'shared/components/ProfileInfo';
-import Tabs from 'shared/components/Tabs';
import ApplyRecruitments from './_components/ApplyRecruitments';
import MyReviewsTab from './_components/MyReviews';
diff --git a/apps/volunteer/src/pages/notifications/index.tsx b/apps/volunteer/src/pages/notifications/index.tsx
index e9151cfa..d6e808fb 100644
--- a/apps/volunteer/src/pages/notifications/index.tsx
+++ b/apps/volunteer/src/pages/notifications/index.tsx
@@ -1,4 +1,4 @@
-import NotReady from 'shared/components/NotReady';
+import { NotReady } from '@anifriends/components';
export default function NotificationsPage() {
return ;
diff --git a/apps/volunteer/src/pages/settings/account/index.tsx b/apps/volunteer/src/pages/settings/account/index.tsx
index 94130c24..dd69fe4e 100644
--- a/apps/volunteer/src/pages/settings/account/index.tsx
+++ b/apps/volunteer/src/pages/settings/account/index.tsx
@@ -1,3 +1,5 @@
+import { usePhotoUpload } from '@anifriends/hooks';
+import { createFormattedTime } from '@anifriends/utils';
import {
Avatar,
Box,
@@ -17,8 +19,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useCallback, useEffect } from 'react';
import { useForm } from 'react-hook-form';
-import { usePhotoUpload } from 'shared/hooks/usePhotoUpload';
-import { createFormattedTime } from 'shared/utils/date';
import { z } from 'zod';
import {
diff --git a/apps/volunteer/src/pages/settings/index.tsx b/apps/volunteer/src/pages/settings/index.tsx
index 67c456b6..ab7cb833 100644
--- a/apps/volunteer/src/pages/settings/index.tsx
+++ b/apps/volunteer/src/pages/settings/index.tsx
@@ -1,9 +1,9 @@
+import { SettingGroup } from '@anifriends/components';
+import { APP_TYPE } from '@anifriends/constants';
+import { useAuthStore } from '@anifriends/store';
+import { removeItemFromStorage } from '@anifriends/utils';
import { Box, useToast, VStack } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
-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';
export default function SettingsPage() {
const navigate = useNavigate();
diff --git a/apps/volunteer/src/pages/settings/password/index.tsx b/apps/volunteer/src/pages/settings/password/index.tsx
index 8d0c2328..5c5c73cd 100644
--- a/apps/volunteer/src/pages/settings/password/index.tsx
+++ b/apps/volunteer/src/pages/settings/password/index.tsx
@@ -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,
@@ -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 { changeVolunteerPassword } from '@/apis/auth';
diff --git a/apps/volunteer/src/pages/shelters/profile/_components/ShelterRecruitments.tsx b/apps/volunteer/src/pages/shelters/profile/_components/ShelterRecruitments.tsx
index 089dda29..b9ce17e2 100644
--- a/apps/volunteer/src/pages/shelters/profile/_components/ShelterRecruitments.tsx
+++ b/apps/volunteer/src/pages/shelters/profile/_components/ShelterRecruitments.tsx
@@ -1,10 +1,9 @@
+import { ApplicantStatus, InfoSubtext } from '@anifriends/components';
+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 { useNavigate, useParams } from 'react-router-dom';
-import ApplicantStatus from 'shared/components/ApplicantStatus';
-import InfoSubtext from 'shared/components/InfoSubtext';
-import useIntersect from 'shared/hooks/useIntersection';
-import { createFormattedTime } from 'shared/utils/date';
import {
getRecruitementsOfShelter,
diff --git a/apps/volunteer/src/pages/shelters/profile/_components/ShelterReviews.tsx b/apps/volunteer/src/pages/shelters/profile/_components/ShelterReviews.tsx
index dc921b77..8d95c06e 100644
--- a/apps/volunteer/src/pages/shelters/profile/_components/ShelterReviews.tsx
+++ b/apps/volunteer/src/pages/shelters/profile/_components/ShelterReviews.tsx
@@ -1,11 +1,9 @@
+import { InfoSubtext, Label, 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 { useParams } from 'react-router-dom';
-import InfoSubtext from 'shared/components/InfoSubtext';
-import Label from 'shared/components/Label';
-import ReviewItem from 'shared/components/ReviewItem';
-import useIntersect from 'shared/hooks/useIntersection';
-import { createFormattedTime } from 'shared/utils/date';
import { getVolunteerReviewsOnShelter } from '@/apis/review';
diff --git a/apps/volunteer/src/pages/shelters/profile/index.tsx b/apps/volunteer/src/pages/shelters/profile/index.tsx
index 4fcaba11..99355c25 100644
--- a/apps/volunteer/src/pages/shelters/profile/index.tsx
+++ b/apps/volunteer/src/pages/shelters/profile/index.tsx
@@ -1,10 +1,8 @@
+import { InfoTextList, ProfileInfo, Tabs } from '@anifriends/components';
import { Box, Divider } from '@chakra-ui/react';
import { useSuspenseQuery } from '@tanstack/react-query';
import { Suspense } from 'react';
import { useParams } from 'react-router-dom';
-import InfoTextList from 'shared/components/InfoTextList';
-import ProfileInfo from 'shared/components/ProfileInfo';
-import Tabs from 'shared/components/Tabs';
import { getShelterProfileDetail } from '@/apis/shelter';
diff --git a/apps/volunteer/src/pages/shelters/reviews/update/index.tsx b/apps/volunteer/src/pages/shelters/reviews/update/index.tsx
index 93eed26e..d00a32d9 100644
--- a/apps/volunteer/src/pages/shelters/reviews/update/index.tsx
+++ b/apps/volunteer/src/pages/shelters/reviews/update/index.tsx
@@ -1,3 +1,5 @@
+import { EditPhotoList, ProfileInfo } from '@anifriends/components';
+import { usePhotosUpload } from '@anifriends/hooks';
import {
Box,
Divider,
@@ -13,9 +15,6 @@ import { useMutation, useQuery } from '@tanstack/react-query';
import { useCallback, useEffect } from 'react';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router-dom';
-import EditPhotoList from 'shared/components/EditPhotoList';
-import ProfileInfo from 'shared/components/ProfileInfo';
-import { usePhotosUpload } from 'shared/hooks/usePhotosUpload';
import { getVolunteerReviewDetail, updateVolunteerReview } from '@/apis/review';
import { getSimpleShelterProfile } from '@/apis/shelter';
diff --git a/apps/volunteer/src/pages/shelters/reviews/write/index.tsx b/apps/volunteer/src/pages/shelters/reviews/write/index.tsx
index 69261e8d..f44740ab 100644
--- a/apps/volunteer/src/pages/shelters/reviews/write/index.tsx
+++ b/apps/volunteer/src/pages/shelters/reviews/write/index.tsx
@@ -1,3 +1,5 @@
+import { EditPhotoList, ProfileInfo } from '@anifriends/components';
+import { usePhotosUpload } from '@anifriends/hooks';
import {
Box,
Divider,
@@ -12,9 +14,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation, useQuery } from '@tanstack/react-query';
import { SubmitHandler, useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router-dom';
-import EditPhotoList from 'shared/components/EditPhotoList';
-import ProfileInfo from 'shared/components/ProfileInfo';
-import { usePhotosUpload } from 'shared/hooks/usePhotosUpload';
import { createVolunteerReview } from '@/apis/review';
import { getSimpleShelterProfile } from '@/apis/shelter';
diff --git a/apps/volunteer/src/pages/signin/index.tsx b/apps/volunteer/src/pages/signin/index.tsx
index 1599da0b..055fe118 100644
--- a/apps/volunteer/src/pages/signin/index.tsx
+++ b/apps/volunteer/src/pages/signin/index.tsx
@@ -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 { SigninRequestData } from '@anifriends/types';
+import {
+ email,
+ password,
+ removeItemFromStorage,
+ setItemToStorage,
+ updateToast,
+} from '@anifriends/utils';
import {
Box,
Button,
@@ -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 { signinVolunteer } from '@/apis/auth';
diff --git a/apps/volunteer/src/pages/signup/index.tsx b/apps/volunteer/src/pages/signup/index.tsx
index e7d41278..4b5532d4 100644
--- a/apps/volunteer/src/pages/signup/index.tsx
+++ b/apps/volunteer/src/pages/signup/index.tsx
@@ -1,3 +1,23 @@
+import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
+import { RadioGroup } from '@anifriends/components';
+import { useToggle } from '@anifriends/hooks';
+import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
+import {
+ CheckDuplicatedEmailRequestData,
+ PersonGenderEng,
+ PersonGenderKor,
+} from '@anifriends/types';
+import {
+ birthDate,
+ email,
+ gender,
+ isEmailDuplicated,
+ name,
+ password,
+ passwordConfirm,
+ phoneNumber,
+ updateToast,
+} from '@anifriends/utils';
import {
Box,
Button,
@@ -20,24 +40,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 RadioGroup from 'shared/components/RadioGroup';
-import useToggle from 'shared/hooks/useToggle';
-import { CheckDuplicatedEmailRequestData } from 'shared/types/apis/auth';
-import { PersonGenderEng, PersonGenderKor } from 'shared/types/gender';
-import { updateToast } from 'shared/utils/toast';
-import {
- birthDate,
- email,
- gender,
- isEmailDuplicated,
- name,
- password,
- passwordConfirm,
- phoneNumber,
-} from 'shared/utils/validations';
import * as z from 'zod';
import { checkDuplicatedVolunteerEmail, signupVolunteer } from '@/apis/auth';
diff --git a/apps/volunteer/src/pages/volunteers/_components/VolunteerRecruitItem.tsx b/apps/volunteer/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
index 7ac4e0f6..e982571a 100644
--- a/apps/volunteer/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
+++ b/apps/volunteer/src/pages/volunteers/_components/VolunteerRecruitItem.tsx
@@ -1,10 +1,12 @@
+import NoImage from '@anifriends/assets/icon_no_image.svg';
+import {
+ ApplicantStatus,
+ InfoSubtext,
+ Label,
+ LabelText,
+} from '@anifriends/components';
import { AspectRatio, Box, Flex, Image, Text, VStack } from '@chakra-ui/react';
import { MouseEvent } from 'react';
-import NoImage from 'shared/assets/icon_no_image.svg';
-import ApplicantStatus from 'shared/components/ApplicantStatus';
-import InfoSubText from 'shared/components/InfoSubtext';
-import Label from 'shared/components/Label';
-import LabelText from 'shared/components/LabelText';
type Recruitment = {
id: number;
@@ -73,7 +75,7 @@ export default function VolunteerRecruitItem({
{shelterName}
-
+
InternalAxiosRequestConfig;
onErrorRequest: (error: Error) => void | Promise;
onResponse: (response: AxiosResponse) => AxiosResponse;
@@ -30,16 +30,18 @@ class AxiosService {
onErrorRequest,
onResponse,
onErrorResponse,
- }: interceptors): AxiosService {
+ }: Interceptors): AxiosService {
if (!AxiosService.instance) {
const axiosInstance = axios.create({
baseURL: BASE_URL,
withCredentials: true,
});
+
axiosInstance.interceptors.request.use(onRequest, onErrorRequest);
axiosInstance.interceptors.response.use(onResponse, onErrorResponse);
this.instance = new AxiosService(axiosInstance);
}
+
return this.instance;
}
@@ -70,7 +72,7 @@ class AxiosService {
}
}
-export default AxiosService.getInstance({
+export const axiosInstance = AxiosService.getInstance({
onRequest,
onErrorRequest,
onResponse,
diff --git a/packages/shared/apis/axiosInterceptor.ts b/packages/apis/src/axiosInterceptor.ts
similarity index 92%
rename from packages/shared/apis/axiosInterceptor.ts
rename to packages/apis/src/axiosInterceptor.ts
index 900e98df..eaab4004 100644
--- a/packages/shared/apis/axiosInterceptor.ts
+++ b/packages/apis/src/axiosInterceptor.ts
@@ -1,7 +1,6 @@
+import { useAuthStore } from '@anifriends/store';
import { AxiosResponse, InternalAxiosRequestConfig } from 'axios';
-import useAuthStore from '../store/authStore';
-
export const onRequest = (config: InternalAxiosRequestConfig) => {
const accessToken = useAuthStore.getState().user?.accessToken;
if (useAuthStore.getState().user?.accessToken) {
diff --git a/packages/apis/src/common/accessToken.ts b/packages/apis/src/common/accessToken.ts
new file mode 100644
index 00000000..31078738
--- /dev/null
+++ b/packages/apis/src/common/accessToken.ts
@@ -0,0 +1,6 @@
+import type { SigninResponseData } from '@anifriends/types';
+
+import { axiosInstance } from '../axiosInstance';
+
+export const getAccessTokenAPI = () =>
+ axiosInstance.post('/auth/refresh');
diff --git a/packages/shared/apis/common/Image.ts b/packages/apis/src/common/image.ts
similarity index 85%
rename from packages/shared/apis/common/Image.ts
rename to packages/apis/src/common/image.ts
index 57ef7489..cffcf06e 100644
--- a/packages/shared/apis/common/Image.ts
+++ b/packages/apis/src/common/image.ts
@@ -1,4 +1,4 @@
-import axiosInstance from '../axiosInstance';
+import { axiosInstance } from '../axiosInstance';
type uploadImageRequest = FormData;
diff --git a/packages/apis/src/common/index.ts b/packages/apis/src/common/index.ts
new file mode 100644
index 00000000..fcf9aee1
--- /dev/null
+++ b/packages/apis/src/common/index.ts
@@ -0,0 +1,5 @@
+export * from './accessToken';
+export * from './image';
+export * from './recruitments';
+export * from './review';
+export * from './volunteer';
diff --git a/packages/shared/apis/common/Recruitments.ts b/packages/apis/src/common/recruitments.ts
similarity index 97%
rename from packages/shared/apis/common/Recruitments.ts
rename to packages/apis/src/common/recruitments.ts
index 6e775fda..e1ed72e8 100644
--- a/packages/shared/apis/common/Recruitments.ts
+++ b/packages/apis/src/common/recruitments.ts
@@ -1,4 +1,4 @@
-import axiosInstance from '../axiosInstance';
+import { axiosInstance } from '../axiosInstance';
export type RecruitmentDetailResponse = {
recruitmentTitle: string;
diff --git a/packages/shared/apis/common/Review.ts b/packages/apis/src/common/review.ts
similarity index 91%
rename from packages/shared/apis/common/Review.ts
rename to packages/apis/src/common/review.ts
index 531b981e..31e3ced2 100644
--- a/packages/shared/apis/common/Review.ts
+++ b/packages/apis/src/common/review.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'apis/axiosInstance';
+import { axiosInstance } from '../axiosInstance';
export const getVolunteerReviews = (
volunteerId: number,
diff --git a/packages/shared/apis/common/Volunteer.ts b/packages/apis/src/common/volunteer.ts
similarity index 84%
rename from packages/shared/apis/common/Volunteer.ts
rename to packages/apis/src/common/volunteer.ts
index 7fbc4510..6197051c 100644
--- a/packages/shared/apis/common/Volunteer.ts
+++ b/packages/apis/src/common/volunteer.ts
@@ -1,4 +1,4 @@
-import axiosInstance from 'apis/axiosInstance';
+import { axiosInstance } from '../axiosInstance';
export const getVolunteerProfileInfo = (recruitmentId: number) =>
axiosInstance.get<{
diff --git a/packages/apis/src/index.ts b/packages/apis/src/index.ts
new file mode 100644
index 00000000..771f97f7
--- /dev/null
+++ b/packages/apis/src/index.ts
@@ -0,0 +1,3 @@
+export * from './axiosInstance';
+export * from './axiosInterceptor';
+export * from './common';
diff --git a/packages/apis/tsconfig.json b/packages/apis/tsconfig.json
new file mode 100644
index 00000000..f2fdd2c0
--- /dev/null
+++ b/packages/apis/tsconfig.json
@@ -0,0 +1,5 @@
+{
+ "extends": "@anifriends/tsconfig/react-library.json",
+ "include": ["src"],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/shared/assets/bottomNavBar/icon_animals_selected.svg b/packages/assets/bottomNavBar/icon_animals_selected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_animals_selected.svg
rename to packages/assets/bottomNavBar/icon_animals_selected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_animals_unselected.svg b/packages/assets/bottomNavBar/icon_animals_unselected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_animals_unselected.svg
rename to packages/assets/bottomNavBar/icon_animals_unselected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_chattings_selected.svg b/packages/assets/bottomNavBar/icon_chattings_selected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_chattings_selected.svg
rename to packages/assets/bottomNavBar/icon_chattings_selected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_chattings_unselected.svg b/packages/assets/bottomNavBar/icon_chattings_unselected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_chattings_unselected.svg
rename to packages/assets/bottomNavBar/icon_chattings_unselected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_mypage_selected.svg b/packages/assets/bottomNavBar/icon_mypage_selected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_mypage_selected.svg
rename to packages/assets/bottomNavBar/icon_mypage_selected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_mypage_unselected.svg b/packages/assets/bottomNavBar/icon_mypage_unselected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_mypage_unselected.svg
rename to packages/assets/bottomNavBar/icon_mypage_unselected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_volunteers_selected.svg b/packages/assets/bottomNavBar/icon_volunteers_selected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_volunteers_selected.svg
rename to packages/assets/bottomNavBar/icon_volunteers_selected.svg
diff --git a/packages/shared/assets/bottomNavBar/icon_volunteers_unselected.svg b/packages/assets/bottomNavBar/icon_volunteers_unselected.svg
similarity index 100%
rename from packages/shared/assets/bottomNavBar/icon_volunteers_unselected.svg
rename to packages/assets/bottomNavBar/icon_volunteers_unselected.svg
diff --git a/packages/shared/assets/icon-IoEyeOff.svg b/packages/assets/icon-IoEyeOff.svg
similarity index 100%
rename from packages/shared/assets/icon-IoEyeOff.svg
rename to packages/assets/icon-IoEyeOff.svg
diff --git a/packages/shared/assets/icon-IoEyeSharp.svg b/packages/assets/icon-IoEyeSharp.svg
similarity index 100%
rename from packages/shared/assets/icon-IoEyeSharp.svg
rename to packages/assets/icon-IoEyeSharp.svg
diff --git a/packages/shared/assets/icon_BiX.svg b/packages/assets/icon_BiX.svg
similarity index 100%
rename from packages/shared/assets/icon_BiX.svg
rename to packages/assets/icon_BiX.svg
diff --git a/packages/shared/assets/icon_IoCamera.svg b/packages/assets/icon_IoCamera.svg
similarity index 100%
rename from packages/shared/assets/icon_IoCamera.svg
rename to packages/assets/icon_IoCamera.svg
diff --git a/packages/shared/assets/icon_applicant.svg b/packages/assets/icon_applicant.svg
similarity index 100%
rename from packages/shared/assets/icon_applicant.svg
rename to packages/assets/icon_applicant.svg
diff --git a/packages/shared/assets/icon_back.svg b/packages/assets/icon_back.svg
similarity index 100%
rename from packages/shared/assets/icon_back.svg
rename to packages/assets/icon_back.svg
diff --git a/packages/shared/assets/icon_menu.svg b/packages/assets/icon_menu.svg
similarity index 100%
rename from packages/shared/assets/icon_menu.svg
rename to packages/assets/icon_menu.svg
diff --git a/packages/shared/assets/icon_next.svg b/packages/assets/icon_next.svg
similarity index 100%
rename from packages/shared/assets/icon_next.svg
rename to packages/assets/icon_next.svg
diff --git a/packages/shared/assets/icon_no_image.svg b/packages/assets/icon_no_image.svg
similarity index 100%
rename from packages/shared/assets/icon_no_image.svg
rename to packages/assets/icon_no_image.svg
diff --git a/packages/shared/assets/icon_notifications.svg b/packages/assets/icon_notifications.svg
similarity index 100%
rename from packages/shared/assets/icon_notifications.svg
rename to packages/assets/icon_notifications.svg
diff --git a/packages/shared/assets/icon_review_next.svg b/packages/assets/icon_review_next.svg
similarity index 100%
rename from packages/shared/assets/icon_review_next.svg
rename to packages/assets/icon_review_next.svg
diff --git a/packages/shared/assets/icon_search.svg b/packages/assets/icon_search.svg
similarity index 100%
rename from packages/shared/assets/icon_search.svg
rename to packages/assets/icon_search.svg
diff --git a/packages/shared/assets/icon_settings.svg b/packages/assets/icon_settings.svg
similarity index 100%
rename from packages/shared/assets/icon_settings.svg
rename to packages/assets/icon_settings.svg
diff --git a/packages/shared/assets/image-anifriends-logo.png b/packages/assets/image-anifriends-logo.png
similarity index 100%
rename from packages/shared/assets/image-anifriends-logo.png
rename to packages/assets/image-anifriends-logo.png
diff --git a/packages/assets/package.json b/packages/assets/package.json
new file mode 100644
index 00000000..e247cab8
--- /dev/null
+++ b/packages/assets/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "@anifriends/assets",
+ "version": "0.0.0",
+ "private": true,
+ "license": "MIT",
+ "main": "src/index.ts",
+ "dependencies": {
+ "react": "^18.2.0"
+ },
+ "devDependencies": {
+ "@anifriends/tsconfig": "workspace:*",
+ "@types/react": "^18.2.15"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/assets/src/ApplicantIcon.tsx b/packages/assets/src/ApplicantIcon.tsx
new file mode 100644
index 00000000..4c36fbb0
--- /dev/null
+++ b/packages/assets/src/ApplicantIcon.tsx
@@ -0,0 +1,26 @@
+import { ComponentProps } from 'react';
+
+export function ApplicantIcon(props: ComponentProps<'svg'>) {
+ return (
+
+ );
+}
diff --git a/packages/assets/src/index.tsx b/packages/assets/src/index.tsx
new file mode 100644
index 00000000..680f85a8
--- /dev/null
+++ b/packages/assets/src/index.tsx
@@ -0,0 +1 @@
+export { ApplicantIcon } from './ApplicantIcon';
diff --git a/packages/assets/tsconfig.json b/packages/assets/tsconfig.json
new file mode 100644
index 00000000..f2fdd2c0
--- /dev/null
+++ b/packages/assets/tsconfig.json
@@ -0,0 +1,5 @@
+{
+ "extends": "@anifriends/tsconfig/react-library.json",
+ "include": ["src"],
+ "exclude": ["dist", "build", "node_modules"]
+}
diff --git a/packages/components/package.json b/packages/components/package.json
new file mode 100644
index 00000000..18a53628
--- /dev/null
+++ b/packages/components/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@anifriends/components",
+ "version": "0.0.0",
+ "private": true,
+ "license": "MIT",
+ "main": "src/index.tsx",
+ "dependencies": {
+ "@anifriends/assets": "workspace:*",
+ "@anifriends/constants": "workspace:*",
+ "@anifriends/store": "workspace:*",
+ "@anifriends/utils": "workspace:*",
+ "@chakra-ui/react": "^2.8.1",
+ "@emotion/react": "^11.11.1",
+ "@emotion/styled": "^11.11.0",
+ "@tanstack/react-query": "^5.4.3",
+ "framer-motion": "^10.16.4",
+ "react": "^18.2.0",
+ "react-error-boundary": "^4.0.11",
+ "react-router-dom": "^6.17.0"
+ },
+ "devDependencies": {
+ "@anifriends/tsconfig": "workspace:*",
+ "@types/react": "^18.2.15",
+ "typescript": "^5.0.2"
+ },
+ "publishConfig": {
+ "access": "public"
+ }
+}
diff --git a/packages/shared/png.d.ts b/packages/components/png.d.ts
similarity index 100%
rename from packages/shared/png.d.ts
rename to packages/components/png.d.ts
diff --git a/packages/shared/components/AlertModal.tsx b/packages/components/src/AlertModal.tsx
similarity index 94%
rename from packages/shared/components/AlertModal.tsx
rename to packages/components/src/AlertModal.tsx
index d747c535..a1be16e9 100644
--- a/packages/shared/components/AlertModal.tsx
+++ b/packages/components/src/AlertModal.tsx
@@ -10,14 +10,14 @@ import {
ModalProps,
} from '@chakra-ui/react';
-export type AlertModalProps = {
+type AlertModalProps = {
modalTitle?: string;
modalContent?: string;
btnTitle: string;
onClick?: VoidFunction;
} & Omit;
-export default function AlertModal({
+export function AlertModal({
modalTitle,
modalContent,
btnTitle,
diff --git a/packages/shared/components/ApplicantStatus.tsx b/packages/components/src/ApplicantStatus.tsx
similarity index 82%
rename from packages/shared/components/ApplicantStatus.tsx
rename to packages/components/src/ApplicantStatus.tsx
index f9402b0d..856bb215 100644
--- a/packages/shared/components/ApplicantStatus.tsx
+++ b/packages/components/src/ApplicantStatus.tsx
@@ -1,14 +1,13 @@
+import ApplicantIcon from '@anifriends/assets/icon_applicant.svg';
import { Flex, Image, Text } from '@chakra-ui/react';
-import ApplicantIcon from '../assets/icon_applicant.svg';
-
type ApplicantStatusProps = {
size?: number;
numerator: number;
denominator: number;
};
-export default function ApplicantStatus({
+export function ApplicantStatus({
size = 5,
numerator,
denominator,
diff --git a/packages/shared/components/EditPhotoItem.tsx b/packages/components/src/EditPhotoItem.tsx
similarity index 85%
rename from packages/shared/components/EditPhotoItem.tsx
rename to packages/components/src/EditPhotoItem.tsx
index ea0dd273..32206ca3 100644
--- a/packages/shared/components/EditPhotoItem.tsx
+++ b/packages/components/src/EditPhotoItem.tsx
@@ -1,15 +1,14 @@
+import BiX from '@anifriends/assets/icon_BiX.svg';
+import NoImage from '@anifriends/assets/icon_no_image.svg';
import type { ImageProps } from '@chakra-ui/react';
import { Box, Image } from '@chakra-ui/react';
-import BiX from '../assets/icon_BiX.svg';
-import NoImage from '../assets/icon_no_image.svg';
-
type UploadedPhotoItemProps = {
photoSrc: ImageProps['src'];
onDeletePhoto: VoidFunction;
};
-export default function EditPhotoItem({
+export function EditPhotoItem({
photoSrc,
onDeletePhoto,
}: UploadedPhotoItemProps) {
diff --git a/packages/shared/components/EditPhotoList.tsx b/packages/components/src/EditPhotoList.tsx
similarity index 92%
rename from packages/shared/components/EditPhotoList.tsx
rename to packages/components/src/EditPhotoList.tsx
index 846020bc..68debbf0 100644
--- a/packages/shared/components/EditPhotoList.tsx
+++ b/packages/components/src/EditPhotoList.tsx
@@ -1,8 +1,8 @@
+import IoIosCamera from '@anifriends/assets/icon_IoCamera.svg';
import { Box, Flex, HStack, Image, Input, Text } from '@chakra-ui/react';
-import { type ChangeEvent } from 'react';
+import type { ChangeEvent } from 'react';
-import IoIosCamera from '../assets/icon_IoCamera.svg';
-import EditPhotoItem from './EditPhotoItem';
+import { EditPhotoItem } from '.';
export type Photo = {
id: string;
@@ -22,7 +22,7 @@ type UploadPhotoItemProps = {
onUploadPhoto: (event: ChangeEvent) => void;
};
-export default function EditPhotoList({
+export function EditPhotoList({
photos,
uploadLimit = 5,
onUploadPhoto,
diff --git a/packages/shared/components/FilterGroup.tsx b/packages/components/src/FilterGroup.tsx
similarity index 88%
rename from packages/shared/components/FilterGroup.tsx
rename to packages/components/src/FilterGroup.tsx
index 505db8ef..43077ba3 100644
--- a/packages/shared/components/FilterGroup.tsx
+++ b/packages/components/src/FilterGroup.tsx
@@ -5,7 +5,7 @@ type FilterGroupProps = {
children: ReactNode;
};
-export default function FilterGroup({ children }: FilterGroupProps) {
+export function FilterGroup({ children }: FilterGroupProps) {
return (
{children}
diff --git a/packages/shared/components/ImageCarousel.tsx b/packages/components/src/ImageCarousel.tsx
similarity index 96%
rename from packages/shared/components/ImageCarousel.tsx
rename to packages/components/src/ImageCarousel.tsx
index dc49ff8d..0014f55c 100644
--- a/packages/shared/components/ImageCarousel.tsx
+++ b/packages/components/src/ImageCarousel.tsx
@@ -1,3 +1,4 @@
+import BackIcon from '@anifriends/assets/icon_back.svg';
import { Box, chakra, Flex, Image, shouldForwardProp } from '@chakra-ui/react';
import type { PanInfo } from 'framer-motion';
import {
@@ -8,12 +9,6 @@ import {
} from 'framer-motion';
import { useState } from 'react';
-import BackIcon from '../assets/icon_back.svg';
-
-type ImageCarouselProps = {
- imageUrls: string[];
-};
-
const variants = {
enter: (direction: number) => {
return {
@@ -38,7 +33,11 @@ const swipeConfidenceThreshold = 10000;
const swipePower = (offset: number, velocity: number) =>
Math.abs(offset) * velocity;
-export default function ImageCarousel({ imageUrls }: ImageCarouselProps) {
+type ImageCarouselProps = {
+ imageUrls: string[];
+};
+
+export function ImageCarousel({ imageUrls }: ImageCarouselProps) {
const [[page, direction], setPage] = useState([0, 0]);
const imageUrlIndex = wrap(0, imageUrls.length, page);
diff --git a/packages/shared/components/InfoItem.tsx b/packages/components/src/InfoItem.tsx
similarity index 94%
rename from packages/shared/components/InfoItem.tsx
rename to packages/components/src/InfoItem.tsx
index 68864206..bcfad0f6 100644
--- a/packages/shared/components/InfoItem.tsx
+++ b/packages/components/src/InfoItem.tsx
@@ -11,7 +11,7 @@ export type InfoItemProps = {
children: ReactElement;
};
-export default function InfoItem({
+export function InfoItem({
title,
titleTextStyles,
children,
diff --git a/packages/shared/components/InfoList.tsx b/packages/components/src/InfoList.tsx
similarity index 78%
rename from packages/shared/components/InfoList.tsx
rename to packages/components/src/InfoList.tsx
index 07213df8..14cf19dd 100644
--- a/packages/shared/components/InfoList.tsx
+++ b/packages/components/src/InfoList.tsx
@@ -1,6 +1,6 @@
import { Flex, FlexProps } from '@chakra-ui/react';
-export default function InfoList({ children, ...props }: FlexProps) {
+export function InfoList({ children, ...props }: FlexProps) {
return (
;
-export default function InfoSubtext({
+export function InfoSubtext({
title,
content,
fontSize = 'xs',
diff --git a/packages/shared/components/InfoTextItem.tsx b/packages/components/src/InfoTextItem.tsx
similarity index 84%
rename from packages/shared/components/InfoTextItem.tsx
rename to packages/components/src/InfoTextItem.tsx
index 5d8b32bb..474eb107 100644
--- a/packages/shared/components/InfoTextItem.tsx
+++ b/packages/components/src/InfoTextItem.tsx
@@ -1,7 +1,8 @@
import type { TextProps } from '@chakra-ui/react';
import { Text } from '@chakra-ui/react';
-import InfoItem, { InfoItemStylesProps } from './InfoItem';
+import type { InfoItemStylesProps } from '.';
+import { InfoItem } from '.';
export type InfoTextItemStylesProps = {
contentTextStyles?: TextProps;
@@ -12,7 +13,7 @@ export type InfoTextItemProps = {
content: string;
};
-export default function InfoTextItem({
+export function InfoTextItem({
content,
contentTextStyles,
...props
diff --git a/packages/shared/components/InfoTextList.tsx b/packages/components/src/InfoTextList.tsx
similarity index 59%
rename from packages/shared/components/InfoTextList.tsx
rename to packages/components/src/InfoTextList.tsx
index 1a658883..7878801c 100644
--- a/packages/shared/components/InfoTextList.tsx
+++ b/packages/components/src/InfoTextList.tsx
@@ -1,17 +1,13 @@
import { FlexProps } from '@chakra-ui/react';
-import InfoList from './InfoList';
-import type { InfoTextItemProps } from './InfoTextItem';
-import InfoTextItem from './InfoTextItem';
+import type { InfoTextItemProps } from '.';
+import { InfoList, InfoTextItem } from '.';
type InfoTextListProps = {
infoTextItems: InfoTextItemProps[];
} & Omit;
-export default function InfoTextList({
- infoTextItems,
- ...props
-}: InfoTextListProps) {
+export function InfoTextList({ infoTextItems, ...props }: InfoTextListProps) {
return (
{infoTextItems.map((infoTextItemProps, index) => (
diff --git a/packages/shared/components/Label.tsx b/packages/components/src/Label.tsx
similarity index 95%
rename from packages/shared/components/Label.tsx
rename to packages/components/src/Label.tsx
index 6ac243b6..86dfab93 100644
--- a/packages/shared/components/Label.tsx
+++ b/packages/components/src/Label.tsx
@@ -13,7 +13,7 @@ export type LabelProps = {
type?: keyof typeof LABEL_BACKGROUND_COLOR;
} & Pick;
-export default function Label({
+export function Label({
labelTitle,
type = 'GREEN',
fontSize = 'xs',
diff --git a/packages/shared/components/LabelText.tsx b/packages/components/src/LabelText.tsx
similarity index 74%
rename from packages/shared/components/LabelText.tsx
rename to packages/components/src/LabelText.tsx
index 4c88e1bd..7d977890 100644
--- a/packages/shared/components/LabelText.tsx
+++ b/packages/components/src/LabelText.tsx
@@ -1,11 +1,13 @@
import { HStack, Text } from '@chakra-ui/react';
-import type { LabelProps } from './Label';
-import Label from './Label';
+import type { LabelProps } from '.';
+import { Label } from '.';
-type LabelTextProps = { content: string } & LabelProps;
+type LabelTextProps = LabelProps & {
+ content: string;
+};
-export default function LabelText({
+export function LabelText({
labelTitle,
type,
content,
diff --git a/packages/shared/components/Loader.tsx b/packages/components/src/Loader.tsx
similarity index 88%
rename from packages/shared/components/Loader.tsx
rename to packages/components/src/Loader.tsx
index d794a803..c6dd92e0 100644
--- a/packages/shared/components/Loader.tsx
+++ b/packages/components/src/Loader.tsx
@@ -1,6 +1,6 @@
import { Flex, Spinner } from '@chakra-ui/react';
-export default function Loader() {
+export function Loader() {
return (
;
}
-export default function LocalErrorBoundary({
- children,
-}: {
- children: ReactNode;
-}) {
+export function LocalErrorBoundary({ children }: { children: ReactNode }) {
return (
{({ reset }) => (
diff --git a/packages/shared/components/LogoImageBox.tsx b/packages/components/src/LogoImageBox.tsx
similarity index 62%
rename from packages/shared/components/LogoImageBox.tsx
rename to packages/components/src/LogoImageBox.tsx
index 03b94c4a..a09bc2ee 100644
--- a/packages/shared/components/LogoImageBox.tsx
+++ b/packages/components/src/LogoImageBox.tsx
@@ -1,8 +1,7 @@
+import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
import { Center, Image } from '@chakra-ui/react';
-import AnimalfriendsLogo from '../assets/image-anifriends-logo.png';
-
-export default function LogoImageBox() {
+export function LogoImageBox() {
return (
diff --git a/packages/shared/components/NotReady.tsx b/packages/components/src/NotReady.tsx
similarity index 94%
rename from packages/shared/components/NotReady.tsx
rename to packages/components/src/NotReady.tsx
index f800a6d2..f26e9488 100644
--- a/packages/shared/components/NotReady.tsx
+++ b/packages/components/src/NotReady.tsx
@@ -1,7 +1,7 @@
import { Button, Heading, HStack, Text, VStack } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
-export default function NotReady() {
+export function NotReady() {
const navigate = useNavigate();
return (
diff --git a/packages/shared/components/OptionMenu.tsx b/packages/components/src/OptionMenu.tsx
similarity index 79%
rename from packages/shared/components/OptionMenu.tsx
rename to packages/components/src/OptionMenu.tsx
index 10fa8cf6..5ee04645 100644
--- a/packages/shared/components/OptionMenu.tsx
+++ b/packages/components/src/OptionMenu.tsx
@@ -1,3 +1,4 @@
+import MenuIcon from '@anifriends/assets/icon_menu.svg';
import {
Image,
Menu,
@@ -8,13 +9,11 @@ import {
} from '@chakra-ui/react';
import { ReactElement } from 'react';
-import MenuIcon from '../assets/icon_menu.svg';
-
type OptionMenuProps = {
children: ReactElement | ReactElement[];
} & Omit;
-export default function OptionMenu({ children, ...props }: OptionMenuProps) {
+export function OptionMenu({ children, ...props }: OptionMenuProps) {
return (