Skip to content

Commit

Permalink
Merge pull request #11 from New-Syatte/store-init-#4
Browse files Browse the repository at this point in the history
Store init #4
  • Loading branch information
ruddnjs3769 authored Feb 16, 2024
2 parents 514748c + 27b5fb7 commit 9a3b918
Show file tree
Hide file tree
Showing 45 changed files with 524 additions and 384 deletions.
9 changes: 3 additions & 6 deletions src/app/(auth)/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { redirect } from "next/navigation";
import { getProviders } from "next-auth/react";
import Signin from "@/components/Login/Signin";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import RouteComplete from "@/utils/RouteComplete";

type Props = {
searchParams: {
Expand All @@ -24,10 +23,8 @@ export default async function SingPage({
const providers = (await getProviders()) ?? redirect("/");

return (
<RouteComplete>
<section className="flex justify-center pt-20">
<Signin providers={providers} callbackUrl={callbackUrl ?? "/"} />
</section>
</RouteComplete>
<section className="flex justify-center pt-20">
<Signin providers={providers} callbackUrl={callbackUrl ?? "/"} />
</section>
);
}
21 changes: 15 additions & 6 deletions src/app/(brand)/midas-metall/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* eslint-disable @next/next/no-img-element */
import Image from "next/image";
import RouteComplete from "@/utils/RouteComplete";
import { GrNext, GrPrevious } from "react-icons/gr";
import logo from "public/brand/midasmetall-img/midasmetall-logo.png";
import YouTubeVideo from "@/components/youTubeVideo/YouTubeVideo";
Expand Down Expand Up @@ -41,7 +40,7 @@ const MidasMETALL = () => {
};

return (
<RouteComplete>
<>
{/* 최상단 배너 영역 */}
<div className="flex w-full flex-col bg-[#F6F6F6] h-[890px]">
<div className="flex flex-col my-auto">
Expand Down Expand Up @@ -142,16 +141,26 @@ const MidasMETALL = () => {
{MIDASMETALL_ARTWORK_TEXT}
</div>
<div className="flex w-full">
<img src={"brand/midasmetall-img/midasmetall-artwork.png"} alt={`페인팅 작품`} className="flex w-full"/>
<img
src={"brand/midasmetall-img/midasmetall-artwork.png"}
alt={`페인팅 작품`}
className="flex w-full"
/>
</div>
</div>
{/* 공식 스토어 */}
<div className="flex flex-col h-full w-full justify-center mt-[150px] mb-[240px] relative overflow-hidden">
<div className="flex w-[500px] absolute bottom-0 right-[-300px] transform rotate-[-15deg]">
<img src={"brand/midasmetall-img/midasmetall-paint3-lg.png"} alt={"왼쪽 페인트 이미지"} />
<img
src={"brand/midasmetall-img/midasmetall-paint3-lg.png"}
alt={"왼쪽 페인트 이미지"}
/>
</div>
<div className="flex w-[380px] absolute top-0 left-[-230px] transform rotate-[15deg]">
<img src={"brand/midasmetall-img/midasmetall-paint4-lg.png"} alt={"오른쪽 페인트 이미지"} />
<img
src={"brand/midasmetall-img/midasmetall-paint4-lg.png"}
alt={"오른쪽 페인트 이미지"}
/>
</div>
<div className="flex justify-center mb-[50px]">
<SubTitleBox engValue={"STORE"} korValue={"공식 스토어"} />
Expand All @@ -165,7 +174,7 @@ const MidasMETALL = () => {
</div>
</div>
</div>
</RouteComplete>
</>
);
};

Expand Down
47 changes: 35 additions & 12 deletions src/app/(brand)/modern-masters/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use client'
"use client";

/* eslint-disable @next/next/no-img-element */
import Image from "next/image";
import RouteComplete from "@/utils/RouteComplete";
import { GrNext, GrPrevious } from "react-icons/gr";
import logo from "public/brand/modernmasters-img/modernmasters-logo.png";
import YouTubeVideo from "@/components/youTubeVideo/YouTubeVideo";
Expand Down Expand Up @@ -51,7 +50,7 @@ const Modernmasters = () => {
};

return (
<RouteComplete>
<>
{/* 최상단 배너 영역 */}
<div className="flex w-full flex-col bg-[#F6F6F6] h-[890px]">
<div className="flex flex-col my-auto">
Expand Down Expand Up @@ -92,13 +91,22 @@ const Modernmasters = () => {
{/* 제품 소개 */}
<div className="flex w-full h-[960px] p-[140px] relative overflow-hidden">
<div className="flex w-[400px] absolute top-6 left-[-200px]">
<img src={"brand/modernmasters-img/silver_brush.png"} alt={"상단붓"} />
<img
src={"brand/modernmasters-img/silver_brush.png"}
alt={"상단붓"}
/>
</div>
<div className="flex w-[600px] absolute bottom-0 right-[-300px]">
<img src={"brand/modernmasters-img/silver_brush.png"} alt={"하단붓"} />
<img
src={"brand/modernmasters-img/silver_brush.png"}
alt={"하단붓"}
/>
</div>
<div className="flex w-[500px] absolute top-20 right-0 translate-x-1/4 transform rotate-[-15deg]">
<img src={"brand/modernmasters-img/modernmasters-paint-lg.png"} alt={"페인트통"} />
<img
src={"brand/modernmasters-img/modernmasters-paint-lg.png"}
alt={"페인트통"}
/>
</div>
<div className="flex w-full my-auto px-auto z-10">
<div className="flex flex-col">
Expand Down Expand Up @@ -127,7 +135,7 @@ const Modernmasters = () => {
</div>
<div className="flex w-full justify-center my-auto z-10">
<div className="flex rounded-lg overflow-hidden mt-[100px]">
<YouTubeVideo urlId={'qj5TKQbbRYg'} />
<YouTubeVideo urlId={"qj5TKQbbRYg"} />
</div>
</div>
</div>
Expand All @@ -145,7 +153,12 @@ const Modernmasters = () => {
<div className="flex justify-center gap-3">
{brandList.map((data, index) => (
<>
<div className="flex w-[190px] border-[#000000] border-[1px]" onClick={()=>{setActiveBrandIndex(index)}}>
<div
className="flex w-[190px] border-[#000000] border-[1px]"
onClick={() => {
setActiveBrandIndex(index);
}}
>
<img src={data.img} alt={`브랜드${index + 1}`} />
</div>
</>
Expand All @@ -164,16 +177,26 @@ const Modernmasters = () => {
{MODERN_MASTERS_ARTWORK_TEXT}
</div>
<div className="flex w-full">
<img src={"brand/modernmasters-img/modernmasters-artwork.png"} alt={`페인팅 작품`} className="flex w-full"/>
<img
src={"brand/modernmasters-img/modernmasters-artwork.png"}
alt={`페인팅 작품`}
className="flex w-full"
/>
</div>
</div>
{/* 공식 스토어 */}
<div className="flex flex-col h-full w-full justify-center mt-[150px] mb-[240px] relative overflow-hidden">
<div className="flex w-[500px] absolute bottom-0 right-[-200px] transform rotate-[-15deg]">
<img src={"brand/modernmasters-img/modernmasters-store_right.png"} alt={"페인트통2"} />
<img
src={"brand/modernmasters-img/modernmasters-store_right.png"}
alt={"페인트통2"}
/>
</div>
<div className="flex w-[380px] absolute top-0 left-[-160px] transform rotate-[15deg]">
<img src={"brand/modernmasters-img/modernmasters-store_left.png"} alt={"페인트통3"} />
<img
src={"brand/modernmasters-img/modernmasters-store_left.png"}
alt={"페인트통3"}
/>
</div>
<div className="flex justify-center mb-[50px]">
<SubTitleBox engValue={"STORE"} korValue={"공식 스토어"} />
Expand All @@ -187,7 +210,7 @@ const Modernmasters = () => {
</div>
</div>
</div>
</RouteComplete>
</>
);
};

Expand Down
8 changes: 4 additions & 4 deletions src/app/(cart)/cart/CartClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import useNextRouter from "@/hooks/useNextRouter";
import { useRouter } from "next/navigation";
import styles from "./CartClient.module.scss"; // 스타일 설정
import Image from "next/image";
import { useDispatch, useSelector } from "react-redux";
Expand All @@ -18,7 +18,7 @@ import {
} from "@/redux/slice/cartSlice";
import { useEffect } from "react";
import Heading from "@/components/heading/Heading";
import NextLink from "@/components/NextLink/NextLink";
import Link from "next/link";
import priceFormat from "@/utils/priceFormat";
import Button from "@/components/button/Button";
import { ICartItem } from "@/type";
Expand All @@ -34,7 +34,7 @@ export default function CartClient() {
const cartTotalQuantity = useSelector(selectCartTotalQuantity);

const dispatch = useDispatch();
const router = useNextRouter();
const router = useRouter();

const increaseCart = (cart: ICartItem) => {
// 일단 타입을 any 로 임시 지정
Expand Down Expand Up @@ -76,7 +76,7 @@ export default function CartClient() {
<div
className={"text-center font-bold text-[30px] border-[2px] mt-4"}
>
<NextLink href={"/products/all"}>계속 쇼핑하기</NextLink>
<Link href={"/products/all"}>계속 쇼핑하기</Link>
</div>
</>
) : (
Expand Down
5 changes: 2 additions & 3 deletions src/app/(cart)/cart/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import CartClient from "@/app/(cart)/cart/CartClient";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
import RouteComplete from "@/utils/RouteComplete";

export default async function CartPage() {
const session = await getServerSession(authOptions);
Expand All @@ -12,8 +11,8 @@ export default async function CartPage() {
}

return (
<RouteComplete>
<>
<CartClient />
</RouteComplete>
</>
);
}
4 changes: 2 additions & 2 deletions src/app/(checkout)/checkout-address/CheckoutAddressClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import styles from "./CheckoutAddress.module.scss";
import { ChangeEvent, FormEvent, useEffect, useRef, useState } from "react";
import { useDispatch } from "react-redux";
import useNextRouter from "@/hooks/useNextRouter";
import { useRouter } from "next/navigation";
import {
SAVE_BILLING_ADDRESS,
SAVE_SHIPPING_ADDRESS,
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function CheckoutAddressClient() {
});

const dispatch = useDispatch();
const router = useNextRouter();
const router = useRouter();

const loadScript = () => {
const script = document.createElement("script");
Expand Down
7 changes: 1 addition & 6 deletions src/app/(checkout)/checkout-address/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import CheckoutAddressClient from "@/app/(checkout)/checkout-address/CheckoutAddressClient";
import RouteComplete from "@/utils/RouteComplete";

export default async function CheckoutAddress() {
const session = await getServerSession(authOptions); // 서버에서 session 정보 호출
const user = session?.user;
if (!user) {
redirect("/signin");
}
return (
<RouteComplete>
<CheckoutAddressClient />
</RouteComplete>
);
return <CheckoutAddressClient />;
}
9 changes: 4 additions & 5 deletions src/app/(checkout)/checkout-success/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import styles from "./CheckoutSuccess.module.scss";
import priceFormat from "@/utils/priceFormat";
import { formatTime } from "@/utils/dayjs";
import Button from "@/components/button/Button";
import NextLink from "@/components/NextLink/NextLink";
import RouteComplete from "@/utils/RouteComplete";
import Link from "next/link";

type Props = {
searchParams: {
Expand All @@ -29,7 +28,7 @@ export default async function CheckoutSuccess({ searchParams }: Props) {
});

return (
<RouteComplete>
<>
<section className={styles.success}>
<Heading title={"결재 성공 "} />
<ul className={styles.list}>
Expand Down Expand Up @@ -65,9 +64,9 @@ export default async function CheckoutSuccess({ searchParams }: Props) {
)}
</ul>
<Button style="py-3 px-12">
<NextLink href="/order/order-history">주문 상태 보기</NextLink>
<Link href="/order/order-history">주문 상태 보기</Link>
</Button>
</section>
</RouteComplete>
</>
);
}
4 changes: 2 additions & 2 deletions src/app/(checkout)/checkout/CheckoutClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
selectBillingAddress,
selectShippingAddress,
} from "@/redux/slice/checkoutSlice";
import useNextRouter from "@/hooks/useNextRouter";
import { useRouter } from "next/navigation";
import dayjs from "dayjs";
import { saveCart } from "@/services/sanity/cart";
import { IOrder } from "@/type";
Expand All @@ -29,7 +29,7 @@ export default function CheckoutClient() {
const userEmail = session?.user?.email;

const dispatch = useDispatch();
const router = useNextRouter();
const router = useRouter();
const cartItems = useSelector(selectCartItems);
const shippingAddress = useSelector(selectShippingAddress);
const billingAddress = useSelector(selectBillingAddress);
Expand Down
5 changes: 2 additions & 3 deletions src/app/(checkout)/checkout/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { getServerSession } from "next-auth";
import { redirect } from "next/navigation";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import CheckoutClient from "@/app/(checkout)/checkout/CheckoutClient";
import RouteComplete from "@/utils/RouteComplete";

export default async function Checkout() {
const session = await getServerSession(authOptions); // 서버에서 session 정보 호출
Expand All @@ -11,8 +10,8 @@ export default async function Checkout() {
redirect("/signin");
}
return (
<RouteComplete>
<>
<CheckoutClient />
</RouteComplete>
</>
);
}
Loading

0 comments on commit 9a3b918

Please sign in to comment.