-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/spectator UI #412
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
Feature/spectator UI #412
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { Button } from '@hcc/ui'; | ||
|
|
||
| interface TabNavigationProps { | ||
| activeTab: string; | ||
| onTabClick: (tabID: string) => void; | ||
| } | ||
|
|
||
| export const TabNavigation = ({ activeTab, onTabClick }: TabNavigationProps) => { | ||
| const tabs = [ | ||
| { id: 'previous', label: 'μ΄μ λν' }, | ||
| { id: 'recent', label: 'μ΅κ·Ό λν' }, | ||
| { id: 'teams', label: 'νλ³ λ³΄κΈ°' }, | ||
| ]; | ||
|
Comment on lines
+9
to
+13
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.
|
||
|
|
||
| return ( | ||
| <div className="w-full border-gray-200 border-b bg-white pt-5"> | ||
| <div className="flex justify-center"> | ||
| <div role="tablist" aria-label="λν ν" className="flex gap-8"> | ||
| {tabs.map(tab => ( | ||
| <Button | ||
| key={tab.id} | ||
| role="tab" | ||
| aria-selected={activeTab === tab.id} | ||
| className={`-mb-px relative border-b-2 px-4 pb-4 font-medium transition-all duration-150 ease-out ${ | ||
| activeTab === tab.id | ||
| ? 'border-neutral-900 text-neutral-900' | ||
| : 'border-transparent text-neutral-500 hover:border-neutral-300 hover:text-neutral-700' | ||
| }`} | ||
| variant="subtle" | ||
| onClick={() => onTabClick(tab.id)} | ||
| > | ||
| {tab.label} | ||
| </Button> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||
| 'use client'; | ||||||
| import { TabNavigation } from '~/app/landingpage/_components/TabNavigation'; | ||||||
| import { useState } from 'react'; | ||||||
|
|
||||||
| const Page = () => { | ||||||
| const [activeTab, setActiveTab] = useState('recent'); | ||||||
|
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.
import { TabNavigation, type TabId } from '~/app/landingpage/_components/TabNavigation';
Suggested change
|
||||||
| return ( | ||||||
| <> | ||||||
| <TabNavigation activeTab={activeTab} onTabClick={setActiveTab} /> | ||||||
| {/**λ΄μ©* - ν΄λ¦ν tabμ λν λ΄μ© λλλ§*/} | ||||||
| </> | ||||||
| ); | ||||||
| }; | ||||||
| export default Page; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| const Page = () => { | ||
| return <div>Home</div>; | ||
| return <div />; | ||
| }; | ||
|
|
||
| export default Page; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
activeTabκ³ΌonTabClickμtabIDμstringνμ μ μ¬μ©νλ λμ , λ μ격ν μ λμ¨ νμTabIdλ₯Ό μ¬μ©νλ κ²μ΄ μ’μ΅λλ€. μ΄λ κ² νλ©΄ νμ μμ μ±μ λμΌ μ μμ΅λλ€.TabIdλ μ»΄ν¬λνΈ νμΌ μλ¨μ λ€μκ³Ό κ°μ΄ μ μνκ³exportνμ¬ λΆλͺ¨ μ»΄ν¬λνΈμμλ μ¬μ©ν μ μμ΅λλ€.