Skip to content

Commit

Permalink
refactor(connection-2023#334): Review 컴포넌트 index 파일 추가 및 import 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunseo-jo committed Mar 17, 2024
1 parent aaf6a9b commit 424c7e7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/app/class/[id]/_components/ClassPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { cookies } from 'next/headers';
import Image from 'next/image';
import DiscountCouponBanner from './DiscountCouponBanner';
import OptionButton from './OptionButton';
import Carousel from '@/components/Carousel/Carousel';
import { Review } from '@/components/Review';
import { CLASS_HSTYLE } from '@/constants/constants';
import {
LocationSVG,
Expand All @@ -14,10 +18,6 @@ import {
formatLocationToString,
formatGenreToString,
} from '@/utils/parseUtils';
import DiscountCouponBanner from './DiscountCouponBanner';
import OptionButton from './OptionButton';
import Carousel from '@/components/Carousel/Carousel';
import Review from '@/components/Review/Review';

const ClassPreview = async ({ id }: { id: string }) => {
const cookieStore = cookies();
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/_components/RecentReview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link';
import { getMyLecturersReviews } from '@/lib/apis/serverApis/reviewApis';
import ProfileImg from '@/components/Profile/ProfileImage';
import Review from '@/components/Review/Review';
import { Review } from '@/components/Review';

const RecentReview = async () => {
const { item: reviewData } = await getMyLecturersReviews({
Expand Down
2 changes: 1 addition & 1 deletion src/app/instructor/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import InstructorCarousel from './_components/InstructorCarousel';
import { OptionButtons } from '@/components/Button';
import Like from '@/components/Like/Like';
import Nav from '@/components/Nav/Nav';
import Review from '@/components/Review/Review';
import { Review } from '@/components/Review';
import ReviewSection from '@/components/uis/ReviewSection';
import type { Metadata } from 'next';
import { INSTRUCTOR_SECTIONS } from '@/constants/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import formatDate from '@/utils/formatDate';
import usePageNation from '@/utils/usePagenation';
import ClassFilterSelect from './ClassFilterSelect';
import Pagination from '@/components/Pagination/Pagination';
import ReviewStatistics from '@/components/Review/ReviewStatistics';
import UserReview from '@/components/Review/UserReview';
import { UserReview, ReviewStatistics } from '@/components/Review';
import { OptionType } from '@/types/coupon';
import { GetMyLecturersReviews, MyLecturersReviewsData } from '@/types/review';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { writeReview } from '@/lib/apis/reviewApis';
import { accessTokenReissuance } from '@/lib/apis/userApi';
import ClassSelect from './ClassSelect';
import { Button } from '@/components/Button';
import Rating from '@/components/Review/Rating';
import { Rating } from '@/components/Review';
import { SelectClassType, WriteReviewData } from '@/types/review';
import { FetchError } from '@/types/types';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ClassPreview/ClassPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ResponsiveClassPreview from './ResponsiveClassPreview';
import Carousel from '../Carousel/Carousel';
import Like from '../Like/Like';
import ProfileImage from '../Profile/ProfileImage';
import Review from '../Review/Review';
import { Review } from '../Review';
import { ClassCardType } from '@/types/class';

const ClassPreview = (props: ClassCardType) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Filter/Review/ReviewFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import Rating from '@/components/Review/Rating';
import { Rating } from '@/components/Review';

interface ReviewFilter {
rate: number;
// eslint-disable-next-line no-unused-vars
handleRate: (value: number) => void;
}

Expand Down
31 changes: 16 additions & 15 deletions src/components/InstructorCard/InstructorCard.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
'use client';
import Link from 'next/link';
import React, { useState } from 'react';
import { useState } from 'react';
import ImagesViewer from './ImagesViewer';
import { StarSVG } from '../../../public/icons/svg';
import Like from '../Like/Like';
import Review from '../Review/Review';
import { Review } from '../Review';
import { InstructorCardProps } from '@/types/types';

const InstructorCard = ({
id,
name,
address,
genres,
imgURL,
average,
teamAffiliation,
href,
largeImg,
isLiked,
likeEvent,
}: InstructorCardProps) => {
const InstructorCard = (props: InstructorCardProps) => {
const {
id,
name,
address,
genres,
imgURL,
average,
teamAffiliation,
href,
largeImg,
isLiked,
likeEvent,
} = props;
const [focus, setFocus] = useState(false);

const onFocus = () => {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Review/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export { default as Rating } from './Rating';

export { default as Review } from './Review';

export { default as ReviewStatistics } from './ReviewStatistics';

export { default as UserReview } from './UserReview';

0 comments on commit 424c7e7

Please sign in to comment.