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 ( diff --git a/packages/shared/components/ProfileInfo.tsx b/packages/components/src/ProfileInfo.tsx similarity index 95% rename from packages/shared/components/ProfileInfo.tsx rename to packages/components/src/ProfileInfo.tsx index 0f692143..3db4def3 100644 --- a/packages/shared/components/ProfileInfo.tsx +++ b/packages/components/src/ProfileInfo.tsx @@ -7,7 +7,7 @@ type ProfileInfoProps = { children?: React.ReactNode; }; -export default function ProfileInfo({ +export function ProfileInfo({ infoImage, infoTitle, infoTexts, diff --git a/packages/shared/components/RadioGroup.tsx b/packages/components/src/RadioGroup.tsx similarity index 93% rename from packages/shared/components/RadioGroup.tsx rename to packages/components/src/RadioGroup.tsx index 30a132b0..27ca4ad3 100644 --- a/packages/shared/components/RadioGroup.tsx +++ b/packages/components/src/RadioGroup.tsx @@ -23,7 +23,7 @@ type RadioGroupProps = Omit & { radioProps?: RadioProps; }; -export default function RadioGroup({ +export function RadioGroup({ value, onChange, defaultValue, diff --git a/packages/shared/components/ReviewItem.tsx b/packages/components/src/ReviewItem.tsx similarity index 92% rename from packages/shared/components/ReviewItem.tsx rename to packages/components/src/ReviewItem.tsx index 5519dd8a..8d8306eb 100644 --- a/packages/shared/components/ReviewItem.tsx +++ b/packages/components/src/ReviewItem.tsx @@ -1,3 +1,4 @@ +import MenuIcon from '@anifriends/assets/icon_menu.svg'; import { Card, HStack, @@ -8,18 +9,7 @@ import { MenuList, Text, } from '@chakra-ui/react'; -import React from 'react'; - -import MenuIcon from '../assets/icon_menu.svg'; - -type ReviewItemProps = { - children: React.ReactNode; - content: string; - images?: string[]; - showMenuButton?: boolean; - onUpdate?: VoidFunction; - onDelete?: VoidFunction; -}; +import { ReactNode } from 'react'; function CustomMenu({ onUpdate, @@ -49,7 +39,16 @@ function CustomMenu({ ); } -export default function ReviewItem({ +type ReviewItemProps = { + children: ReactNode; + content: string; + images?: string[]; + showMenuButton?: boolean; + onUpdate?: VoidFunction; + onDelete?: VoidFunction; +}; + +export function ReviewItem({ children, content, images, diff --git a/packages/shared/components/ReviewItemSkeleton.tsx b/packages/components/src/ReviewItemSkeleton.tsx similarity index 93% rename from packages/shared/components/ReviewItemSkeleton.tsx rename to packages/components/src/ReviewItemSkeleton.tsx index 88d6261f..0272f49b 100644 --- a/packages/shared/components/ReviewItemSkeleton.tsx +++ b/packages/components/src/ReviewItemSkeleton.tsx @@ -7,7 +7,7 @@ import { Stack, } from '@chakra-ui/react'; -export default function ReviewItemSkeleton() { +export function ReviewItemSkeleton() { return ( ; @@ -13,7 +12,7 @@ type RecruitmentsSearchFilterProps = { onChangeFilter: (event: ChangeEvent) => void; }; -export default function SearchFilters({ +export function SearchFilters({ searchFilters, onChangeFilter, }: RecruitmentsSearchFilterProps) { diff --git a/packages/shared/components/SettingGroup.tsx b/packages/components/src/SettingGroup.tsx similarity index 66% rename from packages/shared/components/SettingGroup.tsx rename to packages/components/src/SettingGroup.tsx index 6ae14b16..9ff07084 100644 --- a/packages/shared/components/SettingGroup.tsx +++ b/packages/components/src/SettingGroup.tsx @@ -1,17 +1,14 @@ import { Box, Text } from '@chakra-ui/react'; -import type { SettingItemProps } from './SettingItem'; -import SettingItem from './SettingItem'; +import type { SettingItemProps } from '.'; +import { SettingItem } from '.'; type SettingProps = { groupTitle: string; settingItems: SettingItemProps[]; }; -export default function SettingGroup({ - groupTitle, - settingItems, -}: SettingProps) { +export function SettingGroup({ groupTitle, settingItems }: SettingProps) { return ( diff --git a/packages/shared/components/SettingItem.tsx b/packages/components/src/SettingItem.tsx similarity index 79% rename from packages/shared/components/SettingItem.tsx rename to packages/components/src/SettingItem.tsx index 908ae860..27cf52c8 100644 --- a/packages/shared/components/SettingItem.tsx +++ b/packages/components/src/SettingItem.tsx @@ -1,12 +1,11 @@ +import Next from '@anifriends/assets/icon_next.svg'; import { Box, Flex, Image, Text } from '@chakra-ui/react'; -import Next from '../assets/icon_next.svg'; - export type SettingItemProps = { itemTitle: string; onClick: VoidFunction; }; -export default function SettingItem({ itemTitle, onClick }: SettingItemProps) { +export function SettingItem({ itemTitle, onClick }: SettingItemProps) { return ( { const { setUser } = useAuthStore(); + return useMutation({ mutationFn: async () => { const { data } = await getAccessTokenAPI(); @@ -21,4 +21,4 @@ export default function useAccessTokenMutation() { setUser(null); }, }); -} +}; diff --git a/packages/shared/hooks/useIntersection.tsx b/packages/hooks/src/useIntersect.ts similarity index 96% rename from packages/shared/hooks/useIntersection.tsx rename to packages/hooks/src/useIntersect.ts index be9c2f1a..61cbc3b5 100644 --- a/packages/shared/hooks/useIntersection.tsx +++ b/packages/hooks/src/useIntersect.ts @@ -5,7 +5,7 @@ type IntersectHandler = ( observer: IntersectionObserver, ) => void; -const useIntersect = ( +export const useIntersect = ( onIntersect: IntersectHandler, options?: IntersectionObserverInit, ) => { diff --git a/packages/shared/hooks/usePageType.ts b/packages/hooks/src/usePageType.ts similarity index 88% rename from packages/shared/hooks/usePageType.ts rename to packages/hooks/src/usePageType.ts index 065b9ea3..53c7ff60 100644 --- a/packages/shared/hooks/usePageType.ts +++ b/packages/hooks/src/usePageType.ts @@ -1,8 +1,7 @@ +import { PageType } from '@anifriends/types'; import { useEffect, useState } from 'react'; import { useMatches } from 'react-router-dom'; -import { PageType } from '../types/page'; - export const usePageType = () => { const [pageType, setPageType] = useState(); diff --git a/packages/shared/hooks/usePhotoUpload.ts b/packages/hooks/src/usePhotoUpload.ts similarity index 92% rename from packages/shared/hooks/usePhotoUpload.ts rename to packages/hooks/src/usePhotoUpload.ts index fdec278a..4e6faa35 100644 --- a/packages/shared/hooks/usePhotoUpload.ts +++ b/packages/hooks/src/usePhotoUpload.ts @@ -1,9 +1,8 @@ +import { uploadImage } from '@anifriends/apis'; +import { resizeImageFile } from '@anifriends/utils'; import { useToast, UseToastOptions } from '@chakra-ui/react'; import { useState } from 'react'; -import { uploadImage } from '../apis/common/Image'; -import { resizeImageFile } from '../utils/image'; - const toastOption = ( description: string, status: UseToastOptions['status'], diff --git a/packages/shared/hooks/usePhotosUpload.ts b/packages/hooks/src/usePhotosUpload.ts similarity index 94% rename from packages/shared/hooks/usePhotosUpload.ts rename to packages/hooks/src/usePhotosUpload.ts index 84e931f0..3a656c57 100644 --- a/packages/shared/hooks/usePhotosUpload.ts +++ b/packages/hooks/src/usePhotosUpload.ts @@ -1,10 +1,9 @@ +import { uploadImage } from '@anifriends/apis'; +import type { Photo } from '@anifriends/components'; +import { resizeImageFile } from '@anifriends/utils'; import { useToast, UseToastOptions } from '@chakra-ui/react'; import { useState } from 'react'; -import { uploadImage } from '../apis/common/Image'; -import { Photo } from '../components/EditPhotoList'; -import { resizeImageFile } from '../utils/image'; - type ImageFile = { id: string; image: File }; const toastOption = ( diff --git a/packages/shared/hooks/useRadioGroup.ts b/packages/hooks/src/useRadioGroup.ts similarity index 77% rename from packages/shared/hooks/useRadioGroup.ts rename to packages/hooks/src/useRadioGroup.ts index 3ef1cf2a..cc35d9c4 100644 --- a/packages/shared/hooks/useRadioGroup.ts +++ b/packages/hooks/src/useRadioGroup.ts @@ -1,6 +1,6 @@ import { useState } from 'react'; -const useRadioGroup = ( +export const useRadioGroup = ( initialValue: Value, ): [Value, (nextValue: Value) => void] => { const [value, setValue] = useState(initialValue); @@ -9,5 +9,3 @@ const useRadioGroup = ( return [value, changeValue]; }; - -export default useRadioGroup; diff --git a/packages/shared/hooks/useSearchFilter.ts b/packages/hooks/src/useSearchFilter.ts similarity index 96% rename from packages/shared/hooks/useSearchFilter.ts rename to packages/hooks/src/useSearchFilter.ts index ecc6174d..968ee828 100644 --- a/packages/shared/hooks/useSearchFilter.ts +++ b/packages/hooks/src/useSearchFilter.ts @@ -1,8 +1,7 @@ +import { useSearchHeaderStore } from '@anifriends/store'; import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import useSearchHeaderStore from '../store/searchHeaderStore'; - type KeywordFilter = { keyword: string; }; diff --git a/packages/shared/hooks/useSearchKeyword.ts b/packages/hooks/src/useSearchKeyword.ts similarity index 87% rename from packages/shared/hooks/useSearchKeyword.ts rename to packages/hooks/src/useSearchKeyword.ts index e1228910..7d87d7f8 100644 --- a/packages/shared/hooks/useSearchKeyword.ts +++ b/packages/hooks/src/useSearchKeyword.ts @@ -1,7 +1,6 @@ +import { useSearchHeaderStore } from '@anifriends/store'; import { useEffect } from 'react'; -import useSearchHeaderStore from '../store/searchHeaderStore'; - export const useSearchKeyword = ( setKeywordFilter: (keyword: string) => void, ) => { diff --git a/packages/shared/hooks/useToggle.ts b/packages/hooks/src/useToggle.ts similarity index 66% rename from packages/shared/hooks/useToggle.ts rename to packages/hooks/src/useToggle.ts index 87ac3b4c..0f52781e 100644 --- a/packages/shared/hooks/useToggle.ts +++ b/packages/hooks/src/useToggle.ts @@ -1,6 +1,6 @@ import { useBoolean } from '@chakra-ui/react'; -const useToggle = (initialState = false): [boolean, () => void] => { +export const useToggle = (initialState = false): [boolean, () => void] => { const [isTrue, setIsTrue] = useBoolean(initialState); const toggle = () => { @@ -9,5 +9,3 @@ const useToggle = (initialState = false): [boolean, () => void] => { return [isTrue, toggle]; }; - -export default useToggle; diff --git a/packages/hooks/tsconfig.json b/packages/hooks/tsconfig.json new file mode 100644 index 00000000..f2fdd2c0 --- /dev/null +++ b/packages/hooks/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/icons/package.json b/packages/icons/package.json new file mode 100644 index 00000000..fb00d511 --- /dev/null +++ b/packages/icons/package.json @@ -0,0 +1,17 @@ +{ + "name": "@anifriends/icons", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.tsx", + "dependencies": { + "react": "^18.2.0" + }, + "devDependencies": { + "@anifriends/tsconfig": "workspace:*", + "@types/react": "^18.2.15" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/icons/src/ApplicantIcon.tsx b/packages/icons/src/ApplicantIcon.tsx new file mode 100644 index 00000000..4c36fbb0 --- /dev/null +++ b/packages/icons/src/ApplicantIcon.tsx @@ -0,0 +1,26 @@ +import { ComponentProps } from 'react'; + +export function ApplicantIcon(props: ComponentProps<'svg'>) { + return ( + + + + + + + + + + + ); +} diff --git a/packages/icons/src/BackIcon.tsx b/packages/icons/src/BackIcon.tsx new file mode 100644 index 00000000..d38e5988 --- /dev/null +++ b/packages/icons/src/BackIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function BackIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/BiXIcon.tsx b/packages/icons/src/BiXIcon.tsx new file mode 100644 index 00000000..5aece099 --- /dev/null +++ b/packages/icons/src/BiXIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function BiXIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/IoCameraIcon.tsx b/packages/icons/src/IoCameraIcon.tsx new file mode 100644 index 00000000..730313d2 --- /dev/null +++ b/packages/icons/src/IoCameraIcon.tsx @@ -0,0 +1,23 @@ +import { ComponentProps } from 'react'; + +export function IoCameraIcon(props: Omit, 'children'>) { + return ( + + + + + ); +} diff --git a/packages/shared/assets/IoEyeOff.tsx b/packages/icons/src/IoEyeOff.tsx similarity index 98% rename from packages/shared/assets/IoEyeOff.tsx rename to packages/icons/src/IoEyeOff.tsx index 7df1f095..2b5e6556 100644 --- a/packages/shared/assets/IoEyeOff.tsx +++ b/packages/icons/src/IoEyeOff.tsx @@ -1,6 +1,6 @@ import { ComponentProps } from 'react'; -export default function IoEyeOff({ ...props }: ComponentProps<'svg'>) { +export function IoEyeOff({ ...props }: ComponentProps<'svg'>) { return ( ) { +export function IoEyeSharp({ ...props }: ComponentProps<'svg'>) { return ( ) { + return ( + + + + ); +} diff --git a/packages/icons/src/NextIcon.tsx b/packages/icons/src/NextIcon.tsx new file mode 100644 index 00000000..01a39f83 --- /dev/null +++ b/packages/icons/src/NextIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function NextIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/NoImageIcon.tsx b/packages/icons/src/NoImageIcon.tsx new file mode 100644 index 00000000..bee6785e --- /dev/null +++ b/packages/icons/src/NoImageIcon.tsx @@ -0,0 +1,45 @@ +import { ComponentProps } from 'react'; + +export function NoImageIcon(props: ComponentProps<'svg'>) { + return ( + + + + + + + + + + + + ); +} diff --git a/packages/icons/src/NotificationIcon.tsx b/packages/icons/src/NotificationIcon.tsx new file mode 100644 index 00000000..96ebde98 --- /dev/null +++ b/packages/icons/src/NotificationIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function NotificationIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/ReviewNextIcon.tsx b/packages/icons/src/ReviewNextIcon.tsx new file mode 100644 index 00000000..981e37d9 --- /dev/null +++ b/packages/icons/src/ReviewNextIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function ReviewNextIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/SearchIcon.tsx b/packages/icons/src/SearchIcon.tsx new file mode 100644 index 00000000..75ff138f --- /dev/null +++ b/packages/icons/src/SearchIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function SearchIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/SettingsIcon.tsx b/packages/icons/src/SettingsIcon.tsx new file mode 100644 index 00000000..da4ca002 --- /dev/null +++ b/packages/icons/src/SettingsIcon.tsx @@ -0,0 +1,19 @@ +import { ComponentProps } from 'react'; + +export function SettingsIcon(props: ComponentProps<'svg'>) { + return ( + + + + ); +} diff --git a/packages/icons/src/index.tsx b/packages/icons/src/index.tsx new file mode 100644 index 00000000..a1de131f --- /dev/null +++ b/packages/icons/src/index.tsx @@ -0,0 +1,13 @@ +export { ApplicantIcon } from './ApplicantIcon'; +export { BackIcon } from './BackIcon'; +export { BiXIcon } from './BiXIcon'; +export { IoCameraIcon } from './IoCameraIcon'; +export { IoEyeOff } from './IoEyeOff'; +export { IoEyeSharp } from './IoEyeSharp'; +export { MenuIcon } from './MenuIcon'; +export { NextIcon } from './NextIcon'; +export { NoImageIcon } from './NoImageIcon'; +export { NotificationIcon } from './NotificationIcon'; +export { ReviewNextIcon } from './ReviewNextIcon'; +export { SearchIcon } from './SearchIcon'; +export { SettingsIcon } from './SettingsIcon'; diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.json new file mode 100644 index 00000000..f2fdd2c0 --- /dev/null +++ b/packages/icons/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/layout/package.json b/packages/layout/package.json new file mode 100644 index 00000000..0ea8949c --- /dev/null +++ b/packages/layout/package.json @@ -0,0 +1,32 @@ +{ + "name": "@anifriends/layout", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.tsx", + "dependencies": { + "@anifriends/assets": "workspace:*", + "@anifriends/components": "workspace:*", + "@anifriends/constants": "workspace:*", + "@anifriends/hooks": "workspace:*", + "@anifriends/store": "workspace:*", + "@anifriends/utils": "workspace:*", + "@chakra-ui/react": "^2.8.1", + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", + "framer-motion": "^10.16.4", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^6.17.0" + }, + "devDependencies": { + "@anifriends/tsconfig": "workspace:*", + "@anifriends/types": "workspace:*", + "@types/react": "^18.2.15", + "@types/react-dom": "^18.2.7", + "typescript": "^5.0.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/shared/layout/BottomNavBar/NavBarButton.tsx b/packages/layout/src/BottomNavBar/NavBarButton.tsx similarity index 100% rename from packages/shared/layout/BottomNavBar/NavBarButton.tsx rename to packages/layout/src/BottomNavBar/NavBarButton.tsx diff --git a/packages/shared/layout/BottomNavBar/index.tsx b/packages/layout/src/BottomNavBar/index.tsx similarity index 71% rename from packages/shared/layout/BottomNavBar/index.tsx rename to packages/layout/src/BottomNavBar/index.tsx index 3a6d1bbe..ec36439b 100644 --- a/packages/shared/layout/BottomNavBar/index.tsx +++ b/packages/layout/src/BottomNavBar/index.tsx @@ -1,18 +1,18 @@ +import AnimalsSelectedIcon from '@anifriends/assets/bottomNavBar/icon_animals_selected.svg'; +import AnimalsUnselectedIcon from '@anifriends/assets/bottomNavBar/icon_animals_unselected.svg'; +import ChattingsSelectedIcon from '@anifriends/assets/bottomNavBar/icon_chattings_selected.svg'; +import ChattingsUnselectedIcon from '@anifriends/assets/bottomNavBar/icon_chattings_unselected.svg'; +import MyPageSeletedIcon from '@anifriends/assets/bottomNavBar/icon_mypage_selected.svg'; +import MyPageUnselectedIcon from '@anifriends/assets/bottomNavBar/icon_mypage_unselected.svg'; +import VolunteersSelectedIcon from '@anifriends/assets/bottomNavBar/icon_volunteers_selected.svg'; +import VolunteersUnselectedIcon from '@anifriends/assets/bottomNavBar/icon_volunteers_unselected.svg'; +import { AlertModal } from '@anifriends/components'; +import { PAGE_TYPE } from '@anifriends/constants'; +import { usePageType } from '@anifriends/hooks'; +import { useAuthStore } from '@anifriends/store'; import { Flex, useDisclosure } from '@chakra-ui/react'; import { useNavigate } from 'react-router-dom'; -import AnimalsSelectedIcon from '../../assets/bottomNavBar/icon_animals_selected.svg'; -import AnimalsUnselectedIcon from '../../assets/bottomNavBar/icon_animals_unselected.svg'; -import ChattingsSelectedIcon from '../../assets/bottomNavBar/icon_chattings_selected.svg'; -import ChattingsUnselectedIcon from '../../assets/bottomNavBar/icon_chattings_unselected.svg'; -import MyPageSeletedIcon from '../../assets/bottomNavBar/icon_mypage_selected.svg'; -import MyPageUnselectedIcon from '../../assets/bottomNavBar/icon_mypage_unselected.svg'; -import VolunteersSelectedIcon from '../../assets/bottomNavBar/icon_volunteers_selected.svg'; -import VolunteersUnselectedIcon from '../../assets/bottomNavBar/icon_volunteers_unselected.svg'; -import AlertModal from '../../components/AlertModal'; -import PAGE_TYPE from '../../constants/pageType'; -import { usePageType } from '../../hooks/usePageType'; -import useAuthStore from '../../store/authStore'; import NavBarButton from './NavBarButton'; import { useBottomNavBar } from './useBottomNavBar'; diff --git a/packages/shared/layout/BottomNavBar/useBottomNavBar.ts b/packages/layout/src/BottomNavBar/useBottomNavBar.ts similarity index 84% rename from packages/shared/layout/BottomNavBar/useBottomNavBar.ts rename to packages/layout/src/BottomNavBar/useBottomNavBar.ts index 32c07ec6..35102c37 100644 --- a/packages/shared/layout/BottomNavBar/useBottomNavBar.ts +++ b/packages/layout/src/BottomNavBar/useBottomNavBar.ts @@ -1,8 +1,7 @@ +import { PAGE_TYPE } from '@anifriends/constants'; +import { PageType } from '@anifriends/types'; import { useEffect, useState } from 'react'; -import PAGE_TYPE from '../../constants/pageType'; -import { PageType } from '../../types/page'; - export const useBottomNavBar = (pageType?: PageType) => { const [isBottomNavBarVisible, setIsBottomNavBarVisible] = useState(false); diff --git a/packages/shared/layout/Header/DefaultHeader/headerIconState.ts b/packages/layout/src/Header/DefaultHeader/headerIconState.ts similarity index 97% rename from packages/shared/layout/Header/DefaultHeader/headerIconState.ts rename to packages/layout/src/Header/DefaultHeader/headerIconState.ts index 7a296f32..47fa3015 100644 --- a/packages/shared/layout/Header/DefaultHeader/headerIconState.ts +++ b/packages/layout/src/Header/DefaultHeader/headerIconState.ts @@ -1,4 +1,5 @@ -import { AppType } from '../../../types/app'; +import { AppType } from '@anifriends/types'; + import { DefaultHeaderIconVisibility } from './useDefaultHeader'; type DefaultHeaderIconState = { diff --git a/packages/shared/layout/Header/DefaultHeader/index.tsx b/packages/layout/src/Header/DefaultHeader/index.tsx similarity index 87% rename from packages/shared/layout/Header/DefaultHeader/index.tsx rename to packages/layout/src/Header/DefaultHeader/index.tsx index 38c82b3e..2c927252 100644 --- a/packages/shared/layout/Header/DefaultHeader/index.tsx +++ b/packages/layout/src/Header/DefaultHeader/index.tsx @@ -1,3 +1,8 @@ +import NotificationsIcon from '@anifriends/assets/icon_notifications.svg'; +import SearchIcon from '@anifriends/assets/icon_search.svg'; +import SettingsIcon from '@anifriends/assets/icon_settings.svg'; +import { AlertModal } from '@anifriends/components'; +import { useAuthStore } from '@anifriends/store'; import { Box, ButtonGroup, @@ -8,11 +13,6 @@ import { } from '@chakra-ui/react'; import { useLocation, useNavigate } from 'react-router-dom'; -import NotificationsIcon from '../../../assets/icon_notifications.svg'; -import SearchIcon from '../../../assets/icon_search.svg'; -import SettingsIcon from '../../../assets/icon_settings.svg'; -import AlertModal from '../../../components/AlertModal'; -import useAuthStore from '../../../store/authStore'; import { HeaderProps } from '../index'; import { useDefaultHeader } from './useDefaultHeader'; diff --git a/packages/shared/layout/Header/DefaultHeader/useDefaultHeader.ts b/packages/layout/src/Header/DefaultHeader/useDefaultHeader.ts similarity index 89% rename from packages/shared/layout/Header/DefaultHeader/useDefaultHeader.ts rename to packages/layout/src/Header/DefaultHeader/useDefaultHeader.ts index de7a25d7..16b3e461 100644 --- a/packages/shared/layout/Header/DefaultHeader/useDefaultHeader.ts +++ b/packages/layout/src/Header/DefaultHeader/useDefaultHeader.ts @@ -1,7 +1,7 @@ +import { usePageType } from '@anifriends/hooks'; +import { AppType } from '@anifriends/types'; import { useEffect, useState } from 'react'; -import { usePageType } from '../../../hooks/usePageType'; -import { AppType } from '../../../types/app'; import { getHeaderTitle } from '../utils'; import defaultHeaderState from './headerIconState'; diff --git a/packages/shared/layout/Header/DetailHeader/index.tsx b/packages/layout/src/Header/DetailHeader/index.tsx similarity index 89% rename from packages/shared/layout/Header/DetailHeader/index.tsx rename to packages/layout/src/Header/DetailHeader/index.tsx index 3f1a25b5..802510b3 100644 --- a/packages/shared/layout/Header/DetailHeader/index.tsx +++ b/packages/layout/src/Header/DetailHeader/index.tsx @@ -1,9 +1,9 @@ +import BackIcon from '@anifriends/assets/icon_back.svg'; +import { OptionMenu } from '@anifriends/components'; +import { useDetailHeaderStore } from '@anifriends/store'; import { Box, Flex, Image, MenuItem, Text } from '@chakra-ui/react'; import { useLocation, useNavigate } from 'react-router-dom'; -import BackIcon from '../../../assets/icon_back.svg'; -import OptionMenu from '../../../components/OptionMenu'; -import useDetailHeaderStore from '../../../store/detailHeaderStore'; import { HeaderProps } from '../index'; import { useDetailHeader } from './useDetailHeader'; diff --git a/packages/shared/layout/Header/DetailHeader/useDetailHeader.ts b/packages/layout/src/Header/DetailHeader/useDetailHeader.ts similarity index 80% rename from packages/shared/layout/Header/DetailHeader/useDetailHeader.ts rename to packages/layout/src/Header/DetailHeader/useDetailHeader.ts index 64eff87b..10042d97 100644 --- a/packages/shared/layout/Header/DetailHeader/useDetailHeader.ts +++ b/packages/layout/src/Header/DetailHeader/useDetailHeader.ts @@ -1,9 +1,8 @@ +import { APP_TYPE, PAGE_TYPE } from '@anifriends/constants'; +import { usePageType } from '@anifriends/hooks'; +import { AppType } from '@anifriends/types'; import { useEffect, useState } from 'react'; -import APP_TYPE from '../../../constants/appType'; -import PAGE_TYPE from '../../../constants/pageType'; -import { usePageType } from '../../../hooks/usePageType'; -import { AppType } from '../../../types/app'; import { getHeaderTitle } from '../utils'; export type DetailHeaderIconVisibility = { diff --git a/packages/shared/layout/Header/SearchHeader/index.tsx b/packages/layout/src/Header/SearchHeader/index.tsx similarity index 93% rename from packages/shared/layout/Header/SearchHeader/index.tsx rename to packages/layout/src/Header/SearchHeader/index.tsx index e91b1978..0c59db60 100644 --- a/packages/shared/layout/Header/SearchHeader/index.tsx +++ b/packages/layout/src/Header/SearchHeader/index.tsx @@ -1,10 +1,9 @@ +import BackIcon from '@anifriends/assets/icon_back.svg'; +import { useSearchHeaderStore } from '@anifriends/store'; import { Box, Flex, FormControl, Image, Input } from '@chakra-ui/react'; import { ChangeEvent, FormEvent, useEffect, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; -import BackIcon from '../../../assets/icon_back.svg'; -import useSearchHeaderStore from '../../../store/searchHeaderStore'; - export default function SearchHeader() { const navigate = useNavigate(); const [keyword, setKeyword, onSearch] = useSearchHeaderStore((state) => [ diff --git a/packages/shared/layout/Header/index.tsx b/packages/layout/src/Header/index.tsx similarity index 86% rename from packages/shared/layout/Header/index.tsx rename to packages/layout/src/Header/index.tsx index 5f4c9f5d..1e1f5d3c 100644 --- a/packages/shared/layout/Header/index.tsx +++ b/packages/layout/src/Header/index.tsx @@ -1,5 +1,6 @@ -import { usePageType } from '../../hooks/usePageType'; -import { AppType } from '../../types/app'; +import { usePageType } from '@anifriends/hooks'; +import { AppType } from '@anifriends/types'; + import DefaultHeader from './DefaultHeader'; import DetailHeader from './DetailHeader'; import SearchHeader from './SearchHeader'; diff --git a/packages/shared/layout/Header/useHeader.ts b/packages/layout/src/Header/useHeader.ts similarity index 70% rename from packages/shared/layout/Header/useHeader.ts rename to packages/layout/src/Header/useHeader.ts index 6a283b0d..e9acd2c9 100644 --- a/packages/shared/layout/Header/useHeader.ts +++ b/packages/layout/src/Header/useHeader.ts @@ -1,8 +1,8 @@ +import { HEADER_TYPE } from '@anifriends/constants'; +import { usePageType } from '@anifriends/hooks'; +import { HeaderType } from '@anifriends/types'; import { useEffect, useState } from 'react'; -import HEADER_TYPE from '../../constants/headerType'; -import { usePageType } from '../../hooks/usePageType'; -import { HeaderType } from '../../types/header'; import { getHeaderType } from './utils'; export const useHeader = () => { diff --git a/packages/shared/layout/Header/utils.ts b/packages/layout/src/Header/utils.ts similarity index 67% rename from packages/shared/layout/Header/utils.ts rename to packages/layout/src/Header/utils.ts index f599537e..329005ff 100644 --- a/packages/shared/layout/Header/utils.ts +++ b/packages/layout/src/Header/utils.ts @@ -1,8 +1,5 @@ -import headerTitle from '../../constants/headerTitle'; -import HEADER_TYPE from '../../constants/headerType'; -import PAGE_TYPE from '../../constants/pageType'; -import { HeaderType } from '../../types/header'; -import { PageType } from '../../types/page'; +import { HEADER_TYPE, headerTitle, PAGE_TYPE } from '@anifriends/constants'; +import { HeaderType, PageType } from '@anifriends/types'; export const getHeaderType = (pageType: PageType): HeaderType => { if ( diff --git a/packages/shared/layout/index.tsx b/packages/layout/src/index.tsx similarity index 84% rename from packages/shared/layout/index.tsx rename to packages/layout/src/index.tsx index 3b989e5c..3516e9d8 100644 --- a/packages/shared/layout/index.tsx +++ b/packages/layout/src/index.tsx @@ -1,15 +1,11 @@ +import { Loader, LocalErrorBoundary } from '@anifriends/components'; +import { useAuthStore } from '@anifriends/store'; +import { AppType } from '@anifriends/types'; +import { getItemFromStorage, removeItemFromStorage } from '@anifriends/utils'; import { Box, Container } from '@chakra-ui/react'; import { useEffect, useState } from 'react'; import { Outlet, useLocation, useNavigate } from 'react-router-dom'; -import Loader from '../components/Loader'; -import LocalErrorBoundary from '../components/LocalErrorBoundary'; -import useAuthStore from '../store/authStore'; -import { AppType } from '../types/app'; -import { - getItemFromStorage, - removeItemFromStorage, -} from '../utils/localStorage'; import BottomNavBar from './BottomNavBar'; import Header from './Header'; @@ -27,7 +23,7 @@ export default function Layout({ appType }: LayoutProps) { try { const user = JSON.parse(getItemFromStorage(appType)); setUser(user); - //로그인 성공시 그대로있거나 홈으로 이동 + // 로그인 성공시 그대로있거나 홈으로 이동 if (pathname === '/') { navigate('/volunteers'); } diff --git a/packages/layout/svg.d.ts b/packages/layout/svg.d.ts new file mode 100644 index 00000000..cdb2b1a9 --- /dev/null +++ b/packages/layout/svg.d.ts @@ -0,0 +1,4 @@ +declare module '*.svg' { + const content: string; + export default content; +} diff --git a/packages/layout/tsconfig.json b/packages/layout/tsconfig.json new file mode 100644 index 00000000..d8ca3bf6 --- /dev/null +++ b/packages/layout/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src", "svg.d.ts"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/shared/.eslintrc.cjs b/packages/shared/.eslintrc.cjs deleted file mode 100644 index 9b41ec98..00000000 --- a/packages/shared/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - root: true, - extends: ['custom'], - rules: { - 'react/react-in-jsx-scope': 'off', //import React 검사 끄기 - }, -}; diff --git a/packages/shared/.gitignore b/packages/shared/.gitignore deleted file mode 100644 index a547bf36..00000000 --- a/packages/shared/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/packages/shared/apis/common/AccessToken.ts b/packages/shared/apis/common/AccessToken.ts deleted file mode 100644 index ffe563b3..00000000 --- a/packages/shared/apis/common/AccessToken.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { SigninResponseData } from '../../types/apis/auth'; -import axiosInstance from '../axiosInstance'; - -export const getAccessTokenAPI = () => - axiosInstance.post('/auth/refresh'); diff --git a/packages/shared/index.tsx b/packages/shared/index.tsx deleted file mode 100644 index 152aa41c..00000000 --- a/packages/shared/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable react-refresh/only-export-components */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars - -export * from './components/CustomButton'; -export * from './components/Header'; diff --git a/packages/shared/package.json b/packages/shared/package.json deleted file mode 100644 index c8f30e36..00000000 --- a/packages/shared/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "shared", - "version": "0.0.0", - "license": "MIT", - "type": "module", - "main": "./index.tsx", - "types": "./index.tsx", - "scripts": { - "lint": "eslint ." - }, - "dependencies": { - "@chakra-ui/react": "^2.8.1", - "@emotion/react": "^11.11.1", - "@emotion/styled": "^11.11.0", - "@tanstack/react-query": "^5.4.3", - "axios": "^1.6.0", - "framer-motion": "^10.16.4", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-error-boundary": "^4.0.11", - "react-image-file-resizer": "^0.4.8", - "react-router-dom": "^6.17.0", - "zod": "^3.22.4", - "zustand": "^4.4.4" - }, - "devDependencies": { - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", - "eslint": "^8.45.0", - "eslint-config-custom": "workspace:*", - "tsconfig": "workspace:*", - "typescript": "^5.0.2" - } -} diff --git a/packages/shared/store/detailHeaderStore.ts b/packages/shared/store/detailHeaderStore.ts deleted file mode 100644 index 6caad5c9..00000000 --- a/packages/shared/store/detailHeaderStore.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { create } from 'zustand'; - -type DeleteFunction = (id: number) => void; -interface DetailHeaderState { - onDelete: DeleteFunction; -} - -interface DetailHeaderActions { - setOnDelete: (onDelete: DeleteFunction) => void; -} - -const useDetailHeaderStore = create( - (set) => ({ - onDelete: () => {}, - setOnDelete: (onDelete: DeleteFunction) => set(() => ({ onDelete })), - }), -); - -export default useDetailHeaderStore; diff --git a/packages/shared/store/searchHeaderStore.ts b/packages/shared/store/searchHeaderStore.ts deleted file mode 100644 index 38e94ec4..00000000 --- a/packages/shared/store/searchHeaderStore.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { create } from 'zustand'; - -type SearchFunction = (keyword: string) => void; - -interface SearchHeaderState { - keyword: string; - onSearch: SearchFunction; -} - -interface SearchHeaderActions { - setKeyword: (keyword: string) => void; - setOnSearch: (onSearch: SearchFunction) => void; -} - -const useSearchHeaderStore = create( - (set) => ({ - keyword: '', - onSearch: () => {}, - setKeyword: (keyword: string) => set(() => ({ keyword })), - setOnSearch: (onSearch: SearchFunction) => set(() => ({ onSearch })), - }), -); - -export default useSearchHeaderStore; diff --git a/packages/shared/types/app.ts b/packages/shared/types/app.ts deleted file mode 100644 index 82b07294..00000000 --- a/packages/shared/types/app.ts +++ /dev/null @@ -1,3 +0,0 @@ -import APP_TYPE from '../constants/appType'; - -export type AppType = keyof typeof APP_TYPE; diff --git a/packages/shared/types/gender.ts b/packages/shared/types/gender.ts deleted file mode 100644 index 905b9221..00000000 --- a/packages/shared/types/gender.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PERSON_GENDER_ENG, PERSON_GENDER_KOR } from '../constants/gender'; - -export type PersonGenderEng = - (typeof PERSON_GENDER_ENG)[keyof typeof PERSON_GENDER_ENG]; - -export type PersonGenderKor = - (typeof PERSON_GENDER_KOR)[keyof typeof PERSON_GENDER_KOR]; diff --git a/packages/shared/types/header.ts b/packages/shared/types/header.ts deleted file mode 100644 index 3ded0871..00000000 --- a/packages/shared/types/header.ts +++ /dev/null @@ -1,3 +0,0 @@ -import HEADER_TYPE from '../constants/headerType'; - -export type HeaderType = keyof typeof HEADER_TYPE; diff --git a/packages/shared/types/page.ts b/packages/shared/types/page.ts deleted file mode 100644 index e5affb64..00000000 --- a/packages/shared/types/page.ts +++ /dev/null @@ -1,3 +0,0 @@ -import PAGE_TYPE from '../constants/pageType'; - -export type PageType = keyof typeof PAGE_TYPE; diff --git a/packages/shared/types/period.ts b/packages/shared/types/period.ts deleted file mode 100644 index ba48674a..00000000 --- a/packages/shared/types/period.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PERIOD } from '../constants/period'; - -export type Period = keyof typeof PERIOD; diff --git a/packages/store/package.json b/packages/store/package.json new file mode 100644 index 00000000..e5f75b66 --- /dev/null +++ b/packages/store/package.json @@ -0,0 +1,17 @@ +{ + "name": "@anifriends/store", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.ts", + "dependencies": { + "zustand": "^4.4.4" + }, + "devDependencies": { + "@anifriends/tsconfig": "workspace:*", + "typescript": "^5.0.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/shared/store/authStore.ts b/packages/store/src/authStore.ts similarity index 75% rename from packages/shared/store/authStore.ts rename to packages/store/src/authStore.ts index 3303f130..43e84917 100644 --- a/packages/shared/store/authStore.ts +++ b/packages/store/src/authStore.ts @@ -13,11 +13,9 @@ interface AuthActions { setUser: (user: User | null) => void; } -const useAuthStore = create((set) => ({ +export const useAuthStore = create((set) => ({ user: null, setUser: (user: User | null) => { set({ user }); }, })); - -export default useAuthStore; diff --git a/packages/store/src/detailHeaderStore.ts b/packages/store/src/detailHeaderStore.ts new file mode 100644 index 00000000..6aed2510 --- /dev/null +++ b/packages/store/src/detailHeaderStore.ts @@ -0,0 +1,18 @@ +import { create } from 'zustand'; + +type DeleteFunction = (id: number) => void; + +interface DetailHeaderState { + onDelete: DeleteFunction; +} + +interface DetailHeaderActions { + setOnDelete: (onDelete: DeleteFunction) => void; +} + +export const useDetailHeaderStore = create< + DetailHeaderState & DetailHeaderActions +>((set) => ({ + onDelete: () => {}, + setOnDelete: (onDelete: DeleteFunction) => set(() => ({ onDelete })), +})); diff --git a/packages/store/src/index.ts b/packages/store/src/index.ts new file mode 100644 index 00000000..7a24fef5 --- /dev/null +++ b/packages/store/src/index.ts @@ -0,0 +1,3 @@ +export * from './authStore'; +export * from './detailHeaderStore'; +export * from './searchHeaderStore'; diff --git a/packages/store/src/searchHeaderStore.ts b/packages/store/src/searchHeaderStore.ts new file mode 100644 index 00000000..6431f574 --- /dev/null +++ b/packages/store/src/searchHeaderStore.ts @@ -0,0 +1,22 @@ +import { create } from 'zustand'; + +type SearchFunction = (keyword: string) => void; + +interface SearchHeaderState { + keyword: string; + onSearch: SearchFunction; +} + +interface SearchHeaderActions { + setKeyword: (keyword: string) => void; + setOnSearch: (onSearch: SearchFunction) => void; +} + +export const useSearchHeaderStore = create< + SearchHeaderState & SearchHeaderActions +>((set) => ({ + keyword: '', + onSearch: () => {}, + setKeyword: (keyword: string) => set(() => ({ keyword })), + setOnSearch: (onSearch: SearchFunction) => set(() => ({ onSearch })), +})); diff --git a/packages/shared/tsconfig.json b/packages/store/tsconfig.json similarity index 57% rename from packages/shared/tsconfig.json rename to packages/store/tsconfig.json index ccc2693d..33b9d337 100644 --- a/packages/shared/tsconfig.json +++ b/packages/store/tsconfig.json @@ -1,15 +1,11 @@ { - "extends": "tsconfig/base.json", + "extends": "@anifriends/tsconfig/base.json", "include": ["."], "exclude": ["dist", "build", "node_modules"], "compilerOptions": { "jsx": "react-jsx", "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", - "target": "ES2020", - "baseUrl": ".", - "paths": { - "@/*": ["../../packages/shared/*"] - } + "target": "ES2020" } } diff --git a/packages/theme/package.json b/packages/theme/package.json new file mode 100644 index 00000000..20c20272 --- /dev/null +++ b/packages/theme/package.json @@ -0,0 +1,16 @@ +{ + "name": "@anifriends/theme", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.ts", + "dependencies": { + "@chakra-ui/react": "^2.8.1" + }, + "devDependencies": { + "@anifriends/tsconfig": "workspace:*" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/shared/theme/index.ts b/packages/theme/src/index.ts similarity index 100% rename from packages/shared/theme/index.ts rename to packages/theme/src/index.ts diff --git a/packages/theme/tsconfig.json b/packages/theme/tsconfig.json new file mode 100644 index 00000000..f2fdd2c0 --- /dev/null +++ b/packages/theme/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/types/package.json b/packages/types/package.json new file mode 100644 index 00000000..f5b2d1e0 --- /dev/null +++ b/packages/types/package.json @@ -0,0 +1,14 @@ +{ + "name": "@anifriends/types", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.ts", + "devDependencies": { + "@anifriends/tsconfig": "workspace:*", + "typescript": "^5.0.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/shared/types/apis/auth.ts b/packages/types/src/apis/auth.ts similarity index 100% rename from packages/shared/types/apis/auth.ts rename to packages/types/src/apis/auth.ts diff --git a/packages/shared/types/apis/error.ts b/packages/types/src/apis/error.ts similarity index 100% rename from packages/shared/types/apis/error.ts rename to packages/types/src/apis/error.ts diff --git a/packages/types/src/apis/index.ts b/packages/types/src/apis/index.ts new file mode 100644 index 00000000..8b794342 --- /dev/null +++ b/packages/types/src/apis/index.ts @@ -0,0 +1,2 @@ +export * from './auth'; +export * from './error'; diff --git a/packages/types/src/app.ts b/packages/types/src/app.ts new file mode 100644 index 00000000..121ac09f --- /dev/null +++ b/packages/types/src/app.ts @@ -0,0 +1 @@ +export type AppType = 'SHELTER_APP' | 'VOLUNTEER_APP'; diff --git a/packages/types/src/gender.ts b/packages/types/src/gender.ts new file mode 100644 index 00000000..508ceccf --- /dev/null +++ b/packages/types/src/gender.ts @@ -0,0 +1,3 @@ +export type PersonGenderEng = 'FEMALE' | 'MALE'; + +export type PersonGenderKor = '남성' | '여성'; diff --git a/packages/types/src/header.ts b/packages/types/src/header.ts new file mode 100644 index 00000000..7eff9342 --- /dev/null +++ b/packages/types/src/header.ts @@ -0,0 +1 @@ +export type HeaderType = 'DEFAULT' | 'DETAIL' | 'SEARCH'; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts new file mode 100644 index 00000000..fd58583f --- /dev/null +++ b/packages/types/src/index.ts @@ -0,0 +1,6 @@ +export * from './apis'; +export * from './app'; +export * from './gender'; +export * from './header'; +export * from './page'; +export * from './period'; diff --git a/packages/types/src/page.ts b/packages/types/src/page.ts new file mode 100644 index 00000000..439ff037 --- /dev/null +++ b/packages/types/src/page.ts @@ -0,0 +1,27 @@ +export type PageType = + | 'VOLUNTEERS' + | 'VOLUNTEERS_DETAIL' + | 'VOLUNTEERS_PROFILE' + | 'VOLUNTEERS_SEARCH' + | 'VOLUNTEERS_WRITE' + | 'VOLUNTEERS_UPDATE' + | 'ANIMALS' + | 'ANIMALS_DETAIL' + | 'ANIMALS_SEARCH' + | 'ANIMALS_WRITE' + | 'ANIMALS_UPDATE' + | 'CHATTINGS' + | 'CHATTINGS_ROOM' + | 'MYPAGE' + | 'MYPAGE_REVIEWS' + | 'SETTINGS' + | 'SETTINGS_ACCOUNT' + | 'SETTINGS_PASSWORD' + | 'MANAGE_ATTENDANCE' + | 'MANAGE_APPLY' + | 'NOTIFICATIONS' + | 'SHELTERS_PROFILE' + | 'SHELTERS_REVIEWS_WRITE' + | 'SHELTERS_REVIEWS_UPDATE' + | 'SIGNUP' + | 'SIGNIN'; diff --git a/packages/types/src/period.ts b/packages/types/src/period.ts new file mode 100644 index 00000000..d78a50e5 --- /dev/null +++ b/packages/types/src/period.ts @@ -0,0 +1,5 @@ +export type Period = + | 'WITHIN_ONE_DAY' + | 'WITHIN_ONE_WEEK' + | 'WITHIN_ONE_MONTH' + | 'WITHIN_THREE_MONTH'; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 00000000..f2fdd2c0 --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/utils/package.json b/packages/utils/package.json new file mode 100644 index 00000000..69c8fa6a --- /dev/null +++ b/packages/utils/package.json @@ -0,0 +1,21 @@ +{ + "name": "@anifriends/utils", + "version": "0.0.0", + "private": true, + "license": "MIT", + "main": "src/index.ts", + "dependencies": { + "@anifriends/constants": "workspace:*", + "@anifriends/types": "workspace:*", + "@chakra-ui/react": "^2.8.1", + "react-image-file-resizer": "^0.4.8", + "zod": "^3.22.4" + }, + "devDependencies": { + "@anifriends/tsconfig": "workspace:*", + "typescript": "^5.0.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/shared/utils/date.ts b/packages/utils/src/date.ts similarity index 96% rename from packages/shared/utils/date.ts rename to packages/utils/src/date.ts index 42c77624..bb545fcb 100644 --- a/packages/shared/utils/date.ts +++ b/packages/utils/src/date.ts @@ -1,4 +1,4 @@ -import { MILISECONDS, WEEK_DAYS } from '../constants/date'; +import { MILISECONDS, WEEK_DAYS } from '@anifriends/constants'; export const createFormattedTime = ( date: Date, diff --git a/packages/shared/utils/errorMessage.ts b/packages/utils/src/errorMessage.ts similarity index 100% rename from packages/shared/utils/errorMessage.ts rename to packages/utils/src/errorMessage.ts diff --git a/packages/shared/utils/image.ts b/packages/utils/src/image.ts similarity index 100% rename from packages/shared/utils/image.ts rename to packages/utils/src/image.ts diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts new file mode 100644 index 00000000..09037b39 --- /dev/null +++ b/packages/utils/src/index.ts @@ -0,0 +1,7 @@ +export * from './date'; +export * from './errorMessage'; +export * from './image'; +export * from './localStorage'; +export * from './period'; +export * from './toast'; +export * from './validations'; diff --git a/packages/shared/utils/localStorage.ts b/packages/utils/src/localStorage.ts similarity index 99% rename from packages/shared/utils/localStorage.ts rename to packages/utils/src/localStorage.ts index cd940c65..3bb22386 100644 --- a/packages/shared/utils/localStorage.ts +++ b/packages/utils/src/localStorage.ts @@ -4,9 +4,11 @@ export const setItemToStorage = (key: string, value: string) => { export const getItemFromStorage = (key: string) => { const value = localStorage.getItem(key); + if (!value) { throw new Error('[Error] : 로컬 스토리지에 유저 정보가 없습니다'); } + return value; }; diff --git a/packages/shared/utils/period.ts b/packages/utils/src/period.ts similarity index 93% rename from packages/shared/utils/period.ts rename to packages/utils/src/period.ts index 20059e1f..32c265eb 100644 --- a/packages/shared/utils/period.ts +++ b/packages/utils/src/period.ts @@ -1,4 +1,5 @@ -import { Period } from '../types/period'; +import type { Period } from '@anifriends/types'; + import { createFormattedTime } from './date'; const periodEndDate: Record number> = { diff --git a/packages/shared/utils/toast.ts b/packages/utils/src/toast.ts similarity index 100% rename from packages/shared/utils/toast.ts rename to packages/utils/src/toast.ts diff --git a/packages/shared/utils/validations.ts b/packages/utils/src/validations.ts similarity index 100% rename from packages/shared/utils/validations.ts rename to packages/utils/src/validations.ts diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json new file mode 100644 index 00000000..f2fdd2c0 --- /dev/null +++ b/packages/utils/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@anifriends/tsconfig/react-library.json", + "include": ["src"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35ddcbeb..5cba6a88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,9 +26,9 @@ importers: eslint: specifier: ^8.45.0 version: 8.53.0 - eslint-config-custom: + eslint-config-anifriends: specifier: workspace:* - version: link:packages/eslint-config-custom + version: link:configs/eslint-config-anifriends husky: specifier: ^8.0.0 version: 8.0.3 @@ -47,6 +47,39 @@ importers: apps/shelter: dependencies: + '@anifriends/apis': + specifier: workspace:* + version: link:../../packages/apis + '@anifriends/assets': + specifier: workspace:* + version: link:../../packages/assets + '@anifriends/components': + specifier: workspace:* + version: link:../../packages/components + '@anifriends/constants': + specifier: workspace:* + version: link:../../packages/constants + '@anifriends/fonts': + specifier: workspace:* + version: link:../../packages/fonts + '@anifriends/hooks': + specifier: workspace:* + version: link:../../packages/hooks + '@anifriends/icons': + specifier: workspace:* + version: link:../../packages/icons + '@anifriends/layout': + specifier: workspace:* + version: link:../../packages/layout + '@anifriends/store': + specifier: workspace:* + version: link:../../packages/store + '@anifriends/theme': + specifier: workspace:* + version: link:../../packages/theme + '@anifriends/utils': + specifier: workspace:* + version: link:../../packages/utils '@chakra-ui/react': specifier: ^2.8.1 version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) @@ -86,9 +119,6 @@ importers: react-router-dom: specifier: ^6.17.0 version: 6.18.0(react-dom@18.2.0)(react@18.2.0) - shared: - specifier: workspace:* - version: link:../../packages/shared zod: specifier: ^3.22.4 version: 3.22.4 @@ -96,6 +126,12 @@ importers: specifier: ^4.4.4 version: 4.4.5(@types/react@18.2.33)(react@18.2.0) devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@anifriends/types': + specifier: workspace:* + version: link:../../packages/types '@testing-library/jest-dom': specifier: ^6.2.0 version: 6.2.0(vitest@1.2.0) @@ -123,9 +159,9 @@ importers: eslint: specifier: ^8.45.0 version: 8.52.0 - eslint-config-custom: + eslint-config-anifriends: specifier: workspace:* - version: link:../../packages/eslint-config-custom + version: link:../../packages/eslint-config-anifriends eslint-plugin-vitest: specifier: ^0.3.20 version: 0.3.20(eslint@8.52.0)(typescript@5.2.2)(vitest@1.2.0) @@ -135,9 +171,6 @@ importers: msw: specifier: ^2.0.1 version: 2.0.1(typescript@5.2.2) - tsconfig: - specifier: workspace:* - version: link:../../packages/tsconfig typescript: specifier: ^5.0.2 version: 5.2.2 @@ -150,6 +183,39 @@ importers: apps/volunteer: dependencies: + '@anifriends/apis': + specifier: workspace:* + version: link:../../packages/apis + '@anifriends/assets': + specifier: workspace:* + version: link:../../packages/assets + '@anifriends/components': + specifier: workspace:* + version: link:../../packages/components + '@anifriends/constants': + specifier: workspace:* + version: link:../../packages/constants + '@anifriends/fonts': + specifier: workspace:* + version: link:../../packages/fonts + '@anifriends/hooks': + specifier: workspace:* + version: link:../../packages/hooks + '@anifriends/icons': + specifier: workspace:* + version: link:../../packages/icons + '@anifriends/layout': + specifier: workspace:* + version: link:../../packages/layout + '@anifriends/store': + specifier: workspace:* + version: link:../../packages/store + '@anifriends/theme': + specifier: workspace:* + version: link:../../packages/theme + '@anifriends/utils': + specifier: workspace:* + version: link:../../packages/utils '@chakra-ui/react': specifier: ^2.8.1 version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) @@ -189,9 +255,6 @@ importers: react-router-dom: specifier: ^6.17.0 version: 6.18.0(react-dom@18.2.0)(react@18.2.0) - shared: - specifier: workspace:* - version: link:../../packages/shared zod: specifier: ^3.22.4 version: 3.22.4 @@ -199,6 +262,12 @@ importers: specifier: ^4.4.4 version: 4.4.5(@types/react@18.2.33)(react@18.2.0) devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@anifriends/types': + specifier: workspace:* + version: link:../../packages/types '@testing-library/jest-dom': specifier: ^6.2.0 version: 6.2.0(vitest@1.2.0) @@ -226,9 +295,9 @@ importers: eslint: specifier: ^8.45.0 version: 8.52.0 - eslint-config-custom: + eslint-config-anifriends: specifier: workspace:* - version: link:../../packages/eslint-config-custom + version: link:../../packages/eslint-config-anifriends eslint-plugin-vitest: specifier: ^0.3.20 version: 0.3.20(eslint@8.52.0)(typescript@5.2.2)(vitest@1.2.0) @@ -238,9 +307,6 @@ importers: msw: specifier: ^2.0.1 version: 2.0.1(typescript@5.2.2) - tsconfig: - specifier: workspace:* - version: link:../../packages/tsconfig typescript: specifier: ^5.0.2 version: 5.2.2 @@ -251,7 +317,7 @@ importers: specifier: ^1.2.0 version: 1.2.0(@types/node@20.8.10)(@vitest/ui@1.2.0)(jsdom@23.2.0) - packages/eslint-config-custom: + configs/eslint-config-anifriends: dependencies: '@typescript-eslint/eslint-plugin': specifier: ^5.30.7 @@ -283,13 +349,58 @@ importers: eslint-plugin-unused-imports: specifier: ^3.0.0 version: 3.0.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.53.0) + + configs/tsconfig: {} + + packages/apis: + dependencies: + '@anifriends/constants': + specifier: workspace:* + version: link:../constants + '@anifriends/store': + specifier: workspace:* + version: link:../store + axios: + specifier: ^1.6.0 + version: 1.6.0 devDependencies: - '@vitejs/plugin-react-swc': - specifier: ^3.4.0 - version: 3.4.1(vite@4.5.0) + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@anifriends/types': + specifier: workspace:* + version: link:../types + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/assets: + dependencies: + react: + specifier: ^18.2.0 + version: 18.2.0 + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@types/react': + specifier: ^18.2.15 + version: 18.2.33 - packages/shared: + packages/components: dependencies: + '@anifriends/assets': + specifier: workspace:* + version: link:../assets + '@anifriends/constants': + specifier: workspace:* + version: link:../constants + '@anifriends/store': + specifier: workspace:* + version: link:../store + '@anifriends/utils': + specifier: workspace:* + version: link:../utils '@chakra-ui/react': specifier: ^2.8.1 version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) @@ -302,58 +413,236 @@ importers: '@tanstack/react-query': specifier: ^5.4.3 version: 5.4.3(react-dom@18.2.0)(react@18.2.0) - axios: - specifier: ^1.6.0 - version: 1.6.0 framer-motion: specifier: ^10.16.4 version: 10.16.4(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) react-error-boundary: specifier: ^4.0.11 version: 4.0.11(react@18.2.0) - react-image-file-resizer: - specifier: ^0.4.8 - version: 0.4.8 react-router-dom: specifier: ^6.17.0 version: 6.18.0(react-dom@18.2.0)(react@18.2.0) - zod: - specifier: ^3.22.4 - version: 3.22.4 - zustand: - specifier: ^4.4.4 - version: 4.4.5(@types/react@18.2.33)(react@18.2.0) devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@types/react': + specifier: ^18.2.15 + version: 18.2.33 + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/constants: + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@anifriends/types': + specifier: workspace:* + version: link:../types + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/fonts: + dependencies: + '@emotion/react': + specifier: ^11.11.1 + version: 11.11.1(@types/react@18.2.33)(react@18.2.0) + react: + specifier: ^18.2.0 + version: 18.2.0 + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@types/react': + specifier: ^18.2.15 + version: 18.2.33 + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/hooks: + dependencies: + '@anifriends/apis': + specifier: workspace:* + version: link:../apis + '@anifriends/components': + specifier: workspace:* + version: link:../components + '@anifriends/store': + specifier: workspace:* + version: link:../store + '@anifriends/types': + specifier: workspace:* + version: link:../types + '@anifriends/utils': + specifier: workspace:* + version: link:../utils + '@chakra-ui/react': + specifier: ^2.8.1 + version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': + specifier: ^11.11.1 + version: 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@tanstack/react-query': + specifier: ^5.4.3 + version: 5.4.3(react-dom@18.2.0)(react@18.2.0) + framer-motion: + specifier: ^10.16.4 + version: 10.16.4(react-dom@18.2.0)(react@18.2.0) + react: + specifier: ^18.2.0 + version: 18.2.0 + react-router-dom: + specifier: ^6.17.0 + version: 6.18.0(react-dom@18.2.0)(react@18.2.0) + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@types/react': + specifier: ^18.2.15 + version: 18.2.33 + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/icons: + dependencies: + react: + specifier: ^18.2.0 + version: 18.2.0 + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@types/react': + specifier: ^18.2.15 + version: 18.2.33 + + packages/layout: + dependencies: + '@anifriends/assets': + specifier: workspace:* + version: link:../assets + '@anifriends/components': + specifier: workspace:* + version: link:../components + '@anifriends/constants': + specifier: workspace:* + version: link:../constants + '@anifriends/hooks': + specifier: workspace:* + version: link:../hooks + '@anifriends/store': + specifier: workspace:* + version: link:../store + '@anifriends/utils': + specifier: workspace:* + version: link:../utils + '@chakra-ui/react': + specifier: ^2.8.1 + version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': + specifier: ^11.11.1 + version: 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + framer-motion: + specifier: ^10.16.4 + version: 10.16.4(react-dom@18.2.0)(react@18.2.0) + react: + specifier: ^18.2.0 + version: 18.2.0 + react-dom: + specifier: ^18.2.0 + version: 18.2.0(react@18.2.0) + react-router-dom: + specifier: ^6.17.0 + version: 6.18.0(react-dom@18.2.0)(react@18.2.0) + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + '@anifriends/types': + specifier: workspace:* + version: link:../types '@types/react': specifier: ^18.2.15 version: 18.2.33 '@types/react-dom': specifier: ^18.2.7 version: 18.2.14 - eslint: - specifier: ^8.45.0 - version: 8.53.0 - eslint-config-custom: + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/store: + dependencies: + zustand: + specifier: ^4.4.4 + version: 4.4.5(@types/react@18.2.33)(react@18.2.0) + devDependencies: + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + typescript: + specifier: ^5.0.2 + version: 5.2.2 + + packages/theme: + dependencies: + '@chakra-ui/react': + specifier: ^2.8.1 + version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + devDependencies: + '@anifriends/tsconfig': specifier: workspace:* - version: link:../eslint-config-custom - tsconfig: + version: link:../../configs/tsconfig + + packages/types: + devDependencies: + '@anifriends/tsconfig': specifier: workspace:* - version: link:../tsconfig + version: link:../../configs/tsconfig typescript: specifier: ^5.0.2 version: 5.2.2 - packages/tsconfig: + packages/utils: + dependencies: + '@anifriends/constants': + specifier: workspace:* + version: link:../constants + '@anifriends/types': + specifier: workspace:* + version: link:../types + '@chakra-ui/react': + specifier: ^2.8.1 + version: 2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(framer-motion@10.16.4)(react-dom@18.2.0)(react@18.2.0) + react-image-file-resizer: + specifier: ^0.4.8 + version: 0.4.8 + zod: + specifier: ^3.22.4 + version: 3.22.4 devDependencies: - '@vitejs/plugin-react-swc': - specifier: ^3.4.0 - version: 3.4.1(vite@4.5.0) + '@anifriends/tsconfig': + specifier: workspace:* + version: link:../../configs/tsconfig + typescript: + specifier: ^5.0.2 + version: 5.2.2 packages: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3ff5faaa..4458de61 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - - "apps/*" - - "packages/*" + - 'apps/*' + - 'configs/*' + - 'packages/*'