Skip to content

Commit

Permalink
Merge pull request #182 from Donggrina/refactor/deployments
Browse files Browse the repository at this point in the history
Fix: 빌드 오류 해결
  • Loading branch information
DHyeon98 authored Jun 24, 2024
2 parents 7c494cf + d08dea8 commit 10dc420
Show file tree
Hide file tree
Showing 29 changed files with 44 additions and 375 deletions.
6 changes: 4 additions & 2 deletions components/diaries/diary-create/diary-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import PetCheckbox from '@/components/diaries/pet-checkbox';
import ImageSkeleton from '@/components/skeleton/image/';
import { useRouter } from 'next/router';

interface DiaryData {
export interface DiaryData {
content: string;
weather: string;
isShare: boolean;
Expand Down Expand Up @@ -183,7 +183,9 @@ const DiaryCreate: React.FC = () => {
{Array.from({ length: 5 }).map((_, index) => (
<div key={index}>
<input
ref={(el) => (fileInputRefs.current[index] = el!)}
ref={(el) => {
fileInputRefs.current[index] = el!;
}}
type="file"
accept="image/*"
onChange={handleImageChange(index)}
Expand Down
2 changes: 1 addition & 1 deletion components/diaries/pet-checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';
import styles from './pet-checkbox.module.scss';
import { UseFormRegister, FieldValues } from 'react-hook-form';
import { DiaryData } from '@/types/diary';
import { DiaryData } from './diary-create/diary-create';

interface PetCheckboxProps {
register: UseFormRegister<DiaryData & FieldValues>;
Expand Down
2 changes: 0 additions & 2 deletions components/family/diary/family-diary-contents-empty.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import Link from 'next/link';
import Image from 'next/image';
import FamilyDiaryLayout from './layout/family-diary-layout';
import styles from './family-diary-contents-empty.module.scss';
import Hyperlink from '@/components/common/button/hyperlink';

Expand Down
1 change: 0 additions & 1 deletion components/family/growth/family-growth-empty.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import styles from './family-growth-empty.module.scss';
import Hyperlink from '@/components/common/button/hyperlink';
import Image from 'next/image';
import Link from 'next/link';

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion components/growth/list/list-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DropdownMenu from '@/components/kebab/kebab';
import useToggle from '@/hooks/use-toggle';
import { useDeleteGrowthMutation } from '@/hooks/queries/growth/use-post-growth-query';
import { useRouter } from 'next/router';
import CompleteModal from '@/pages/growth/create/complete-modal';
import CompleteModal from '../../complete-modal';
import useModal from '@/hooks/use-modal';
import { GROWTH_CATEGORY_IMAGES } from '@/utils/constants/growth';
import Image from 'next/image';
Expand Down
24 changes: 24 additions & 0 deletions hooks/queries/growth/use-get-growth-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ export const useGetGrowthDetailQuery = (growthId: number) => {
return useQuery({
queryKey: ['growth', growthId],
queryFn: () => growthAPI.getGrowthDetails(growthId),
initialData: {
data: {
id: 0,
writerProfileImageUrl: '',
petProfileImageUrl: '',
category: '',
content: {
food: '',
snack: '',
abnormalSymptom: '',
hospitalName: '',
symptom: '',
diagnosis: '',
medicationMethod: '',
price: 0,
memo: '',
},
dateTime: '',
nickname: '',
isMine: false,
petName: '',
date: '',
},
},
});
};

Expand Down
4 changes: 2 additions & 2 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NextResponse } from 'next/server';
import { NextRequest } from 'next/server';
import { MiddlewareData } from './utils/constants/middleware-data';

const { PROTECTED_PAGES, PUBLIC_PAGES, NON_FAMILY_PAGES, FAMILY_PAGES, MATCHER_PAGES } = new MiddlewareData();
const { PROTECTED_PAGES, PUBLIC_PAGES, NON_FAMILY_PAGES, FAMILY_PAGES } = new MiddlewareData();

export default function middleware(request: NextRequest) {
const { cookies, nextUrl } = request;
Expand Down Expand Up @@ -59,5 +59,5 @@ export default function middleware(request: NextRequest) {
}

export const config = {
matcher: MATCHER_PAGES,
matcher: '/:path*',
};
3 changes: 0 additions & 3 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import type { AppProps } from 'next/app';
import '@/styles/globals.css';
import { isHeader } from '@/utils/is-header';
import { isNav } from '@/utils/is-nav';
import { useRouter } from 'next/router';
import Nav from '@/components/common/nav/nav';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useState, useRef } from 'react';
import usePullReload from '@/hooks/use-pull-to-refresh';
import Spinner from '@/components/spinner/spinner';
import MainHeader from '@/components/common/Header/main-header';
import CreateHeader from '@/components/common/Header/create-header';
import Header from '@/components/common/Header';
import { AnimatePresence } from 'framer-motion';

Expand Down
5 changes: 2 additions & 3 deletions pages/diaries/[diaryId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function DiaryById({ diaryId }: InferGetServerSidePropsType<typeo
const weatherIcon = diaryQuery.data && WEATHER_TYPES.find((weather) => weather.label === diaryQuery.data.weather);

const { year, month, date, day } = disintegrateDateTime(diaryQuery.data && diaryQuery.data.date);

return (
<main className={styles.outer}>
<div className={styles.inner}>
Expand Down Expand Up @@ -69,7 +68,7 @@ export default function DiaryById({ diaryId }: InferGetServerSidePropsType<typeo
</div>
) : diaryQuery.isError ? (
<p>Error: {diaryQuery.error.message}</p>
) : (
) : diaryQuery.data ? (
<>
<section className={styles.profiles}>
<Profile
Expand Down Expand Up @@ -98,7 +97,7 @@ export default function DiaryById({ diaryId }: InferGetServerSidePropsType<typeo
))}
</div>
</>
)}
) : null}
</div>

<DiaryCommentForm mutateFn={commentMutation.mutate} placeholder="댓글 입력..." />
Expand Down
40 changes: 0 additions & 40 deletions pages/growth/[growthId]/content/content.module.scss

This file was deleted.

93 changes: 0 additions & 93 deletions pages/growth/[growthId]/content/index.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions pages/growth/[growthId]/edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import { SubmitHandler, useForm } from 'react-hook-form';
import styles from '../../create/create.module.scss';
import CategoryInputs from '../../create/category-inputs';
import CategoryInputs from '../../../../components/growth/category-inputs';
import classNames from 'classnames';
import CompleteModal from '../../create/complete-modal';
import CompleteModal from '../../../../components/growth/complete-modal';
import PetRadio from '@/components/calendar-monthly/pet-radio';
import useCalenderDateStore from '@/store/calendar.store';
import { convertToLocalDate } from '@/utils/convert-local-date';
Expand Down Expand Up @@ -44,7 +44,7 @@ export default function GrowthModify({ growthId }: InferGetServerSidePropsType<t
const localDate = convertToLocalDate({ year, month, day: date });

useEffect(() => {
if (growthList?.data) {
if (growthList) {
setMemo(growthList.data.content.memo);
setSelectedCategory(growthList.data.category);
setContent(growthList.data.content);
Expand Down
4 changes: 2 additions & 2 deletions pages/growth/[growthId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useDeleteGrowthMutation } from '@/hooks/queries/growth/use-post-growth-
import { useRouter } from 'next/router';
import useModal from '@/hooks/use-modal';
import Image from 'next/image';
import CompleteModal from '../create/complete-modal';
import CompleteModal from '../../../components/growth/complete-modal';
import { GrowthDetailsContent, GrowthDetailsData } from '@/types/growth/details';
import { GROWTH_CATEGORY_IMAGES, GROWTH_MEMO_IMAGES } from '@/utils/constants/growth';
import Content from '../../../components/growth/content';
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function GrowthDetailPage({ growthId }: GrowthDetailPageProps) {
const [petName, setPetName] = useState<string>('');

useEffect(() => {
if (growthDatas?.data) {
if (growthDatas) {
const { category, nickname, writerProfileImageUrl, petProfileImageUrl, content, isMine, petName } =
growthDatas.data as GrowthDetailsData;

Expand Down
4 changes: 2 additions & 2 deletions pages/growth/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import PetRadio from '@/components/calendar-monthly/pet-radio';
import { GROWTH_CATEGORY, GROWTH_CATEGORY_ICON } from '@/utils/constants/growth';
import { GrowthDetailsData, GrowthDetailsContent } from '@/types/growth/details';
import classNames from 'classnames';
import CategoryInputs from './category-inputs';
import CategoryInputs from '../../../components/growth/category-inputs';
import usePetsQuery from '@/hooks/queries/calendar/use-pets-query';
import { useCreateGrotwthMutation } from '@/hooks/queries/growth/use-post-growth-query';
import useCalenderDateStore from '@/store/calendar.store';
import { convertToLocalDate } from '@/utils/convert-local-date';
import { useRouter } from 'next/router';
import useModal from '@/hooks/use-modal';
import CompleteModal from './complete-modal';
import CompleteModal from '../../../components/growth/complete-modal';
import Image from 'next/image';
import MemoItem from '@/components/diaries/jihye/diary-edit-memo';
import ImageSkeleton from '@/components/skeleton/image/';
Expand Down
6 changes: 3 additions & 3 deletions pages/growth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export default function GrowthPage() {
<GrowthListSkeleton />
<GrowthListSkeleton />
</div>
) : (
) : growthLists ? (
<div className={styles.listContainer}>
{growthLists?.data.map((growth, index) => {
{growthLists.data.map((growth, index) => {
return (
<motion.div
variants={horizontalVariants}
Expand All @@ -64,7 +64,7 @@ export default function GrowthPage() {
);
})}
</div>
)}
) : null}
<AddButton href={'/growth/create'} />
</div>
</>
Expand Down
6 changes: 0 additions & 6 deletions pages/test/button-test/index.module.scss

This file was deleted.

26 changes: 0 additions & 26 deletions pages/test/button-test/index.tsx

This file was deleted.

Loading

0 comments on commit 10dc420

Please sign in to comment.