Skip to content

Commit

Permalink
NYC -> SFO 2023-03-18
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmand3l committed Mar 19, 2023
1 parent 7034961 commit 015b9c4
Show file tree
Hide file tree
Showing 425 changed files with 6,936 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "delta-inflight",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-regular-svg-icons": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/icons-material": "^5.11.11",
"@mui/material": "^5.11.13",
"date-fns": "^2.29.3",
"lodash": "^4.17.21",
"match-sorter": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.9.0",
"recoil": "^0.7.7",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.15.3",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"stylus": "^0.59.0",
"typescript": "^4.9.3",
"vite": "^4.2.0"
}
}
17 changes: 17 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useState } from 'react'
import { RecoilRoot } from 'recoil';
import Layout from './Layout';

function App() {
// global hooks here

return (
<Layout />
)
}

export default () => (
<RecoilRoot>
<App />
</RecoilRoot>
);
4 changes: 4 additions & 0 deletions src/Layout/Layout.module.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Layout
width 100%
height 100%
display flex
20 changes: 20 additions & 0 deletions src/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import RoutePortal from './RoutePortal';
import styles from './Layout.module.styl';
import Sidebar from './Sidebar';

interface LayoutProps extends React.ComponentPropsWithoutRef<'div'> {
children?: React.ReactNode
};

const Layout = (props: LayoutProps) => {
const {children, ...rest} = props;
return (
<div className={styles.Layout} {...rest}>
<Sidebar />
<RoutePortal />
</div>
);
};

export default Layout;
24 changes: 24 additions & 0 deletions src/Layout/RoutePortal/Header/Header.module.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.Header
position absolute
top 0px
left 0px
width 100%
display: flex
align-items: center
justify-content: space-between
color rgba(199, 199, 199, 0.649)
font-size: 16pt
font-weight: medium
padding 32px 80px
padding-bottom: 0;

.leftStuff
display flex
align-items: center
gap 12px

.flightTrackerLink
color: rgb(2, 100, 227)
font-weight: bold
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
cursor: pointer
26 changes: 26 additions & 0 deletions src/Layout/RoutePortal/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import styles from './Header.module.styl';
import AccessTimeIcon from '@mui/icons-material/AccessTime';
import SettingsIcon from '@mui/icons-material/Settings';

interface HeaderProps extends React.ComponentPropsWithoutRef<'div'> {
};

const Header = (props: HeaderProps) => {
const {...rest} = props;
return (
<div className={styles.Header} {...rest}>
<div className={styles.leftStuff}>
<AccessTimeIcon />
4h 31m Until Arrival
<div className={styles.flightTrackerLink}>
Flight Tracker
</div>
</div>

<SettingsIcon fontSize='large'/>
</div>
);
};

export default Header;
1 change: 1 addition & 0 deletions src/Layout/RoutePortal/Header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Header';
5 changes: 5 additions & 0 deletions src/Layout/RoutePortal/RoutePortal.module.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.RoutePortal
background-color: rgb(18, 53, 86);
flex: 1
position relative
overflow hidden
39 changes: 39 additions & 0 deletions src/Layout/RoutePortal/RoutePortal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import styles from './RoutePortal.module.styl';
import Header from './Header';
import { useRecoilValue } from 'recoil';
import { routeAtom } from '~/store';
import TopPicks from '~/routes/TopPicks';
import Movies from '~/routes/Movies';
import Shows from '~/routes/Shows';
import Music from '~/routes/Music';

interface RoutePortalProps extends React.ComponentPropsWithoutRef<'div'> {
};

const getRouteComponent = (route: string): React.ComponentType => {
switch (route) {
case 'Top Picks': return TopPicks;
case 'Movies': return Movies;
case 'Series': return Shows;
case 'Spotify Audio': return Music;
}

return TopPicks;
};

const RoutePortal = (props: RoutePortalProps) => {
const currentRoute = useRecoilValue(routeAtom);

const RouteComponent = getRouteComponent(currentRoute);

const {children, ...rest} = props;
return (
<div className={styles.RoutePortal} {...rest}>
<Header />
<RouteComponent />
</div>
);
};

export default RoutePortal;
1 change: 1 addition & 0 deletions src/Layout/RoutePortal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './RoutePortal';
13 changes: 13 additions & 0 deletions src/Layout/Sidebar/NavLink/NavLink.module.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.NavLink
border-bottom 1px solid rgba(0, 0, 0, 0.5)
opacity: 0.6
display flex
align-items: center
padding 20px 0px 20px 50px
font-weight: bold
font-size: 16pt
cursor pointer

&.active
background-color: rgb(2, 12, 29);
color: rgb(2, 100, 227)
40 changes: 40 additions & 0 deletions src/Layout/Sidebar/NavLink/NavLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import styles from './NavLink.module.styl';
import { linkTappedAtom, routeAtom, showMoreAtom } from '~/store';
import { useRecoilState, useSetRecoilState } from 'recoil';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';

interface NavLinkProps extends React.ComponentPropsWithoutRef<'div'> {
route: string;
};

const NavLink = (props: NavLinkProps) => {
const {route, ...rest} = props;
const [currentRoute, setCurrentRoute] = useRecoilState(routeAtom);
const [currentLink, setCurrentLink] = useRecoilState(linkTappedAtom);
const [showMore, setShowMore] = useRecoilState(showMoreAtom);

const handleClick = () => {
if (route === 'More') {
setShowMore(!showMore);
} else {
setCurrentRoute(route);
}

setCurrentLink(route);
}

return (
<div className={`${styles.NavLink} ${route === currentLink ? styles.active : ''}`} onClick={handleClick} {...rest}>
{ route }
{ route === 'More' ? showMore ? (
<KeyboardArrowUpIcon fontSize='large' />
) : (
<KeyboardArrowDownIcon fontSize='large' />
) : null }
</div>
);
};

export default NavLink;
1 change: 1 addition & 0 deletions src/Layout/Sidebar/NavLink/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './NavLink';
25 changes: 25 additions & 0 deletions src/Layout/Sidebar/Sidebar.module.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.Sidebar
width 232px
padding-top: 120px
position: relative
flex none

.logo
width 100px
position: absolute
top -10px
left 99px

.search
position absolute
left: 50px
bottom: 50px
display: flex
align-items: center
gap 15px
font-size 16pt

.searchicon
font-size 22pt
display flex
align-items: center
35 changes: 35 additions & 0 deletions src/Layout/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import logo from '~/assets/deltalogo.png';
import NavLink from './NavLink';
import SearchIcon from '@mui/icons-material/Search';
import styles from './Sidebar.module.styl';

interface SidebarProps extends React.ComponentPropsWithoutRef<'div'> {
};

const Sidebar = (props: SidebarProps) => {
const {children, ...rest} = props;
return (
<div className={styles.Sidebar}>
<img className={styles.logo} src={logo} />
<div className={styles.navlinks}>
<NavLink route="Top Picks" />
<NavLink route="Movies" />
<NavLink route="Series" />
<NavLink route="Spotify Audio" />
<NavLink route="My Flight" />
<NavLink route="About Delta" />
<NavLink route="Food & Drink" />
<NavLink route="More" />
</div>
<div className={styles.search}>
Search
<span className={styles.searchicon}>
<SearchIcon fontSize='inherit'/>
</span>
</div>
</div>
);
};

export default Sidebar;
1 change: 1 addition & 0 deletions src/Layout/Sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Sidebar';
1 change: 1 addition & 0 deletions src/Layout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Layout';
Binary file added src/assets/deltalogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/deltastudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 015b9c4

Please sign in to comment.