Skip to content

Commit

Permalink
feat: landing 페이지 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
moong23 committed Feb 14, 2024
1 parent 8854919 commit ab760db
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 34 deletions.
6 changes: 1 addition & 5 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

<url>
<loc>https://hooking.me/</loc>
<lastmod>2023-08-14T05:05:16+00:00</lastmod>
</url>
<url>
<loc>https://hooking.me/home</loc>
<lastmod>2023-08-14T05:05:16+00:00</lastmod>
<lastmod>2024-02-14T05:05:16+00:00</lastmod>
</url>
<url>
<loc>https://hooking.me/writing</loc>
Expand Down
9 changes: 5 additions & 4 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ const Header = () => {
const handleLogin = () => setLoginModal(true);

const MENU = {
landing: { name: "landing", path: "/", idx: -1 },
home: { name: "home", path: "/home", idx: 0 },
// landing: { name: "landing", path: "/", idx: -1 },
home: { name: "home", path: "/", idx: 0 },
};

return (
<HeaderWrapper>
{/* want to add divider to determine if the width is bigger than 1024px or not */}
<div className="header__wrap">
<div className="header__content--left">
<Button
icon="icon-logo"
text=""
onClick={() => {
setActiveChildMenuIdx(-1);
let curMenu = !isLogin ? MENU.landing : MENU.home;
let curMenu = MENU.home;
setActiveMenuIdx(curMenu.idx);
navigate(curMenu.path);
}}
Expand Down Expand Up @@ -90,7 +91,7 @@ export default Header;
const HeaderWrapper = styled.header`
position: fixed;
top: 0;
width: 100%;
width: 100vw;
height: ${HEADER_HEIGHT_MO};
z-index: ${Z_INDEX_HEADER};
background-color: ${(props) => props.theme.colors.white};
Expand Down
7 changes: 5 additions & 2 deletions src/components/Search/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const SearchBar = () => {
};

useEffect(() => {
if (location.pathname === "/" || location.pathname === "/home") {
if (location.pathname === "/") {
setSearchState({ ...searchState, searchKeyword: "" });
setKeyword("");
}
Expand All @@ -75,7 +75,10 @@ const SearchBar = () => {
onClick={handleFocusOn}
active={searchState.searchFocus}
>
<form onSubmit={onSearchSubmit} className="searchbar__wrap">
<form
onSubmit={onSearchSubmit}
className="searchbar__wrap"
>
<span
onClick={handleFocusOn}
className={`icon icon-${
Expand Down
7 changes: 5 additions & 2 deletions src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const SearchBar = () => {
};

useEffect(() => {
if (location.pathname === "/" || location.pathname === "/home") {
if (location.pathname === "/") {
setSearchState({ ...searchState, searchKeyword: "" });
setKeyword("");
}
Expand Down Expand Up @@ -115,7 +115,10 @@ const SearchBar = () => {

return (
<>
<SearchBarWrapper ref={searchWrap} onClick={handleFocusOn}>
<SearchBarWrapper
ref={searchWrap}
onClick={handleFocusOn}
>
<form
onSubmit={onSearchSubmit}
className={`${
Expand Down
52 changes: 42 additions & 10 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,57 @@ const Landing = () => {
</div>
<div className="cardArea">
{/* <div className="card2"></div> */}
<img src={card2} alt="imgcard" className="card2" />
<img src={card1} alt="imgcard" className="card1" />
<img
src={card2}
alt="imgcard"
className="card2"
/>
<img
src={card1}
alt="imgcard"
className="card1"
/>
</div>
</div>
<div className="bottomArea">
<div className="filterArea">
<div className="filterBtn">
<div className="filtertop">
무드 키워드
<img src={iconfold} alt="foldIcon" />
<img
src={iconfold}
alt="foldIcon"
/>
</div>
<div className="filterBtm">브랜드를 설명하는 키워드</div>
</div>
<div className="filterBtn">
<div className="filtertop">
산업군
<img src={iconfold} alt="foldIcon" />
<img
src={iconfold}
alt="foldIcon"
/>
</div>
<div className="filterBtm">브랜드가 속한 산업군</div>
</div>
<div className="filterBtn">
<div className="filtertop">
타겟 나이대
<img src={iconfold} alt="foldIcon" />
<img
src={iconfold}
alt="foldIcon"
/>
</div>
<div className="filterBtm">중점적으로 목표한 나이대</div>
</div>
<div className="filterBtn">
<div className="filtertop">
가격대
<img src={iconfold} alt="foldIcon" />
<img
src={iconfold}
alt="foldIcon"
/>
</div>
<div className="filterBtm">형성되어 있는 가격</div>
</div>
Expand All @@ -99,7 +119,7 @@ const Landing = () => {
text="바로 살펴보기"
className="button-landing-orange text-landing "
onClick={() => {
navigate("/home");
navigate("/");
setActiveMenuIdx(0);
}}
/>
Expand All @@ -124,11 +144,19 @@ const Landing = () => {
내가 원하는 브랜드 카피를 바로 볼 수 있어요.
</span>
</div>
<img src={landing2} alt="landingpage" className="page2Img" />
<img
src={landing2}
alt="landingpage"
className="page2Img"
/>
</LandingPage2>
<div ref={ref}>
<LandingPage3>
<img src={landing3} alt="landingpage" className="page3Img" />
<img
src={landing3}
alt="landingpage"
className="page3Img"
/>
<div className="textDiv">
<span className="mainText">
다양한 브랜드의
Expand All @@ -143,7 +171,11 @@ const Landing = () => {
</div>
</LandingPage3>
<LandingPage4 ref={newRef}>
<img src={landing4} alt="landingpage" className="page4Img" />
<img
src={landing4}
alt="landingpage"
className="page4Img"
/>
</LandingPage4>
</div>
{(inView || newInView) && (
Expand Down
5 changes: 3 additions & 2 deletions src/pages/OathProcessor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useSetRecoilState } from "recoil";
import { activeMenu, isLogined } from "@/utils/atom";
import { useNavigate } from "react-router-dom";
import { setCookie } from "@/hooks/cookies";
import HomeSkeleton from "./Skeleton/HomeSkeleton";

const OathProcessor = () => {
const Navigate = useNavigate();
Expand All @@ -25,14 +26,14 @@ const OathProcessor = () => {
setActiveMenuIdx(0);
setCookie("userToken", token);
setIsLogin(true);
Navigate("/home");
Navigate("/");
} else {
alert("로그인에 실패했습니다.");
Navigate("/");
}
};

return <>Loading...</>;
return <HomeSkeleton />;
};

export default OathProcessor;
12 changes: 6 additions & 6 deletions src/router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ const HookingRouter = () => {
const handleCopyClose = () => setBrandModal(false);

const routes = [
// {
// path: "/",
// name: "Landing",
// component: <Landing />,
// },
{
path: "/",
name: "Landing",
component: <Landing />,
},
{
path: "/home",
name: "Home",
component: (
<Suspense fallback={<HomeSkeleton />}>
Expand All @@ -67,7 +67,7 @@ const HookingRouter = () => {
{
path: "/bookmark",
name: "BookMark",
component: isLogin ? <BookMark /> : <Navigate to="/home" />,
component: isLogin ? <BookMark /> : <Navigate to="/" />,
},
{
path: "/qna",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const activeMenu = atom({

export const activeChildMenu = atom({
key: "activeChildMenu",
default: -1,
default: 0,
effects_UNSTABLE: [persistAtom],
});

Expand Down
4 changes: 2 additions & 2 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const FILTER_DATA = [
export const HEADER_LEFT_MENU = [
{
idx: 0,
path: "/home",
path: "/",
name: "홈",
},

Expand All @@ -120,7 +120,7 @@ export const PROFILE_DATA = [
{
idx: 2,
text: "문의",
link: "/home",
link: "/",
},
{
idx: 3,
Expand Down

0 comments on commit ab760db

Please sign in to comment.