Skip to content

Commit

Permalink
feat : 임시로 로그인 상태를 구분합니다 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhminme authored Sep 20, 2023
1 parent ddc2778 commit 0257100
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
19 changes: 0 additions & 19 deletions apps/web/app/(articles)/_components/article-comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,6 @@ export function ArticleComment(): JSX.Element {
<span className="date-posted">Dec 29th</span>
</div>
</div>

<div className="card">
<div className="card-block">
<p className="card-text">With supporting text below as a natural lead-in to additional content.</p>
</div>
<div className="card-footer">
<a className="comment-author" href="/profile/author">
<img alt="" className="comment-author-img" src="http://i.imgur.com/Qr71crq.jpg" />
</a>
&nbsp;
<a className="comment-author" href="/profile/jacob-schmidt">
Jacob Schmidt
</a>
<span className="date-posted">Dec 29th</span>
<span className="mod-options">
<i className="ion-trash-a" />
</span>
</div>
</div>
</div>
</div>
);
Expand Down
16 changes: 15 additions & 1 deletion apps/web/app/(articles)/_components/article-detail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import Link from "next/link";
import { useGetArticle } from "../_hooks/use-get-article";
import { ArticleComment } from "./article-comment";
import ArticleBanner from "./article-banner";
Expand All @@ -13,6 +14,8 @@ interface ArticleDetailProps {
export function ArticleDetail({ slug }: ArticleDetailProps): JSX.Element {
const { data } = useGetArticle(slug);

const isLogin = false;

return (
<div className="article-page">
{data ? (
Expand All @@ -21,7 +24,18 @@ export function ArticleDetail({ slug }: ArticleDetailProps): JSX.Element {
<div className="container page">
<ArticleContent article={data} />
<ArticleAction article={data} />
<ArticleComment />

{/* TODO : 로그인 구현 후 코멘트 상태 만들기 */}
{isLogin ? (
<ArticleComment />
) : (
<div>
<Link href="/login">Sign in&nbsp;</Link>
or&nbsp;
<Link href="/register">sign up&nbsp;</Link>
to add comments on this article.
</div>
)}
</div>
</>
) : null}
Expand Down
14 changes: 13 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const { createVanillaExtractPlugin } = require("@vanilla-extract/next-plugin");
const withVanillaExtract = createVanillaExtractPlugin();

const nextConfig = { reactStrictMode: true, transpilePackages: ["ui"] };
const nextConfig = {
reactStrictMode: true,
transpilePackages: ["ui"],
async redirects() {
return [
{
source: "/",
destination: "/1",
permanent: true,
},
];
},
};

module.exports = {};

Expand Down

0 comments on commit 0257100

Please sign in to comment.