Skip to content

Commit

Permalink
Merge pull request #11 from sj0724/refactor-approuter
Browse files Browse the repository at this point in the history
fix: 링크 경로 수정
  • Loading branch information
sj0724 authored Jul 3, 2024
2 parents cae884c + e6312ca commit f35a293
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 121 deletions.
2 changes: 1 addition & 1 deletion app/sharedFolder/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function SharedFolderLayout({
<div>
<div className="sticky top-0 z-10 w-full bg-[--Background] px-[3.2rem] py-[2rem] lg:px-[20rem]">
<div className="flex w-fit flex-col items-start justify-center">
<Link href="/">
<Link href="/folder">
<Image src={Logo} alt="메인 로고" width={133} height={24} />
</Link>
</div>
Expand Down
5 changes: 2 additions & 3 deletions components/MainSectionCard/MainSectionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState } from 'react';
import * as S from './MainSectionCard.styled';
import Image from 'next/image';
import * as S from "./MainSectionCard.styled";
import Image from "next/image";

interface SectionItem {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion components/Modal/ShareModal/ShareModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ShareModal({
const shareFacebook = () => {
const title = "페이스북 공유하기";
window.open(
`https://www.facebook.com/sharer.php?u=${process.env.NEXT_PUBLIC_BASE_URL}/shared/${folderId}?userId=${user.id}`,
`https://www.facebook.com/sharer.php?u=${process.env.NEXT_PUBLIC_BASE_URL}/sharedFolder/${folderId}`,
title,
"toolbar=0,status=0,width=655,height=520",
);
Expand Down
2 changes: 1 addition & 1 deletion components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Nav() {
return (
<S.NavBar>
<S.NavModal>
<Link href="/">
<Link href="/folder">
<Image
src="/logo.svg"
alt="네이게이션 로고"
Expand Down
19 changes: 0 additions & 19 deletions hooks/useGetUser.ts

This file was deleted.

77 changes: 0 additions & 77 deletions hooks/useValidate.ts

This file was deleted.

21 changes: 2 additions & 19 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
import { useEffect, useState } from "react";
import * as S from "../styles/index.styled";
import MainSectionCard from "../components/MainSectionCard/MainSectionCard";
import { sectionDescription } from "../util/sectionDescription";
import { Button } from "../components/Button/Button";
import Link from "next/link";
import Image from "next/image";
import { useRouter } from "next/router";
import { useLoadUser } from "@/contexts/UserContext";

function Main() {
const [sectionList, setSectionList] = useState<typeof sectionDescription>([]);
const router = useRouter();
const { user } = useLoadUser();

useEffect(() => {
if (user) {
router.replace("/folder");
}
setSectionList(sectionDescription);
}, [user, router]);

return (
<S.Main>
<S.Main__Header>
Expand All @@ -28,10 +14,7 @@ function Main() {
<S.Slogan_gradient>세상의 모든 정보</S.Slogan_gradient>를<br />
쉽게 저장하고 관리해 보세요
</S.Slogan>
<Link
href={user ? "/folder" : "/signin"}
style={{ textDecoration: "none" }}
>
<Link href="/folder" style={{ textDecoration: "none" }}>
<Button size={"lg"} isActive={false}>
링크 추가하기
</Button>
Expand All @@ -44,7 +27,7 @@ function Main() {
</S.Header__contents>
</S.Main__Header>
<S.Main__contents>
{sectionList.map((item) => (
{sectionDescription.map((item) => (
<MainSectionCard item={item} key={item.id} />
))}
</S.Main__contents>
Expand Down

0 comments on commit f35a293

Please sign in to comment.