-
Notifications
You must be signed in to change notification settings - Fork 1
31 change UI #33
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
base: main
Are you sure you want to change the base?
31 change UI #33
Changes from all commits
2d5e994
1629eeb
ea62395
a614c00
3dff41c
495576a
f341d6c
9b4d996
76607ec
5842858
49511c8
cdea11d
49b8edd
93b4f4b
9d093c6
494919a
14b3623
4d024b0
e9f3a54
1e0377a
b66e171
decf6dc
9813b33
a02b87f
0632e1e
9373851
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 |
|---|---|---|
|
|
@@ -47,4 +47,4 @@ jobs: | |
| run: yarn run lint | ||
|
|
||
| - name: Run prettier | ||
| run: yarn run prettier | ||
| run: yarn run prettier:check | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,3 +34,4 @@ yarn-error.log* | |
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": true, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "tailwind.config.ts", | ||
| "css": "src/app/globals.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "iconLibrary": "lucide" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| 'use client'; | ||
|
|
||
| import React from 'react'; | ||
| import { Plus, Trophy } from 'lucide-react'; | ||
|
|
||
| import ContestTable, { Contest } from '@/components/ContestTable'; | ||
| import contestsData from '@/data/contestsData'; | ||
| import { Checkbox } from '@/components/ui/checkbox'; | ||
| import { Button } from '@/components/ui/button'; | ||
| import ContestCards from '@/components/ContestCards'; | ||
| import Footer from '@/components/Footer'; | ||
|
|
||
| export default function ContestsPage() { | ||
| const [contests, setContests] = React.useState<Contest[]>(contestsData); | ||
|
|
||
| const [favoriteOnly, setFavoriteOnly] = React.useState(false); | ||
|
|
||
| const onClickFavorite = (id: Contest['id']) => { | ||
| setContests((prev) => | ||
| prev.map((c) => (c.id === id ? { ...c, isFavorite: !c.isFavorite } : c)), | ||
| ); | ||
| }; | ||
|
|
||
| const filteredContests = React.useMemo( | ||
| () => (favoriteOnly ? contests.filter((p) => p.isFavorite) : contests), | ||
| [contests, favoriteOnly], | ||
| ); | ||
|
|
||
| const onEnter = (id: Contest['id']) => { | ||
| // TODO: enter the contest/{id} detail edit page | ||
| console.log('enter', id); | ||
| }; | ||
|
|
||
| const onDelete = (id: Contest['id']) => { | ||
| // TODO: delete the contest/{id} immediately | ||
| const ok = window.confirm('Are you sure you want to delete this?'); | ||
| if (!ok) return; | ||
| setContests((prev) => prev.filter((c) => c.id !== id)); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className='min-h-screen bg-gradient-to-br from-gray-50 to-gray-100'> | ||
| <div className='container px-4 py-6 mx-auto'> | ||
| <div className='flex items-center justify-between mb-6'> | ||
| <div> | ||
| <h1 className='text-3xl font-bold text-gray-900 flex items-center gap-3'> | ||
| <Trophy className='h-8 w-8 text-primary' /> | ||
| Contests | ||
| </h1> | ||
| <p className='text-gray-600 mt-1'> | ||
| {filteredContests.length} contests available | ||
| </p> | ||
| </div> | ||
| <div className='flex items-center gap-4'> | ||
| <div className='flex items-center gap-2'> | ||
| <Checkbox | ||
| id='favorites' | ||
| checked={favoriteOnly} | ||
| onCheckedChange={(v) => setFavoriteOnly(Boolean(v))} | ||
| aria-controls='contests-table' | ||
| /> | ||
| <label htmlFor='favorites' className='text-sm cursor-pointer'> | ||
| Only favorite | ||
| </label> | ||
| </div> | ||
| {/* TODO: get user-info, and add filter function and onClick state */} | ||
| <div className='flex items-center gap-2'> | ||
| <Checkbox id='activity' /> | ||
| <label htmlFor='activity' className='text-sm'> | ||
| Only my activity | ||
| </label> | ||
| </div> | ||
| <Button | ||
| onClick={() => console.log('Creating new contests!')} | ||
| className='inline-flex flex-row flex-nowrap items-center gap-2 whitespace-nowrap leading-none | ||
| bg-amber-400 hover:bg-amber-500 text-white px-4 py-2 h-auto rounded-xl shadow' | ||
| > | ||
| <Plus className='h-4 w-4 shrink-0' /> | ||
| <span className='font-medium inline-block'>Create Contest</span> | ||
| </Button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <ContestTable | ||
| contests={filteredContests} | ||
| onClickFavorite={onClickFavorite} | ||
| onEnter={onEnter} | ||
| onDelete={onDelete} | ||
| /> | ||
| <ContestCards contests={filteredContests} /> | ||
| </div> | ||
| <Footer /> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,63 @@ | ||
| @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600&display=swap'); | ||
|
|
||
| @layer base { | ||
| :root { | ||
| --font-logo: 'Baloo 2', sans-serif; | ||
| } | ||
| } | ||
|
|
||
| @tailwind base; | ||
| @tailwind components; | ||
| @tailwind utilities; | ||
|
|
||
| @layer base { | ||
| :root { | ||
| --font-logo: 'Baloo 2', sans-serif; | ||
| --background: 0 0% 100%; | ||
| --foreground: 222.2 84% 4.9%; | ||
| --card: 0 0% 100%; | ||
| --card-foreground: 222.2 84% 4.9%; | ||
| --popover: 0 0% 100%; | ||
| --popover-foreground: 222.2 84% 4.9%; | ||
| /* --primary: 36 100% 50%; */ | ||
| --primary: 45 100% 60%; | ||
| --primary-foreground: 210 40% 98%; | ||
| --secondary: 210 40% 96.1%; | ||
| --secondary-foreground: 222.2 47.4% 11.2%; | ||
| --muted: 210 40% 96.1%; | ||
| --muted-foreground: 215.4 16.3% 46.9%; | ||
| --accent: 210 40% 96.1%; | ||
| --accent-foreground: 222.2 47.4% 11.2%; | ||
| --destructive: 0 84.2% 60.2%; | ||
| --destructive-foreground: 210 40% 98%; | ||
| --border: 214.3 31.8% 91.4%; | ||
| --input: 214.3 31.8% 91.4%; | ||
| /* --ring: 36 100% 50%; */ | ||
| --ring: 45 100% 60%; | ||
| --radius: 0.5rem; | ||
| } | ||
|
|
||
| .dark { | ||
| --background: 222.2 84% 4.9%; | ||
| --foreground: 210 40% 98%; | ||
| --card: 222.2 84% 4.9%; | ||
| --card-foreground: 210 40% 98%; | ||
| --popover: 222.2 84% 4.9%; | ||
| --popover-foreground: 210 40% 98%; | ||
| --primary: 45 100% 60%; | ||
| --primary-foreground: 222.2 47.4% 11.2%; | ||
| /* --primary: 36 100% 50%; */ | ||
| --secondary: 217.2 32.6% 17.5%; | ||
| --secondary-foreground: 210 40% 98%; | ||
| --muted: 217.2 32.6% 17.5%; | ||
| --muted-foreground: 215 20.2% 65.1%; | ||
| --accent: 217.2 32.6% 17.5%; | ||
| --accent-foreground: 210 40% 98%; | ||
| --destructive: 0 62.8% 30.6%; | ||
| --destructive-foreground: 210 40% 98%; | ||
| --border: 217.2 32.6% 17.5%; | ||
| --input: 217.2 32.6% 17.5%; | ||
| /* --ring: 36 100% 50%; */ | ||
| --ring: 45 100% 60%; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,11 +5,12 @@ import { Container, ThemeProvider } from '@mui/material'; | |
| import theme from '../theme'; | ||
|
|
||
| import './globals.css'; | ||
| import Navigation from '@/components/Navigation'; | ||
| // import Navigation from '@/components/Navigation'; | ||
| import Header from '@/components/Header'; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: 'Bibimbap', | ||
| description: 'A delicious Korean dish', | ||
| title: 'coduck', | ||
| description: 'coduck~', | ||
|
Contributor
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. 이 부분은 아직 placeholder로 두고 나중에 수정 되는 부분인 거죠?
Contributor
Author
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. 그렇습니다 이름 바꾸고 적절한 수정이 프론트딴에선 안들어가서 일단 임시 확인차..
Contributor
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. 우선은 coduck으로 남겨둬도 괜찮을 것 같긴 해요 다만 {
"name": "bibimbap-frontend",
"version": "0.1.0",
"private": true, |
||
| }; | ||
|
|
||
| export default function RootLayout({ | ||
|
|
@@ -22,8 +23,9 @@ export default function RootLayout({ | |
| <body> | ||
| <AppRouterCacheProvider> | ||
| <ThemeProvider theme={theme}> | ||
| <Container component='main'> | ||
| <Navigation /> | ||
| <Container component='main' maxWidth={false} disableGutters> | ||
| {/* <Navigation /> */} | ||
| <Header /> | ||
| {children} | ||
| </Container> | ||
| </ThemeProvider> | ||
|
|
||
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.
src/app/problems/page.tsx의 41번 라인부터 45번 라인까지 똑같은 css 코드가 있어서, 이런 부분은 나중에 찾아서 공통으로 묶어서 리팩토링 하면 좋을 것 같아요