Skip to content

Commit

Permalink
SSDFGHGJH (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictiniX888 committed Nov 4, 2023
1 parent 155a2b7 commit 43388dc
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 20 deletions.
17 changes: 14 additions & 3 deletions apps/dashboard/components/nav/side-nav.tsx
Expand Up @@ -9,6 +9,7 @@ import useHibiscusUser from '../../hooks/use-hibiscus-user/use-hibiscus-user';
import { useMemo } from 'react';
import { HibiscusRole } from '@hibiscus/types';
import { useRouter } from 'next/router';
import { Colors } from '@hacksc/sctw-ui-kit';

// #CEA00C

Expand All @@ -34,7 +35,7 @@ const HeadingContainer = styled.div`
align-items: center;
`;

const ButtonContainer = styled.div`
const ButtonContainer = styled.div<{ hoverColor: string }>`
height: 50px;
margin-bottom: 40px;
display: flex;
Expand All @@ -43,7 +44,7 @@ const ButtonContainer = styled.div`
cursor: pointer;
&:hover {
background-color: #cea00c;
background-color: ${(props) => props.hoverColor};
border-left: 8px solid white;
}
`;
Expand Down Expand Up @@ -120,6 +121,12 @@ function StyledSideNav() {
if (user.role === HibiscusRole.SPONSOR) return SPONSOR_NAVBAR;
return [];
}, [user]);
const hoverColor = useMemo(() => {
if (user == null) return Colors.Yellow.Yuhlow;
if (user.role === HibiscusRole.HACKER) return Colors.Yellow.Yuhlow;
if (user.role === HibiscusRole.SPONSOR) return Colors.Red.Redward;
return Colors.Yellow.Yuhlow;
}, [user]);

return (
<>
Expand All @@ -136,7 +143,11 @@ function StyledSideNav() {
</HeadingContainer>

{items.map((it) => (
<ButtonContainer key={it.label} onClick={() => router.push(it.url)}>
<ButtonContainer
key={it.label}
onClick={() => router.push(it.url)}
hoverColor={hoverColor}
>
<it.icon size={25} />
<ButtonH1> {it.label} </ButtonH1>
</ButtonContainer>
Expand Down
79 changes: 70 additions & 9 deletions apps/dashboard/components/nav/top-nav.tsx
Expand Up @@ -6,6 +6,10 @@ import { BsPersonFill } from 'react-icons/bs';
import { BsCalendarCheck } from 'react-icons/bs';
import { HiOutlineSquares2X2 } from 'react-icons/hi2';
import { useMediaQuery } from 'react-responsive';
import { HibiscusRole } from '@hibiscus/types';
import useHibiscusUser from '../../hooks/use-hibiscus-user/use-hibiscus-user';
import { useMemo } from 'react';
import { useRouter } from 'next/router';

// #CEA00C

Expand Down Expand Up @@ -71,23 +75,80 @@ const SquaresIcon = styled(HiOutlineSquares2X2)`
margin-left: 20px;
`;

const BoothIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 48 48"
style={{ marginLeft: '20px' }}
>
<path
fill="none"
stroke="white"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="4"
d="M4 5h40v8l-1.398.84a7 7 0 0 1-7.203 0L34 13l-1.398.84a7 7 0 0 1-7.203 0L24 13l-1.398.84a7 7 0 0 1-7.204 0L14 13l-1.399.84a7 7 0 0 1-7.202 0L4 13V5Zm2 20h36v18H6zm3-9v9m30-9v9"
/>
</svg>
);

const JUDGE_NAVBAR = [
{ label: 'Events', icon: CalendarIcon, url: '/events' },
{ label: 'Leaderboard', icon: SquaresIcon, url: '/leaderboard' },
// { label: 'Profile', icon: PersonIcon, url: '/profile' },
];

const SPONSOR_NAVBAR = [
{ label: 'My Booth', icon: BoothIcon, url: '/sponsor-booth' },
];

function StyledTopNav() {
// Media query hook
const isSmallScreen = useMediaQuery({ query: '(max-width: 600px)' });

const router = useRouter();

const { user } = useHibiscusUser();
const items = useMemo(() => {
if (user == null) return [];
if (user.role === HibiscusRole.HACKER) return JUDGE_NAVBAR;
if (user.role === HibiscusRole.SPONSOR) return SPONSOR_NAVBAR;
return [];
}, [user]);

return (
<>
{isSmallScreen ? (
<MainWrapper>
<HeadingContainer>
<Image
src={hibiscusIcon}
alt="HackSC Logo"
width={40}
height={40}
/>
<StyledH1> HackSC 2023 </StyledH1>
</HeadingContainer>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
width: '100%',
}}
>
<HeadingContainer>
<Image
src={hibiscusIcon}
alt="HackSC Logo"
width={40}
height={40}
/>
<StyledH1> HackSC 2023 </StyledH1>
</HeadingContainer>
<HeadingContainer style={{ marginRight: '20px' }}>
{items.map((it) => (
<it.icon
size={25}
key={it.label}
onClick={() => router.push(it.url)}
/>
))}
</HeadingContainer>
</div>
</MainWrapper>
) : null}
</>
Expand Down
23 changes: 16 additions & 7 deletions apps/dashboard/layouts/themeless-layout.tsx
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useMemo } from 'react';
import styled from 'styled-components';
import useHibiscusUser from '../hooks/use-hibiscus-user/use-hibiscus-user';
import StyledSideNav from '../components/nav/side-nav';
Expand All @@ -17,27 +17,36 @@ function ThemelessLayout({ children }: ThemelessLayoutProps) {
const isSmallScreen = useMediaQuery({ query: '(max-width: 600px)' });

const { user } = useHibiscusUser();
const color = useMemo(() => {
if (user == null) return Colors.Yellow.ArthurSweater;
if (user.role === HibiscusRole.HACKER) return Colors.Yellow.ArthurSweater;
if (user.role === HibiscusRole.SPONSOR) return Colors.Red.DonatedBlood;
return Colors.Yellow.ArthurSweater;
}, [user]);
const shadowColor = useMemo(() => {
if (user == null) return Colors.Yellow.Yuhlow;
if (user.role === HibiscusRole.HACKER) return Colors.Yellow.Yuhlow;
if (user.role === HibiscusRole.SPONSOR) return Colors.Red.Redward;
return Colors.Yellow.Yuhlow;
}, [user]);

if (user == null) {
return <></>;
}

return isSmallScreen ? (
<VerticalMainPageWrapper>
<VerticalMainPageWrapper style={{ backgroundColor: color }}>
<StyledTopNav />
<VerticalContent>{children}</VerticalContent>
</VerticalMainPageWrapper>
) : (
<MainPageWrapper>
<MainPageWrapper style={{ backgroundColor: color }}>
<StyledSideNav />
<Content>
<RightUtilityContainer>
<UserText>{user.tag}</UserText>
<RoleText>
<GlowSpan
color={Colors.Yellow.ArthurSweater}
shadowColor={Colors.Yellow.Yuhlow}
>
<GlowSpan color={color} shadowColor={shadowColor}>
{user.role}
</GlowSpan>
</RoleText>
Expand Down
3 changes: 3 additions & 0 deletions apps/dashboard/pages/index.tsx
Expand Up @@ -78,6 +78,9 @@ export function Index({
} else if (user.role === HibiscusRole.SPONSOR) {
router.push('/sponsor-booth');
return <></>;
} else if (user.role === HibiscusRole.JUDGE) {
window.location.assign('podium.hacksc.com');
return <></>;
} else if (user.role === HibiscusRole.VOLUNTEER) return <IdentityPortal />;
};

Expand Down
2 changes: 1 addition & 1 deletion apps/podium/pages/index.tsx
Expand Up @@ -523,7 +523,7 @@ const Index = () => {
</div>
<br />
{!allProjects[0] ? (
<p style={{ marginLeft: '8px' }}>Loading...</p>
<p style={{ marginLeft: '8px' }}>Welcome to Podium!</p>
) : (
<></>
)}
Expand Down
4 changes: 4 additions & 0 deletions libs/styles/src/lib/colors.ts
Expand Up @@ -63,5 +63,9 @@ export namespace Colors2023 {
light: YELLOW.LIGHT,
standard: YELLOW.STANDARD,
},
[HibiscusRole.JUDGE]: {
light: BLUE.LIGHT,
standard: BLUE.STANDARD,
},
};
}

7 comments on commit 43388dc

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pointr – ./

pointr.vercel.app
pointr-hacksc.vercel.app
www.hack.sc
pointr-git-main-hacksc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

recruitment – ./

recruitment-git-main-hacksc.vercel.app
recruitment-hacksc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

www-2023 – ./

www-2023-hacksc.vercel.app
www-2023-git-main-hacksc.vercel.app
www-2023.vercel.app
2023.hacksc.com

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

podium – ./

podium-one.vercel.app
podium-hacksc.vercel.app
podium-git-main-hacksc.vercel.app
podium.hacksc.com

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

interim – ./

interim-hacksc.vercel.app
socalhacks.org
interim-git-main-hacksc.vercel.app
www.socalhacks.org

@vercel
Copy link

@vercel vercel bot commented on 43388dc Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sso – ./

sso-git-main-hacksc.vercel.app
sso-hacksc.vercel.app
sso-steel.vercel.app
sso.hacksc.com

Please sign in to comment.