Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1d93e08
fix: change font color to white
timosean Nov 11, 2022
1376a0e
feat: add Noto Sans KR font
timosean Nov 11, 2022
40733b6
feat: add menubutton component for mapping
timosean Nov 11, 2022
ae1a516
fix: remove additional margins to fit layout
timosean Nov 11, 2022
118e983
feat: add hover animation on PostCard
timosean Nov 11, 2022
3888762
feat: add react-icons, fix PostCard UI
timosean Nov 11, 2022
e6120a7
feat: size up postcard title font
timosean Nov 11, 2022
4ebe224
feat: add search icon
timosean Nov 11, 2022
06c7517
style: remove comments
timosean Nov 11, 2022
80849fa
fix: change body tag to main tag (hydration error)
Nov 11, 2022
bb879e6
fix: default font color to white
timosean Nov 11, 2022
ce9b03a
Feature/blog (#6)
ansoojin Nov 12, 2022
a30a13e
Merge branch 'develop' of https://github.com/DevKor-Team/DEVKOR-front…
timosean Nov 17, 2022
bf99155
Merge branch 'Feature/blog' of into timosean/blog
timosean Jan 1, 2023
dc61150
rename: create tech related folder
timosean Jan 1, 2023
f4fbf80
feat: apply dark-mode to text editor
timosean Jan 1, 2023
2142424
fix: register button background white problem
timosean Jan 1, 2023
8d78053
feat: tech write page UI simpler
timosean Jan 1, 2023
90804fe
remove: unused imports
timosean Jan 1, 2023
9c62704
feat: initial postView page
timosean Jan 2, 2023
5c63785
feat: modify tagbutton type
timosean Jan 2, 2023
f1258c0
feat: add tagbutton to postview
timosean Jan 2, 2023
a22696c
feat: add PostView Only Tagbutton
timosean Jan 2, 2023
67f343a
feat: modify PostView tag UI
timosean Jan 2, 2023
0548614
feat: add Icons to Postview page
timosean Jan 2, 2023
ddfa035
feat: add post information section
timosean Jan 2, 2023
e3daadf
feat: add tailwind markdown parser
timosean Jan 2, 2023
cadc3eb
feat: markdown style complete
timosean Jan 2, 2023
bbbbfbc
feat: add post writer profile section
timosean Jan 2, 2023
2bd6103
feat: add comment write area
timosean Jan 2, 2023
22f00d4
feat: add comment component
timosean Jan 2, 2023
8ced8cd
feat: add topic recommend section
timosean Jan 3, 2023
18ab800
feat: add responsive design to PostCard
timosean Jan 4, 2023
a77a7b9
feat: add responsive design to PostView (PostCard)
timosean Jan 4, 2023
ff4d195
fix: header disappearing issue when browser shrink
timosean Jan 4, 2023
4f95d40
feat: add link to home when clicking header logo
timosean Jan 4, 2023
8982df2
fix: header mypage icon disappearing
timosean Jan 4, 2023
18ae285
fix: header UI padding
timosean Jan 4, 2023
ac2b273
feat: post/[postID] 페이지 추천 포스트 레이아웃 수정
timosean Jan 4, 2023
5cd2b2b
refactor: 메뉴 리스트 노가다코드 map 함수로 대체
timosean Jan 4, 2023
db8ddb9
feat: 모바일 레이아웃 좌우패딩 수정
timosean Jan 4, 2023
329a9d3
feat: 모바일 햄버거 메뉴 추가
timosean Jan 4, 2023
2124fcb
fix: 모바일뷰 / 웹뷰 경계 일치시키기
timosean Jan 4, 2023
7958a17
refactor: 헤더 메뉴바 코드 리팩토링
timosean Jan 4, 2023
93efc8d
refactor: 헤더 메뉴 리스트 태그를 div에서 nav로 변경
timosean Jan 4, 2023
8b0fbfc
feat: 모바일 메뉴 드롭다운 초기버전 추가
timosean Jan 4, 2023
969613e
feat: 모바일 레이아웃 좌우 padding 수정
timosean Jan 4, 2023
000e693
feat: 모바일 헤더 드롭다운 완성
timosean Jan 4, 2023
b2c9c11
form: 헤더 모바일 드롭다운 Todo 주석 작성
timosean Jan 4, 2023
378d93c
chore: 모바일뷰 테크블로그 메인페이지 폰트크기 조정
timosean Jan 4, 2023
f37761a
feat: 게시물(Post) 페이지 반응형 구현
timosean Jan 4, 2023
1bb3f6b
chore: 포스트 제목 line-height 미세 조정
timosean Jan 4, 2023
017f7e4
fix: 포스트 댓글 웹뷰에서 margin 안 맞는 문제 해결
timosean Jan 4, 2023
4c7335c
refactor: 아이콘들은 따로 모아서 관리
timosean Jan 4, 2023
a03dfb9
chore: Tech Blog UI 미세조정
timosean Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 49 additions & 21 deletions components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,55 @@
import Image from "next/image";
import { SingleMenu } from "./HeaderItem";
import { WebMenuBar, MobileHeaderDropdown } from "./HeaderItem";
import Link from "next/link";
import { useState } from "react";
import Hamburger from "hamburger-react";

const Header = () => {
return (
<header className="w-full flex bg-black justify-between items-center h-[5rem]">
<section className="flex pl-[9.375rem]">
<div className="pr-[2rem]">
<Image src="/images/devkor-logo.svg" alt="devkor" width="108" height="90"></Image>
</div>
<div className="flex py-[1.875rem]">
<SingleMenu title="Tech" />
<SingleMenu title="Project" />
<SingleMenu title="Study" />
<SingleMenu title="Question" />
<SingleMenu title="Members" />
<SingleMenu title="Apply" />
</div>
</section>
<section className="pr-[9.375rem] py-[1.875rem] flex items-center cursor-pointer">
<Image src="/images/profile-logo.png" alt="profile" width="25" height="25" />
</section>
</header>
);
const [isOpen, setOpen] = useState(false);
return (
<header className="w-full relative px-[1rem] md:px-[9.375rem] flex bg-black justify-between items-center h-[5rem]">
<section className="flex">
{/* 헤더 로고 */}
<div className="flex items-center pr-[2rem] w-[6.75rem] h-[5.625rem] hover:cursor-pointer">
<Link href="/">
<Image
src="/images/devkor-logo.svg"
alt="devkor"
width="108"
height="90"
></Image>
</Link>
</div>
{/* 메뉴 리스트 */}
<nav className="items-center py-[1.875rem] hidden lg:flex">
<WebMenuBar />
</nav>
</section>
{/* 마이페이지 아이콘 or 햄버거(모바일)*/}
<section className="py-[1.875rem] flex items-center cursor-pointer">
<div className="hidden lg:flex">
<Image
src="/images/profile-logo.png"
alt="profile"
width="25"
height="25"
layout="fixed"
/>
</div>
<div className="flex lg:hidden">
<Hamburger
toggled={isOpen}
toggle={setOpen}
size={24}
color={"#F6B55A"}
rounded
label="Show menu"
/>
</div>
</section>
<MobileHeaderDropdown isOpen={isOpen} />
</header>
);
};

export default Header;
59 changes: 48 additions & 11 deletions components/HeaderItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,55 @@ import React from "react";
import { useRouter } from "next/router";

interface MenuProps {
title: string;
title: string;
}

export const MenuList = [
"Tech",
"Project",
"Study",
"Question",
"Members",
"Apply",
];

export const SingleMenu = ({ title }: MenuProps) => {
const router = useRouter();
const routerPath = title.toLowerCase();
const handleClick = () => {
router.push(`/${routerPath}`);
};
return (
<div className="text-[#F6B55A] px-[2rem] text-lg cursor-pointer font-noto" onClick={handleClick}>
{title}
</div>
);
const router = useRouter();
const routerPath = title.toLowerCase();
const handleClick = () => {
router.push(`/${routerPath}`);
};
return (
<div
className="text-[#F6B55A] px-[1.3rem] xl:px-[1.8rem] text-lg cursor-pointer font-noto"
onClick={handleClick}
>
{title}
</div>
);
};

export const WebMenuBar = () => {
return (
<>
{MenuList.map((menu) => (
<SingleMenu title={menu} />
))}
</>
);
};

export const MobileHeaderDropdown = ({ isOpen }: { isOpen: boolean }) => {
return (
<nav
className={`w-40 py-4 pl-1.5 pr-2.5 rounded-sm bg-[#1e1e1e] ${
isOpen ? "flex" : "hidden"
} z-10 lg:hidden absolute right-[1.7rem] md:right-[9.375rem] top-[4rem] flex-col space-y-3 justify-center items-start`}
>
{/* Todo: 로그인 여부에 따라서 MyPage 또는 Login 으로 표기하기*/}
{["MyPage"].concat(MenuList).map((menu) => (
<SingleMenu title={menu} />
))}
</nav>
);
};
30 changes: 30 additions & 0 deletions components/Icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { FiHeart, FiDownload } from "react-icons/fi";
import { FaHeart } from "react-icons/fa"; //꽉 찬 하트
import { IoChatbox } from "react-icons/io5";

export const EmptyHeartIcon = () => {
return (
<FiHeart
stroke="#F6B55A"
className="hover:cursor-pointer w-[20px] h-[20px] md:w-[24px] md:h-[24px]"
/>
);
};

export const DownloadIcon = () => {
return (
<FiDownload
stroke="#F6B55A"
className="hover:cursor-pointer w-[20px] h-[20px] md:w-[24px] md:h-[24px]"
/>
);
};

export const ChatboxIcon = () => {
return (
<IoChatbox
fill="#F6B55A"
className="hover:cursor-pointer w-[20px] h-[20px] md:w-[24px] md:h-[24px]"
/>
);
};
12 changes: 6 additions & 6 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from "react";
import Header from "./Header";

export const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<div className="bg-black w-full">
<Header />
<main className="px-[9.375rem]">{children}</main>
</div>
);
return (
<div className="bg-black w-full">
<Header />
<main className="px-[1rem] md:px-[9.375rem]">{children}</main>
</div>
);
};
6 changes: 3 additions & 3 deletions components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { FaComment, FaHeart } from "react-icons/fa";

const PostCard = () => {
return (
<div className="max-w-sm ml-auto mr-auto rounded overflow-hidden shadow-lg cursor-pointer bg-button md:hover:-mt-5 md:hover:mb-5 transition-all">
<div className="max-w-sm w-full mb-8 rounded overflow-hidden shadow-lg cursor-pointer bg-button md:hover:-mt-5 md:hover:mb-5 transition-all">
<div className="w-full aspect-[3/2] relative">
<Image src={blogDefault} alt="BlogPost" layout="fill" />
</div>
<div className="px-4 py-4">
<div className="font-bold text-white text-2xl break-normal mb-5 h-14">
<div className="font-bold text-white text-2xl lg:text-xl xl:text-2xl break-normal mb-5 h-14">
Next.js의 Hydration 파헤치기
</div>
<p className="text-divider">2022년 10월 7일</p>
</div>
<div className="info flex items-center mb-3 border-t-divider border-t">
<div className="ml-4 mt-3 flex items-center">
<div className="ml-4 md:ml-2 xl:ml-4 mt-3 flex items-center">
<Image
className="rounded-full"
src={profileDefault}
Expand Down
39 changes: 39 additions & 0 deletions components/PostComment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import Image from "next/image";

//Todo: 나중에 date, imgsrc 등도 props로 넘겨받아야 함.
export const PostComment = ({ children }: { children: string }) => {
return (
<div className="w-full py-6 border-b border-[#2A2A2A]">
<div className="w-full mb-6 flex">
<div className="md:hidden flex items-center">
<Image
src="/images/example-profile.png"
width="45"
height="45"
layout="fixed"
className="rounded-full"
/>
</div>
<div className="hidden md:block">
<Image
src="/images/example-profile.png"
width="75"
height="75"
layout="fixed"
className="rounded-full"
/>
</div>
<div className="flex flex-col justify-center ml-3 md:ml-6">
<span className="font-bold text-base md:text-xl">안수진(OB)</span>
<span className="text-sm md:text-base text-divider">
2022년 12월 3일
</span>
</div>
</div>
<div className="w-full text-base md:text-lg my-[1.125rem]">
{children}
</div>
</div>
);
};
63 changes: 36 additions & 27 deletions components/Tags.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
import React, { useState, SetStateAction } from "react";
// Tag Button Type Interface
export interface TagButtonType {
name: string;
mapIdx: number;
sectionIdx: number;
setSectionIdx: React.Dispatch<SetStateAction<number>>;
}

// Menu Button Component
export const TagButton = ({
name,
mapIdx,
sectionIdx,
setSectionIdx,
}: TagButtonType) => {
return (
<button
className={`${
sectionIdx == mapIdx ? "bg-devkor text-black font-bold" : "bg-button"
} w-28 py-2 mr-4 rounded-full flex justify-center`}
onClick={() => setSectionIdx(mapIdx)}
>
{name}
</button>
);
};

// MenuList
export const TagList = ["전체", "Frontend", "Backend", "ML", "DevOps", "기타"];
name: string;
mapIdx: number;
sectionIdx: number;
setSectionIdx: React.Dispatch<SetStateAction<number>>;
}

// Tag Button Component
export const TagButton = ({
name,
mapIdx,
sectionIdx,
setSectionIdx,
}: TagButtonType) => {
return (
<button
className={`${
sectionIdx == mapIdx ? "bg-devkor text-black font-bold" : "bg-button"
} w-28 py-2 mr-4 rounded-full flex justify-center`}
onClick={() => setSectionIdx(mapIdx)}
>
{name}
</button>
);
};

// PostView Tag
export const PostTag = ({ category }: { category: string }) => {
return (
<span className="bg-devkor text-black text-sm md:text-lg font-bold w-20 md:w-28 py-1 mr-4 rounded-full flex justify-center">
{category}
</span>
);
};

// TagList
export const TagList = ["전체", "Frontend", "Backend", "ML", "DevOps", "기타"];
Loading