Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions TripPlanner - Project/TripPlannerFrontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
rel="icon"
href="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/271/nerd-face_1f913.png"
/>
<link
href="https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/>
<title>Vite App</title>
</head>
<body>
Expand Down
5,144 changes: 5,144 additions & 0 deletions TripPlanner - Project/TripPlannerFrontend/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion TripPlanner - Project/TripPlannerFrontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"pre-commit": "^1.2.2",
"prettier": "^2.0.5",
"prettier": "2.2.1",
"typescript": "^4.1.2",
"vite": "^2.0.1"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';

export default function Logo() {
return <img src="../public/TripPlannerLogo.png" alt="TripPlanner"></img>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface DefaultLayoutProps extends React.ComponentProps<typeof Composition> {
}

export const DefaultLayout = ({ children, ...props }: DefaultLayoutProps) => (
<Composition maxWidth="640px" paddingHorizontalTabletDown={1} {...props}>
<Composition width="100%" paddingHorizontalTabletDown={1} {...props}>
{children}
</Composition>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React, { useState } from 'react';
import { DefaultLayout } from './DefaultLayout';
import styled from 'styled-components';
import Logo from '../Branding/Logo';

const testUser = {
isLogged: false,
name: 'Bill',
surname: 'Gates',
};

export const Header = () => {
const [user, setUser] = useState(testUser);

const toggleIsUserLogged = () => {
setUser((prevState) => ({
...prevState,
isLogged: !prevState.isLogged,
}));
};

const Header = styled.div`
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
& > h3 {
padding-left: 1rem;
font-family: Work Sans, sans-serif;
font-style: normal;
font-weight: 600;
font-size: 17.4703px;
line-height: 20px;
letter-spacing: -0.03em;
}
`;

const Nav = styled.ul`
width: 50%;
display: flex;
list-style-type: none;
justify-content: flex-end;
font-family: Work Sans, sans-serif;
font-style: normal;
font-weight: 500;
font-size: 13px;
line-height: 15px;
color: #919191;
`;

const MenuList = styled.li`
padding-right: 1rem;
`;

return (
<DefaultLayout onClick={toggleIsUserLogged} style={{ padding: '0' }}>
<Header>
<Logo></Logo>
<Nav>
<MenuList>Explore</MenuList>
{user.isLogged ? (
<MenuList>
Hello, {user.name} {user.surname}
</MenuList>
) : (
<MenuList>Create account</MenuList>
)}
</Nav>
</Header>
</DefaultLayout>
);
};
3 changes: 2 additions & 1 deletion TripPlanner - Project/TripPlannerFrontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
import Layout from 'atomic-layout';
import { Provider } from 'react-redux';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { Header } from '../src/components/Layout/Header';

Layout.configure({
defaultUnit: 'rem',
Expand All @@ -28,7 +29,7 @@ import { routes } from './routes';
ReactDOM.render(
<React.StrictMode>
<GlobalStyle />

<Header />
<Provider store={store}>
<Router>
<Switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Home = () => {
}, 1000);

return (
<DefaultLayout gapRow={3} marginVertical={5} marginHorizontal="auto">
<DefaultLayout gapRow={3} marginHorizontal="auto">
<Typography.Heading as="h1">Hi, what's up?</Typography.Heading>

<Typography.Subheading as="h2">
Expand Down
2 changes: 1 addition & 1 deletion TripPlanner - Project/TripPlannerFrontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3084,7 +3084,7 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==

prettier@^2.0.5:
prettier@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
Expand Down