-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 Implement pitch, team dashboard in tab pane, sort by team size
- Loading branch information
1 parent
b040fd4
commit 4817550
Showing
22 changed files
with
444 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap' | ||
import classnames from 'classnames' | ||
import Link from 'next/link' | ||
import { useState } from 'react' | ||
import AuthenticatedCompetition from './authenticated/Competition' | ||
import { useConvexAuth } from 'convex/react' | ||
|
||
export default function CompetitionNavbar(props: any) { | ||
const [activeTab, setActiveTab] = useState(props.tabId) | ||
|
||
const { isAuthenticated } = useConvexAuth() | ||
|
||
const toggle = (tab: number) => { | ||
if (activeTab !== tab) setActiveTab(tab) | ||
} | ||
return ( | ||
<div className="mt-3"> | ||
{isAuthenticated ? <AuthenticatedCompetition {...props} /> : null} | ||
<Nav tabs> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 1 })} | ||
tag={Link} | ||
href={`/competitions/${props.id}`} | ||
onClick={() => { | ||
toggle(1) | ||
}} | ||
style={{ cursor: 'pointer' }} | ||
> | ||
Overview | ||
</NavLink> | ||
</NavItem> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 2 })} | ||
tag={Link} | ||
href={`/competitions/${props.id}/rules`} | ||
onClick={() => { | ||
toggle(2) | ||
}} | ||
style={{ cursor: 'pointer' }} | ||
> | ||
Rules & Rubric | ||
</NavLink> | ||
</NavItem> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 3 })} | ||
tag={Link} | ||
href={`/competitions/${props.id}/prizes`} | ||
onClick={() => { | ||
toggle(3) | ||
}} | ||
style={{ cursor: 'pointer' }} | ||
> | ||
Prizes | ||
</NavLink> | ||
</NavItem> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 4 })} | ||
tag={Link} | ||
href={`/competitions/${props.id}/teams`} | ||
onClick={() => { | ||
toggle(4) | ||
}} | ||
style={{ cursor: 'pointer' }} | ||
> | ||
Find Teammates | ||
</NavLink> | ||
</NavItem> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 5 })} | ||
tag={Link} | ||
href={`/competitions/${props.id}/gallery`} | ||
onClick={() => { | ||
toggle(5) | ||
}} | ||
style={{ cursor: 'pointer' }} | ||
> | ||
Music Gallery | ||
</NavLink> | ||
</NavItem> | ||
<NavItem> | ||
<NavLink | ||
className={classnames({ active: activeTab === 6 })} | ||
onClick={() => { | ||
toggle(6) | ||
}} | ||
tag={Link} | ||
href={`/competitions/${props.id}/team`} | ||
> | ||
My Team | ||
</NavLink> | ||
</NavItem> | ||
</Nav> | ||
<TabContent activeTab={activeTab}> | ||
<TabPane tabId={props.tabId}>{props.children}</TabPane> | ||
</TabContent> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function UserInvites() { | ||
return ( | ||
<> | ||
<h1>Invites</h1> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.