Skip to content

Commit

Permalink
Merge pull request #257 from Kernel360/fix-issue-main
Browse files Browse the repository at this point in the history
페이지 디자인: 홈페이지 디자인 수정
  • Loading branch information
bottlewook authored Mar 5, 2024
2 parents 2d65dd6 + 5f6ccaf commit ec89f77
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 51 deletions.
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

0 comments on commit ec89f77

Please sign in to comment.