diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..51e6faa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js 20.x + uses: actions/setup-node@v2 + with: + node-version: 20.x + + - name: Install dependencies + run: pnpm install + + - name: Run build + run: npm run build diff --git a/src/apis/auth/createGuestUserApi.ts b/src/apis/auth/createGuestUserApi.ts index b06c44d..bb76259 100644 --- a/src/apis/auth/createGuestUserApi.ts +++ b/src/apis/auth/createGuestUserApi.ts @@ -1,6 +1,6 @@ import apiClient from '@/apis'; -import type { GuestUser } from '@/types/user'; +import type { User } from '@/types/user'; -export default async function createGuestUserApi(user: GuestUser) { - return (await apiClient.post(`/onboarding/members`, user)).data; +export default async function createGuestUserApi(user: User) { + return (await apiClient.post(`/onboarding/members`, user)).data; //이거 안쓰는 거 같은데 } diff --git a/src/apis/member/createBasicInfoApi.ts b/src/apis/member/createBasicInfoApi.ts index d4e18c5..434dbe8 100644 --- a/src/apis/member/createBasicInfoApi.ts +++ b/src/apis/member/createBasicInfoApi.ts @@ -1,9 +1,11 @@ import apiClient from '@/apis'; -import { MemberBasicInfoType } from './memberType'; +import { UserBasicInfo } from '@/types/user'; const createBasicInfoApi = { - BASIC_INFO: async (payload: MemberBasicInfoType) => { + BASIC_INFO: async ( + payload: Omit + ) => { const response = await apiClient.post( '/onboarding/members/me/basic-info', payload diff --git a/src/components/auth/DepartmentSelect.tsx b/src/components/auth/DepartmentSelect.tsx index 2badecd..9bcd53f 100644 --- a/src/components/auth/DepartmentSelect.tsx +++ b/src/components/auth/DepartmentSelect.tsx @@ -4,15 +4,18 @@ import { Control, Controller } from 'react-hook-form'; import DropDown from 'wowds-ui/DropDown'; import DropDownOption from 'wowds-ui/DropDownOption'; type DepartmentSelectProps = { - control: Control<{ - name: ''; - studentId: ''; - phone: ''; - department: ''; - email: ''; - terms: false; - personalPrivacy: false; - }>; + control: + | Control<{ + name: string; + studentId: string; + phone: string; + department: string; + email: string; + emailDomain: string; + terms: boolean; + personalPrivacy: boolean; + }> + | undefined; }; const DepartmentSelect = ({ control }: DepartmentSelectProps) => { diff --git a/src/components/auth/guard/StudentVerificationAccessGuard.tsx b/src/components/auth/guard/StudentVerificationAccessGuard.tsx index 3107d0f..7ec9007 100644 --- a/src/components/auth/guard/StudentVerificationAccessGuard.tsx +++ b/src/components/auth/guard/StudentVerificationAccessGuard.tsx @@ -1,10 +1,7 @@ -import LandingStatus from '@/constants/landingStatus'; -import useLandingStatus from '@/hooks/zustand/useLandingStatus'; -import { getAuthRedirectPath } from '@/utils/auth'; -import { Navigate, Outlet } from 'react-router-dom'; +import { Outlet } from 'react-router-dom'; export default function StudentVerificationAccessGuard() { - const { landingStatus } = useLandingStatus(); + // const { landingStatus } = useLandingStatus(); // if (landingStatus !== LandingStatus.StudentAuthentication) { // return ; diff --git a/src/components/myPage/PaymentStatus.tsx b/src/components/myPage/PaymentStatus.tsx index 4976194..7b6f731 100644 --- a/src/components/myPage/PaymentStatus.tsx +++ b/src/components/myPage/PaymentStatus.tsx @@ -5,7 +5,6 @@ import RoutePath from '@/routes/routePath'; import styled from '@emotion/styled'; import { useNavigate } from 'react-router-dom'; -import { MouseEvent } from 'react'; export type PaymentStatusType = 'PENDING' | 'VERIFIED'; @@ -15,16 +14,16 @@ interface PaymentStatusProps { } export const PaymentStatus = ({ - paymentStatus, - depositorName + paymentStatus + //depositorName }: PaymentStatusProps) => { const navigate = useNavigate(); - const handleClickRoute = (e: MouseEvent) => { + const handleClickRoute = () => { if (paymentStatus !== 'PENDING') { return; } - navigate(RoutePath.Payments); + navigate(RoutePath.PaymentsCheckout); }; return ( diff --git a/src/hooks/auth/useStudentVerification.ts b/src/hooks/auth/useStudentVerification.ts index 84cc4eb..ec800f5 100644 --- a/src/hooks/auth/useStudentVerification.ts +++ b/src/hooks/auth/useStudentVerification.ts @@ -22,7 +22,7 @@ export default function useStudentVerification() { const { sendStudentEmail, ...rest } = useSendStudentEmail(); const onSubmit = async ({ univEmail }: FieldValues) => { - event.preventDefault(); + event?.preventDefault(); updateUnivEmail(univEmail); sendStudentEmail(univEmail); }; diff --git a/src/pages/ForwardRef.tsx b/src/pages/ForwardRef.tsx deleted file mode 100644 index f20940a..0000000 --- a/src/pages/ForwardRef.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { - forwardRef, - InputHTMLAttributes, - ForwardedRef, - Ref, - TextareaHTMLAttributes -} from 'react'; -import TextField from 'wowds-ui/TextField'; - -interface InputProps extends InputHTMLAttributes { - value: string; - label?: string; - errorText?: string; - isError?: boolean; -} - -export const Input = forwardRef( - ( - { value, placeholder, label = '', errorText, isError = false, ...props }, - ref - ) => { - return ( - } - // error={isValid} - // helperText={errors.name?.message} - value={value} - placeholder={placeholder} - /> - ); - } -); - -Input.displayName = 'Input'; diff --git a/src/pages/StudentVerification.tsx b/src/pages/StudentVerification.tsx index 7a0657c..9668a05 100644 --- a/src/pages/StudentVerification.tsx +++ b/src/pages/StudentVerification.tsx @@ -15,7 +15,7 @@ import GlobalSize from '@/constants/globalSize'; export const StudentVerification = () => { const navigate = useNavigate(); //TODO: 추후 pending 상태 백엔드 API 수정하면 반영해둘것. - const [pending, setPending] = useState(false); + const [, setPending] = useState(false); const [isClicked, setIsClicked] = useState(false); const { onSubmit, control, isValid, onVerifyStudent, loading } = useStudentVerification();