-
Notifications
You must be signed in to change notification settings - Fork 0
새로운 UI로 변경 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
새로운 UI로 변경 #7
Changes from all commits
a537e0d
f126734
ac92907
fa90241
3a8e117
a084e16
1ec83da
a89daa2
e0096b4
fff2dd1
bf8c884
7fb97bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,31 @@ | ||
| import { Button, PostCard } from '@/shared'; | ||
| 'use client'; | ||
|
|
||
| import { useState } from 'react'; | ||
|
|
||
| import { PostCard, Tabs } from '@/shared'; | ||
| import { Grid } from '@/widgets'; | ||
|
|
||
| export default function Home() { | ||
| const posts = Array.from({ length: 9 }); // 임시 데이터 | ||
|
|
||
| const [search, setSearch] = useState(''); | ||
|
|
||
| const onChangeSearch = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
| setSearch(e.target.value); | ||
| }; | ||
|
Comment on lines
+11
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return ( | ||
| <div className='flex w-full flex-col items-start justify-start'> | ||
| <div className='flex gap-3 py-2'> | ||
| <Button className='px-2 font-bold'>전체 (49)</Button> | ||
| <Button className='px-2 font-bold' variant='ghost'> | ||
| 개발 (3) | ||
| </Button> | ||
| <Button className='px-2 font-bold' variant='ghost'> | ||
| 일상 (9) | ||
| </Button> | ||
| <Button className='px-2 font-bold' variant='ghost'> | ||
| 회고 (4) | ||
| </Button> | ||
| </div> | ||
| <Grid columns={{ base: 1, md: 2, lg: 4 }} gap={16}> | ||
| <PostCard /> | ||
| <div className='flex flex-col items-center justify-center gap-10'> | ||
| <Tabs /> | ||
| <Grid | ||
| className='w-full px-4 md:px-8 lg:px-0' | ||
| cols='grid-cols-1 md:grid-cols-2 lg:grid-cols-[270px_270px_270px]' | ||
| gap={5} | ||
| justifyContent='center' | ||
| maxWidth='7xl' | ||
| > | ||
| {posts.map((_, index) => ( | ||
| <PostCard key={index} /> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ))} | ||
| </Grid> | ||
| </div> | ||
| ); | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||
| import Image from 'next/image'; | ||||||||||||||||||
|
|
||||||||||||||||||
| import { CalendarDays } from 'lucide-react'; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const PostCard = () => { | ||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className='flex w-full flex-col overflow-hidden bg-white shadow-lg transform-content'> | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| <div className='relative aspect-video w-full'> | ||||||||||||||||||
| <Image | ||||||||||||||||||
| fill | ||||||||||||||||||
| alt='thumbnail' | ||||||||||||||||||
| className='object-cover' | ||||||||||||||||||
| src='https://picsum.photos/400/225' | ||||||||||||||||||
| /> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| <div className='flex h-full w-full flex-col justify-between p-3'> | ||||||||||||||||||
| <div className='flex flex-col gap-2'> | ||||||||||||||||||
| <div className='text-sm font-bold text-blog-pink'>일상</div> | ||||||||||||||||||
| <div>게시물 1 제목제목</div> | ||||||||||||||||||
| <div className='text-sm text-blog-blue'> | ||||||||||||||||||
| 게시물 1에 대한 내용입니다.게시물 1에 대한 내용입니다.게시물 1에 | ||||||||||||||||||
| 대한 내용입니다.게시물 1에 대한 내용입니다. | ||||||||||||||||||
| </div> | ||||||||||||||||||
|
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 게시물 내용이 길어지면 카드의 높이가 달라져 그리드 레이아웃이 깨질 수 있습니다. 일관된 UI를 위해
Suggested change
|
||||||||||||||||||
| </div> | ||||||||||||||||||
| <div className='flex w-full items-center gap-2 pt-3'> | ||||||||||||||||||
| <CalendarDays className='size-5 text-blog-gray-600' /> | ||||||||||||||||||
| <p className='text-sm font-medium text-blog-gray-600'> | ||||||||||||||||||
| 2025년 1월 14일 | ||||||||||||||||||
| </p> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| ); | ||||||||||||||||||
| }; | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './PostCard'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| export * from './Header'; | ||
| export * from './Footer'; | ||
| export * from './PostCard'; | ||
| export * from './card'; | ||
| export * from './layout'; | ||
| export * from './tabs'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import Link from 'next/link'; | ||
|
|
||
| export const Footer = () => { | ||
| return ( | ||
| <footer className='flex h-footer w-full items-center justify-center bg-blog-gray-300'> | ||
| <div className='flex flex-col items-start justify-between gap-1'> | ||
| <p className='text-blog-gray-600'> | ||
| Copyright © 2025 <b>Dobbymin</b> All rights reserved. | ||
| </p> | ||
| <div className='flex items-center justify-center gap-1 font-fira-code text-blog-gray-600'> | ||
| <span>gmin0701@knu.ac.kr</span> | ||
| <span className='font-bold'>.</span> | ||
| <span>+82-10-3095-7259</span> | ||
| <span className='font-bold'>.</span> | ||
| <Link | ||
| className='hover:font-bold hover:underline' | ||
| href='https://github.com/Dobbymin' | ||
| > | ||
| GitHub | ||
| </Link> | ||
| <span className='font-bold'>.</span> | ||
| <Link | ||
| className='hover:font-bold hover:underline' | ||
| href='https://www.linkedin.com/in/dobbymin/' | ||
| > | ||
| </Link> | ||
| </div> | ||
|
Comment on lines
+8
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 푸터에 개인 정보(이메일, 전화번호, 링크)가 하드코딩되어 있습니다. 이 정보들을 별도의 상수 파일로 분리하여 관리하면 재사용성과 유지보수성을 높일 수 있습니다. 또한, 예시: // constants/author.ts
export const authorInfo = {
name: 'Dobbymin',
email: 'gmin0701@knu.ac.kr',
// ...
};
// Footer.tsx
<p>...
Copyright © 2025 <span className='font-bold'>{authorInfo.name}</span> All rights reserved.
</p> |
||
| </div> | ||
| </footer> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||
| import Link from 'next/link'; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import { Search, Sun } from 'lucide-react'; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import { routerPath } from '../../../constants'; | ||||||||||||||||||||
| import { Input } from '../../ui'; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const Header = () => { | ||||||||||||||||||||
| return ( | ||||||||||||||||||||
| <header className='fixed top-0 right-0 left-0 z-100 flex h-header items-center justify-between bg-blog-gray-500 px-header transition-colors'> | ||||||||||||||||||||
| <Link href={routerPath.main}> | ||||||||||||||||||||
| <p className='font-lemon text-3xl'>Dobblog</p> | ||||||||||||||||||||
| </Link> | ||||||||||||||||||||
| <div className='absolute top-1/2 left-1/2 hidden w-[400px] max-w-[60vw] -translate-x-1/2 -translate-y-1/2 items-center justify-center gap-3 rounded-sm bg-blog-gray-100 md:flex'> | ||||||||||||||||||||
| <Input | ||||||||||||||||||||
| className='border-none bg-transparent text-sm text-blog-gray-500 shadow-none outline-none placeholder:text-blog-gray-400 focus:border-none focus:ring-0 focus:outline-none' | ||||||||||||||||||||
| type='text' | ||||||||||||||||||||
| /> | ||||||||||||||||||||
|
Comment on lines
+15
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 검색
Suggested change
|
||||||||||||||||||||
| <Search className='mr-3 text-blog-gray-500' size={20} /> | ||||||||||||||||||||
| </div> | ||||||||||||||||||||
| <div className='flex items-center justify-between gap-5'> | ||||||||||||||||||||
| <Link href={routerPath.about}> | ||||||||||||||||||||
| <p className='font-lemon text-xl'>About</p> | ||||||||||||||||||||
| </Link> | ||||||||||||||||||||
| <Sun className='cursor-pointer text-blog-pink' /> | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||
| </div> | ||||||||||||||||||||
| </header> | ||||||||||||||||||||
| ); | ||||||||||||||||||||
| }; | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './Footer'; | ||
| export * from './Header'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| 'use client'; | ||
|
|
||
| import { useState } from 'react'; | ||
|
|
||
| export const Tabs = () => { | ||
| const [selected, setSelected] = useState(0); | ||
|
|
||
| const tabs = [ | ||
| { name: 'All.tsx', count: 49 }, | ||
| { name: 'Develop.tsx', count: 3 }, | ||
| { name: 'Daily.tsx', count: 9 }, | ||
| { name: 'Review.tsx', count: 4 }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <div className='flex h-13 justify-start overflow-x-auto py-2 font-fira-code'> | ||
| {tabs.map((tab, idx) => ( | ||
| <div | ||
| key={tab.name} | ||
| className={`flex cursor-pointer items-center justify-center gap-2 border-r px-5 text-sm font-semibold transition-colors last:border-r-0 ${ | ||
| selected === idx | ||
| ? 'bg-blog-gray-100 text-blog-black' | ||
| : 'bg-blog-gray-200 text-blog-gray-600 hover:font-bold' | ||
| } ${idx === 0 ? '' : 'w-full'} `} | ||
| onClick={() => setSelected(idx)} | ||
| > | ||
| <p>{tab.name}</p> | ||
| <p className='text-blog-green'>({tab.count})</p> | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
Comment on lines
+16
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재
아래와 같이 개선하는 것을 제안합니다. |
||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './Tabs'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| declare module '*.css' { | ||
| const content: { [className: string]: string }; | ||
| export default content; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--line-height-footer를 계산할 때 정의되지 않은--footer-padding-x변수를 사용하고 있어 CSS가 올바르게 적용되지 않을 수 있습니다. 이 변수를 정의하거나, 계산에서 제거하는 것을 고려해 보세요. 만약 수평 패딩이 없다면,calc(var(--footer-height))로도 충분할 수 있습니다.