Skip to content

Commit

Permalink
basic grid layout
Browse files Browse the repository at this point in the history
  • Loading branch information
NishilJ committed Oct 27, 2024
1 parent 5190d85 commit 4cb63da
Show file tree
Hide file tree
Showing 9 changed files with 1,080 additions and 3,117 deletions.
4,042 changes: 1,003 additions & 3,039 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.114",
"@types/react": "^18.3.11",
"@types/node": "^16.18.115",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.tsx

This file was deleted.

20 changes: 20 additions & 0 deletions src/Components/TopNavBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import {Flex, Heading, MenuTrigger, ActionButton, Menu, Item} from '@adobe/react-spectrum';

const TopNavBar: React.FC = () => {
return (
<Flex margin="auto" justifyContent="space-between" alignItems="center" width="95%" height="100%">
<Heading level={1}>Metroll</Heading>
<MenuTrigger>
<ActionButton></ActionButton>
<Menu onAction={(key) => alert(key)}>
<Item key="auth">Login/Sign In</Item>
<Item key="home">Home</Item>
<Item key="about">About</Item>
</Menu>
</MenuTrigger>
</Flex>
);
}

export default TopNavBar;
17 changes: 17 additions & 0 deletions src/Components/TransitBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import {Flex, Heading, MenuTrigger, ActionButton, Menu, Item, ActionGroup} from '@adobe/react-spectrum';

const TransitBar: React.FC = () => {
return (
<Flex margin="auto" alignItems="center" justifyContent="center" height="100%">
<ActionGroup selectionMode="single" width="fit-content" defaultSelectedKeys={['planner']}>
<Item key="departures">Departures</Item>
<Item key="planner">Trip Planner</Item>
<Item key="routes">Routes</Item>
</ActionGroup>

</Flex>
);
}

export default TransitBar;
35 changes: 35 additions & 0 deletions src/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import TopNavBar from './Components/TopNavBar';
import {Provider, defaultTheme, Grid, View} from "@adobe/react-spectrum";
import TransitBar from "./Components/TransitBar";

function Home() {
return (
<Provider theme={defaultTheme}>
<Grid
areas={[
'header header',
'subheader subheader',
'sidebar content',
'footer footer'
]}
columns={['1fr', '2fr']}
rows={['size-1000', "size-1000", '1fr', 'size-1000']}
height="100vh"
gap="size-0"
>
<View colorVersion={6} borderWidth="thin" backgroundColor="orange-500" gridArea="header">
<TopNavBar />
</View>
<View colorVersion={6} borderWidth="thin" backgroundColor="orange-500" gridArea="subheader">
<TransitBar />
</View>
<View colorVersion={6} borderWidth="thin" backgroundColor="orange-500" gridArea="sidebar" />
<View colorVersion={6} borderWidth="thin" backgroundColor="orange-500" gridArea="content" />
<View colorVersion={6} borderWidth="thin" backgroundColor="orange-500" gridArea="footer" />
</Grid>
</Provider>
);
}

export default Home;
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import Home from './Home';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
<Home />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
Expand Down

0 comments on commit 4cb63da

Please sign in to comment.