From 2a598c5c6b5b2be2ade184593aef292d98ad1737 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Mon, 25 Dec 2023 16:52:06 +0900 Subject: [PATCH 01/14] =?UTF-8?q?#25=20feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20MyLog=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EA=B0=9C=EB=B0=9C=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mypage/MyLog/index.tsx | 75 +++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/components/mypage/MyLog/index.tsx diff --git a/src/components/mypage/MyLog/index.tsx b/src/components/mypage/MyLog/index.tsx new file mode 100644 index 00000000..a8eb5409 --- /dev/null +++ b/src/components/mypage/MyLog/index.tsx @@ -0,0 +1,75 @@ +'use client'; + +import Image from 'next/image'; + +import React, { HTMLAttributes } from 'react'; + +import LogImage from '../../../../public/LogImage.svg'; + +import MenuTypeFlag from '../../common/MenuTypeFlag'; +import VisitNumFlag from '../../common/VisitNumFlag'; + +interface MyLogProps extends HTMLAttributes { + date?: string; + restaurantImgUrl: string; + restaurantName?: string; + visitNum?: number; + menuType?: string; + rating?: number; + log?: string; +} + +export default function MyLog({ + date = '2023.03.26', + restaurantImgUrl = '', + restaurantName = '또잇또잇', + visitNum = 4, + menuType = '양식', + rating = 3.5, + log = '맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용', +}: MyLogProps) { + return ( + //전체 > 위/아래 > 위 : 빈 자리 & 날짜 자리, 아래 : 선 & [작은 모달 + 설명] + //align items : center? +
  • +
    +
    +

    {date}

    +
    +
    + + + +
    +
    +
    + + {restaurantName} + +
    + {/* tag 컴포넌트 만들어서 수정하기 */} + + +
    +
    + {rating} + {/* 별점 별 채우는 컴포넌트 추가 필요 */} +
    +
    + {restaurantName} +
    + {log} +
    +
    +
  • + ); +} + +// props로 받아야 될 것 +// - 방문 횟수에 따른 별점 채우기 +// - 날짜, 상점 이름, 방문 횟수, menu type, 별점, 작성 내용 From 24f8d0713efd95adf2822b85636d00c0fb2f1f33 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Mon, 25 Dec 2023 16:53:24 +0900 Subject: [PATCH 02/14] =?UTF-8?q?#25=20feat:=20MenuTypeFlag=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/MenuTypeFlag.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/components/common/MenuTypeFlag.tsx diff --git a/src/components/common/MenuTypeFlag.tsx b/src/components/common/MenuTypeFlag.tsx new file mode 100644 index 00000000..5cb64a8c --- /dev/null +++ b/src/components/common/MenuTypeFlag.tsx @@ -0,0 +1,11 @@ +interface MenuTypeFlagProps { + menuType: string; +} + +export default function MenuTypeFlag({ menuType }: MenuTypeFlagProps) { + return ( +
    + {menuType} +
    + ); +} From f43a73c342f89143c504584f6b5669f463aba2e8 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Mon, 25 Dec 2023 16:57:31 +0900 Subject: [PATCH 03/14] =?UTF-8?q?#25=20chore:=20MyLog=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mypage/MyLog/index.tsx | 37 ++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/components/mypage/MyLog/index.tsx b/src/components/mypage/MyLog/index.tsx index a8eb5409..b56fc814 100644 --- a/src/components/mypage/MyLog/index.tsx +++ b/src/components/mypage/MyLog/index.tsx @@ -4,33 +4,29 @@ import Image from 'next/image'; import React, { HTMLAttributes } from 'react'; -import LogImage from '../../../../public/LogImage.svg'; - import MenuTypeFlag from '../../common/MenuTypeFlag'; import VisitNumFlag from '../../common/VisitNumFlag'; interface MyLogProps extends HTMLAttributes { - date?: string; + date: string; restaurantImgUrl: string; - restaurantName?: string; - visitNum?: number; - menuType?: string; - rating?: number; - log?: string; + restaurantName: string; + visitNum: number; + menuType: string; + rating: number; + log: string; } export default function MyLog({ - date = '2023.03.26', - restaurantImgUrl = '', - restaurantName = '또잇또잇', - visitNum = 4, - menuType = '양식', - rating = 3.5, - log = '맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용맛나용', + date, + restaurantImgUrl, + restaurantName, + visitNum, + menuType, + rating, + log, }: MyLogProps) { return ( - //전체 > 위/아래 > 위 : 빈 자리 & 날짜 자리, 아래 : 선 & [작은 모달 + 설명] - //align items : center?
  • @@ -46,8 +42,7 @@ export default function MyLog({ {restaurantName} -
    - {/* tag 컴포넌트 만들어서 수정하기 */} +
    @@ -69,7 +64,3 @@ export default function MyLog({
  • ); } - -// props로 받아야 될 것 -// - 방문 횟수에 따른 별점 채우기 -// - 날짜, 상점 이름, 방문 횟수, menu type, 별점, 작성 내용 From f56b5cf52c870c21e64ab289130d22eb582308d5 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Mon, 25 Dec 2023 18:46:03 +0900 Subject: [PATCH 04/14] =?UTF-8?q?#25=20feat:=20StarRating=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/StarRating/index.tsx | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/components/common/StarRating/index.tsx diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarRating/index.tsx new file mode 100644 index 00000000..876f61ef --- /dev/null +++ b/src/components/common/StarRating/index.tsx @@ -0,0 +1,30 @@ +import FilledStarSmall from 'public/assets/img/FilledStarSmall.svg'; +import EmptyStarSmall from 'public/assets/img/EmptyStarSmall.svg'; + +interface StarRatingProps { + rating: number; +} + +export default function StarRating({ rating }: StarRatingProps) { + const filledStars = Math.floor(rating); // 소수점 이하를 버리고, Filled Star 개수 결정 + const emptyStars = 5 - filledStars; // 전체 별의 개수에서 Filled Star 개수를 뺀 나머지는 Empty Star 개수 + + const getStarNum = (count: number, type: 'filled' | 'empty') => { + const stars = []; + for (let i = 0; i < count; i++) { + stars.push( +
    + {type === 'filled' ? : } +
    , + ); + } + return stars; + }; + + return ( +
    + {getStarNum(filledStars, 'filled')} + {getStarNum(emptyStars, 'empty')} +
    + ); +} From 6615d70d12c7a3e3bc8e350285912692a4efcf11 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Mon, 25 Dec 2023 21:17:30 +0900 Subject: [PATCH 05/14] =?UTF-8?q?#25=20style:=20MyLog=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20assets=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/img/EmptyStarSmall.svg | 3 +++ public/assets/img/FilledStarSmall.svg | 3 +++ public/assets/img/LogImage.svg | 10 ++++++++++ src/components/{mypage/MyLog => Log}/index.tsx | 14 +++++++------- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 public/assets/img/EmptyStarSmall.svg create mode 100644 public/assets/img/FilledStarSmall.svg create mode 100644 public/assets/img/LogImage.svg rename src/components/{mypage/MyLog => Log}/index.tsx (82%) diff --git a/public/assets/img/EmptyStarSmall.svg b/public/assets/img/EmptyStarSmall.svg new file mode 100644 index 00000000..06b438fc --- /dev/null +++ b/public/assets/img/EmptyStarSmall.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/img/FilledStarSmall.svg b/public/assets/img/FilledStarSmall.svg new file mode 100644 index 00000000..8a050fea --- /dev/null +++ b/public/assets/img/FilledStarSmall.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/img/LogImage.svg b/public/assets/img/LogImage.svg new file mode 100644 index 00000000..b7b6c857 --- /dev/null +++ b/public/assets/img/LogImage.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/components/mypage/MyLog/index.tsx b/src/components/Log/index.tsx similarity index 82% rename from src/components/mypage/MyLog/index.tsx rename to src/components/Log/index.tsx index b56fc814..e05a7246 100644 --- a/src/components/mypage/MyLog/index.tsx +++ b/src/components/Log/index.tsx @@ -1,11 +1,11 @@ 'use client'; import Image from 'next/image'; - import React, { HTMLAttributes } from 'react'; -import MenuTypeFlag from '../../common/MenuTypeFlag'; -import VisitNumFlag from '../../common/VisitNumFlag'; +import MenuTypeFlag from '@components/common/MenuTypeFlag'; +import VisitNumFlag from '@components/common/VisitNumFlag'; +import StarRating from '@components/common/StarRating'; interface MyLogProps extends HTMLAttributes { date: string; @@ -36,8 +36,8 @@ export default function MyLog({ -
    -
    +
    +
    {restaurantName} @@ -46,9 +46,9 @@ export default function MyLog({
    -
    +
    {rating} - {/* 별점 별 채우는 컴포넌트 추가 필요 */} +
    Date: Mon, 25 Dec 2023 21:39:37 +0900 Subject: [PATCH 06/14] =?UTF-8?q?#25=20chore:=20VisitNumFlag=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Log/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index e05a7246..50ba8bf2 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -4,7 +4,7 @@ import Image from 'next/image'; import React, { HTMLAttributes } from 'react'; import MenuTypeFlag from '@components/common/MenuTypeFlag'; -import VisitNumFlag from '@components/common/VisitNumFlag'; +// import VisitNumFlag from '@components/common/VisitNumFlag'; import StarRating from '@components/common/StarRating'; interface MyLogProps extends HTMLAttributes { @@ -21,7 +21,7 @@ export default function MyLog({ date, restaurantImgUrl, restaurantName, - visitNum, + // visitNum, menuType, rating, log, @@ -43,7 +43,7 @@ export default function MyLog({ {restaurantName}
    - + {/* */}
    From 4e35d838cb355539a1d12d5a3371215eb39beacb Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Tue, 26 Dec 2023 21:21:27 +0900 Subject: [PATCH 07/14] =?UTF-8?q?#25=20style:=20MyLog=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=ED=8F=B0=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Log/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index 50ba8bf2..bac84519 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -27,12 +27,12 @@ export default function MyLog({ log, }: MyLogProps) { return ( -
  • +
  • {date}

    -
    +
    @@ -58,7 +58,7 @@ export default function MyLog({ height={100} />
    - {log} + {log}
  • From d28e1eab41cfac10a94bd479d0e06a4dc0a3dd53 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Wed, 27 Dec 2023 01:17:45 +0900 Subject: [PATCH 08/14] =?UTF-8?q?#25=20style:=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B8=20=EC=88=98=EC=A0=95=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 4 +- src/app/page.tsx | 125 +++++------------------------------ src/components/Log/index.tsx | 30 +++++---- 3 files changed, 35 insertions(+), 124 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 6234dd2e..2f2102da 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -54,7 +54,7 @@ --background-end-rgb: 0, 0, 0; } } - +/* body { color: rgb(var(--foreground-rgb)); background: linear-gradient( @@ -63,4 +63,4 @@ body { rgb(var(--background-end-rgb)) ) rgb(var(--background-start-rgb)); -} +} */ diff --git a/src/app/page.tsx b/src/app/page.tsx index 737556ec..edc7f20a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,117 +1,22 @@ -import Image from 'next/image'; +// import Image from 'next/image'; -import PostItem from '@components/PostItem'; +// import PostItem from '@components/PostItem'; +import MyLog from '@components/Log'; export default function Home() { return ( -
    -
    -

    - Get started by editing  - src/app/page.tsx -

    - -
    - - - -
    - Next.js Logo -
    - - +
    +
    ); } diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index bac84519..e8a96ba3 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -7,9 +7,11 @@ import MenuTypeFlag from '@components/common/MenuTypeFlag'; // import VisitNumFlag from '@components/common/VisitNumFlag'; import StarRating from '@components/common/StarRating'; +import LogImage from '/public/assets/img/LogImage.svg'; + interface MyLogProps extends HTMLAttributes { date: string; - restaurantImgUrl: string; + restaurantImgUrl?: string; restaurantName: string; visitNum: number; menuType: string; @@ -33,13 +35,13 @@ export default function MyLog({

    {date}

    - + {/* - -
    + */} +
    - + {restaurantName}
    @@ -51,14 +53,18 @@ export default function MyLog({
    - {restaurantName} + {restaurantImgUrl ? ( + {restaurantName} + ) : ( + + )}
    - {log} + {log}
    From a9a99a3d21e326ea8a66163aee48a3ed2a2b8190 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Wed, 27 Dec 2023 14:28:29 +0900 Subject: [PATCH 09/14] =?UTF-8?q?#25=20feat:=20StarRating=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 4 +- src/app/page.tsx | 125 ++++++++++++++++++--- src/components/common/StarRating/index.tsx | 24 ++-- 3 files changed, 122 insertions(+), 31 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 2f2102da..6234dd2e 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -54,7 +54,7 @@ --background-end-rgb: 0, 0, 0; } } -/* + body { color: rgb(var(--foreground-rgb)); background: linear-gradient( @@ -63,4 +63,4 @@ body { rgb(var(--background-end-rgb)) ) rgb(var(--background-start-rgb)); -} */ +} diff --git a/src/app/page.tsx b/src/app/page.tsx index edc7f20a..737556ec 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,22 +1,117 @@ -// import Image from 'next/image'; +import Image from 'next/image'; -// import PostItem from '@components/PostItem'; -import MyLog from '@components/Log'; +import PostItem from '@components/PostItem'; export default function Home() { return ( -
    - +
    +
    +

    + Get started by editing  + src/app/page.tsx +

    + +
    + + + +
    + Next.js Logo +
    + +
    ); } diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarRating/index.tsx index 876f61ef..4374044d 100644 --- a/src/components/common/StarRating/index.tsx +++ b/src/components/common/StarRating/index.tsx @@ -6,25 +6,21 @@ interface StarRatingProps { } export default function StarRating({ rating }: StarRatingProps) { - const filledStars = Math.floor(rating); // 소수점 이하를 버리고, Filled Star 개수 결정 + const filledStars = Math.round(rating); // Filled Star 개수 결정 const emptyStars = 5 - filledStars; // 전체 별의 개수에서 Filled Star 개수를 뺀 나머지는 Empty Star 개수 - const getStarNum = (count: number, type: 'filled' | 'empty') => { - const stars = []; - for (let i = 0; i < count; i++) { - stars.push( -
    - {type === 'filled' ? : } -
    , - ); - } - return stars; - }; + const getStarNum = (count: number, type: 'filled' | 'empty') => + Array.from({ length: count }).map((_, index) => ( +
    + {type === 'filled' ? : } +
    + )); return (
    - {getStarNum(filledStars, 'filled')} - {getStarNum(emptyStars, 'empty')} + {getStarNum(filledStars, 'filled').concat( + getStarNum(emptyStars, 'empty'), + )}
    ); } From e55b9857a6b43fec59221d356c5b99ae2df91cd9 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Wed, 27 Dec 2023 14:49:31 +0900 Subject: [PATCH 10/14] =?UTF-8?q?#25=20feat:=20StarRating=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=8D=94=EB=8D=94=EB=8D=94=20=EA=B0=84=EC=86=8C?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/StarRating/index.tsx | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarRating/index.tsx index 4374044d..0f6cd7f6 100644 --- a/src/components/common/StarRating/index.tsx +++ b/src/components/common/StarRating/index.tsx @@ -6,21 +6,14 @@ interface StarRatingProps { } export default function StarRating({ rating }: StarRatingProps) { + // 별점 불러올 때 소수점 반올림할 지 버릴지 논의 필요 const filledStars = Math.round(rating); // Filled Star 개수 결정 - const emptyStars = 5 - filledStars; // 전체 별의 개수에서 Filled Star 개수를 뺀 나머지는 Empty Star 개수 - const getStarNum = (count: number, type: 'filled' | 'empty') => - Array.from({ length: count }).map((_, index) => ( -
    - {type === 'filled' ? : } -
    - )); - - return ( -
    - {getStarNum(filledStars, 'filled').concat( - getStarNum(emptyStars, 'empty'), - )} + const getStarsNum = Array.from({ length: 5 }).map((_, index) => ( +
    + {index < filledStars ? : }
    - ); + )); + + return
    {getStarsNum}
    ; } From f180ac76acb8d2cc17a64659cde5729184d33012 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Wed, 27 Dec 2023 15:45:49 +0900 Subject: [PATCH 11/14] =?UTF-8?q?#25=20chore:=20=EB=B3=84=20svg=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../img/{EmptyStarSmall.svg => default_star_24.svg} | 0 .../img/{FilledStarSmall.svg => filled_star_24.svg} | 0 src/components/common/StarRating/index.tsx | 9 +++++---- 3 files changed, 5 insertions(+), 4 deletions(-) rename public/assets/img/{EmptyStarSmall.svg => default_star_24.svg} (100%) rename public/assets/img/{FilledStarSmall.svg => filled_star_24.svg} (100%) diff --git a/public/assets/img/EmptyStarSmall.svg b/public/assets/img/default_star_24.svg similarity index 100% rename from public/assets/img/EmptyStarSmall.svg rename to public/assets/img/default_star_24.svg diff --git a/public/assets/img/FilledStarSmall.svg b/public/assets/img/filled_star_24.svg similarity index 100% rename from public/assets/img/FilledStarSmall.svg rename to public/assets/img/filled_star_24.svg diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarRating/index.tsx index 0f6cd7f6..d637cf11 100644 --- a/src/components/common/StarRating/index.tsx +++ b/src/components/common/StarRating/index.tsx @@ -1,17 +1,18 @@ -import FilledStarSmall from 'public/assets/img/FilledStarSmall.svg'; -import EmptyStarSmall from 'public/assets/img/EmptyStarSmall.svg'; +import FilledStarSmall from 'public/assets/img/filled_star_24.svg'; +import DefaultStarSmall from 'public/assets/img/default_star_24.svg'; interface StarRatingProps { rating: number; } export default function StarRating({ rating }: StarRatingProps) { - // 별점 불러올 때 소수점 반올림할 지 버릴지 논의 필요 + // TODO: 별점 불러올 때 소수점 반올림할 지 버릴지 논의 필요 const filledStars = Math.round(rating); // Filled Star 개수 결정 + // TODO: 별점 구간별로 별 ui 어떻게 보여줄 지 디자인과 논의 후 수정 필요 const getStarsNum = Array.from({ length: 5 }).map((_, index) => (
    - {index < filledStars ? : } + {index < filledStars ? : }
    )); From f724dd3840a35a9db045adbbe318707b4f5b50f6 Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Thu, 28 Dec 2023 21:02:54 +0900 Subject: [PATCH 12/14] =?UTF-8?q?#25=20style=20:=20StarRating=EC=97=90=20?= =?UTF-8?q?=EB=B3=84=EC=A0=90=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EB=B3=84?= =?UTF-8?q?=EC=A0=90=20=EC=A0=95=EC=88=98=EC=97=AC=EB=8F=84=20=EC=86=8C?= =?UTF-8?q?=EC=88=98=EC=A0=90=EC=9C=BC=EB=A1=9C=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Log/index.tsx | 6 +----- src/components/common/StarRating/index.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index e8a96ba3..b10fa2c1 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -35,9 +35,6 @@ export default function MyLog({

    {date}

    - {/* - - */}
    @@ -48,8 +45,7 @@ export default function MyLog({ {/* */}
    -
    - {rating} +
    diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarRating/index.tsx index d637cf11..4e3b521b 100644 --- a/src/components/common/StarRating/index.tsx +++ b/src/components/common/StarRating/index.tsx @@ -9,6 +9,8 @@ export default function StarRating({ rating }: StarRatingProps) { // TODO: 별점 불러올 때 소수점 반올림할 지 버릴지 논의 필요 const filledStars = Math.round(rating); // Filled Star 개수 결정 + const formattedRating = rating.toFixed(1); + // TODO: 별점 구간별로 별 ui 어떻게 보여줄 지 디자인과 논의 후 수정 필요 const getStarsNum = Array.from({ length: 5 }).map((_, index) => (
    @@ -16,5 +18,10 @@ export default function StarRating({ rating }: StarRatingProps) {
    )); - return
    {getStarsNum}
    ; + return ( +
    + {formattedRating} +
    {getStarsNum}
    +
    + ); } From 67231b762c001eadd8623b0d952a69ceaa78b74b Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Sat, 30 Dec 2023 16:37:49 +0900 Subject: [PATCH 13/14] =?UTF-8?q?#25=20chore:=20StarRating=20>=20StarScore?= =?UTF-8?q?=EB=A1=9C=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Log/index.tsx | 3 ++- src/components/common/{StarRating => StarScore}/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename src/components/common/{StarRating => StarScore}/index.tsx (90%) diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index b10fa2c1..0de0f10b 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -5,7 +5,7 @@ import React, { HTMLAttributes } from 'react'; import MenuTypeFlag from '@components/common/MenuTypeFlag'; // import VisitNumFlag from '@components/common/VisitNumFlag'; -import StarRating from '@components/common/StarRating'; +import StarRating from '@components/common/StarScore'; import LogImage from '/public/assets/img/LogImage.svg'; @@ -42,6 +42,7 @@ export default function MyLog({ {restaurantName}
    + {/* TODO: TAG 컴포넌트 만들어지면 수정하기 */} {/* */}
    diff --git a/src/components/common/StarRating/index.tsx b/src/components/common/StarScore/index.tsx similarity index 90% rename from src/components/common/StarRating/index.tsx rename to src/components/common/StarScore/index.tsx index 4e3b521b..c1e6c0d6 100644 --- a/src/components/common/StarRating/index.tsx +++ b/src/components/common/StarScore/index.tsx @@ -1,11 +1,11 @@ import FilledStarSmall from 'public/assets/img/filled_star_24.svg'; import DefaultStarSmall from 'public/assets/img/default_star_24.svg'; -interface StarRatingProps { +interface StarScoreProps { rating: number; } -export default function StarRating({ rating }: StarRatingProps) { +export default function StarScore({ rating }: StarScoreProps) { // TODO: 별점 불러올 때 소수점 반올림할 지 버릴지 논의 필요 const filledStars = Math.round(rating); // Filled Star 개수 결정 From b0247f59e9751356ff0112d0fd69df6266e4ad9b Mon Sep 17 00:00:00 2001 From: Yelynn Oh Date: Sat, 30 Dec 2023 21:37:22 +0900 Subject: [PATCH 14/14] =?UTF-8?q?#25=20chore:=20restaurant~~=20props=20sto?= =?UTF-8?q?re~~=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Log/index.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Log/index.tsx b/src/components/Log/index.tsx index 0de0f10b..a86be89a 100644 --- a/src/components/Log/index.tsx +++ b/src/components/Log/index.tsx @@ -11,8 +11,8 @@ import LogImage from '/public/assets/img/LogImage.svg'; interface MyLogProps extends HTMLAttributes { date: string; - restaurantImgUrl?: string; - restaurantName: string; + storeImgUrl?: string; + storeName: string; visitNum: number; menuType: string; rating: number; @@ -21,8 +21,8 @@ interface MyLogProps extends HTMLAttributes { export default function MyLog({ date, - restaurantImgUrl, - restaurantName, + storeImgUrl, + storeName, // visitNum, menuType, rating, @@ -39,7 +39,7 @@ export default function MyLog({
    - {restaurantName} + {storeName}
    {/* TODO: TAG 컴포넌트 만들어지면 수정하기 */} @@ -50,10 +50,10 @@ export default function MyLog({
    - {restaurantImgUrl ? ( + {storeImgUrl ? ( {restaurantName}