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

페이지 디자인: 홈페이지 디자인 수정 #257

Merged
merged 4 commits into from
Mar 5, 2024
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
2 changes: 1 addition & 1 deletion src/app/(my-page)/my-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import styles from './page.module.scss';
const cx = classNames.bind(styles);

const TOP_MARGIN = 96;
const BOTTOM_MARGIN = 97;
const BOTTOM_MARGIN = 110;

function MyProfilePage() {
const logout = useLoggedOut();
Expand Down
3 changes: 1 addition & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ function Home() {
<>
<Header className={cx('home')} type="home" />
<main className={cx('mainContainer')}>
<Spacing size={8} />
<Banner bannerData={MOCK_BANNER_DATA} />
<Spacing size={32} />
<div className={cx('recommendWrapper')}>
<Text typography="t4" bold>추천 세차용품</Text>
<Spacing size={16} />
<RecommendListContainer />
</div>
<Spacing size={35} />
<Spacing size={32} />
<div className={cx('productListContainer')}>
<Text typography="t4" bold>WashFit 랭킹</Text>
<Spacing size={16} />
Expand Down
43 changes: 8 additions & 35 deletions src/components/shared/carousel/RecommendList.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
/* stylelint-disable selector-class-pattern */

.recommend-slide {
.slick-list {
box-sizing: border-box;
padding: 0 var(--default-padding);

.slick-track {
.slick-slide {
width: 85px !important;
margin-right: 8px;

& > div {
a {
box-sizing: border-box;
text-align: center;

.img-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 85px;
margin: 0 auto 3px;
border-radius: 16px;
background-color: #eff9ff;

img {
vertical-align: top;
}
}
}
}
}
}
.imageContainer {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
text-align: center;

span {
width: 85px;
}
}
22 changes: 12 additions & 10 deletions src/components/shared/carousel/RecommendList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Link from 'next/link';
import { RecommendProductsType } from '@remote/api/types/home';
import Text from '@shared/text/Text';

import Spacing from '../spacing/Spacing';

const settings = {
infinite: true,
slidesToShow: 4,
Expand All @@ -19,6 +21,7 @@ const settings = {
arrows: false,
speed: 2000,
autoplaySpeed: 5000,
swipeToSlide: true,
};

// eslint-disable-next-line max-len
Expand All @@ -29,16 +32,15 @@ function RecommendList({ recommendProductsData }: { recommendProductsData: Recom
<Slider {...settings} className="recommend-slide">
{recommendList?.map((slide) => {
return (
<Link href={`/product/${slide.productNo.toString()}`} key={slide.productNo}>
<div className="img-container">
<Image
// src={slide.imageSource}
src={slide.item === '코팅제' ? '/assets/코팅제.webp' : '/assets/세정제.webp'}
alt={slide.alt}
width={60}
height={60}
/>
</div>
<Link href={`/product/${slide.productNo.toString()}`} key={slide.productNo} className="imageContainer">
<Image
// src={slide.imageSource}
src={slide.item === '코팅제' ? '/assets/코팅제.webp' : '/assets/세정제.webp'}
alt={slide.alt}
width={85}
height={85}
/>
<Spacing size={4} />
<Text color="gray800" typography="t7" className="ellipsis" css={{ height: '35px' }}>{slide.productName}</Text>
</Link>
);
Expand Down
4 changes: 1 addition & 3 deletions src/hooks/withAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ComponentType, useEffect } from 'react';
import { toast } from 'react-toastify';

import { useRouter } from 'next/navigation';

Expand All @@ -18,8 +17,7 @@ function withAuth<Props = Record<string, never>>(

useEffect(() => {
if (userId == null) {
router.push('/');
toast.info('로그인 해주세요.');
router.replace('/login');
}
}, [userId, router]);

Expand Down
Loading