Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 2차 QA 스타일 수정 완료 #134

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/images/chevron-left-gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/(root)/(routes)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PopularCardSection from './components/PopularCardSection'

function HomePage() {
return (
<main className="flex flex-col items-center min-h-screen gap-12 bg-background-color">
<main className="flex flex-col items-center min-h-screen gap-12 bg-background-color pb-8">
<BannerSection />
<CategorySection />
<PopularCardSection />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ProfileSection = ({ profileImg, userName }: ProfileSectionProps) => {
<Avatar size="md">
<AvatarImage imgUrl={profileImg} />
</Avatar>
<div className={`ml-9 ${TYPOGRAPHY.profile}`}>{userName}</div>
<div className={`ml-4 ${TYPOGRAPHY.profile}`}>{userName}</div>
</section>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TradeInfo = ({ title, content, variant, icon }: TradeInfoProps) => {
<Image src={icon} alt="infoImg" />
<div className="text-sm ml-2 font-normal">{title}</div>
<Badge size={'lg'} variant={variant} className="ml-auto">
{content}
{content === '' ? '미입력' : content}
</Badge>
</div>
)
Expand Down
17 changes: 17 additions & 0 deletions src/app/(root)/(routes)/cards/[cardId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use client'

import Image from 'next/image'
import { useRouter } from 'next/navigation'
import Slider from '@/components/domain/slider'
import Button from '@/components/ui/button'
import Assets from '@/config/assets'
import { useAuth } from '@/contexts/AuthProvider'
import useCardInfoQuery from '@/hooks/api/queries/useCardInfoQuery'
import ProfileSection from './components/ProfileSection'
Expand All @@ -15,13 +19,26 @@ type CardPageProps = {

const CardPage = ({ params }: CardPageProps) => {
const { isLoggedIn } = useAuth()
const router = useRouter()
const { data } = useCardInfoQuery(Number(params.cardId), isLoggedIn)
const cardData = data?.data

return (
<main className="flex-col min-h-screen bg-background-color">
{cardData && (
<>
Comment on lines 24 to 29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터가 없는 경우에 대한 처리라면 isEmpty 라는 변수명이 더 읽기 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흠 데이터가 없는 경우라기보다는 cardData가 무조건 있을때만 보이게 논리연산자를 통해 작성한 것이라 가독성에는 큰 문제가 없다고 생각하는데 변경하지 않아도 괜찮을까요??

<Button
className="absolute top-[66px] z-10"
variant={null}
size={'icon'}
onClick={() => router.back()}
>
<Image
className="w-10 h-10"
alt={'arrow-button'}
src={Assets.chevronLeftGray}
/>
</Button>
<Slider
imageData={cardData.cardInfo.images}
imageAspectRatio="square"
Expand Down
2 changes: 2 additions & 0 deletions src/config/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ArrowLeftIcon from '/public/images/arrow-left.svg'
import AlarmIcon from '/public/images/bell.svg'
import ChatIcon from '/public/images/chat.svg'
import CheckCircle from '/public/images/check-circle.svg'
import ChevronLeftGray from '/public/images/chevron-left-gray.svg'
import ArrowRightIcon from '/public/images/chevron-right.svg'
import FilterActiveIcon from '/public/images/filter-active.svg'
import FilterIcon from '/public/images/filter.svg'
Expand Down Expand Up @@ -100,6 +101,7 @@ const Assets = {
heartIcon: HeartIcon,
shoppingIcon: ShoppingIcon,
arrowRightIcon: ArrowRightIcon,
chevronLeftGray: ChevronLeftGray,
} as const

export default Assets