Skip to content

Commit

Permalink
Add container components
Browse files Browse the repository at this point in the history
  • Loading branch information
testower committed Sep 11, 2023
1 parent e67a48a commit a27bcb4
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
10 changes: 10 additions & 0 deletions client-next/src/components/DetailsViewContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

export function DetailsViewContainer() {
return (
<section style={{
height: '4rem'
}}>
DetailViewContainer
</section>
);
}
11 changes: 11 additions & 0 deletions client-next/src/components/ItineraryListContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

export function ItineraryListContainer() {
return (
<section style={{
width: '12rem',
height: "auto"
}}>
ItineraryListContainer
</section>
);
}
4 changes: 1 addition & 3 deletions client-next/src/components/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ const initialViewState = {
export function MapView() {
return (
<Map
// @ts-ignore // TODO: why TypeScript complaining about this
mapLib={import('maplibre-gl')}
// @ts-ignore // TODO: why TypeScript complaining about this
mapStyle={mapStyle}
initialViewState={initialViewState}
style={{ width: '100%', height: ' calc(100vh - 56px)' }}
style={{ width: '100%', height: 'calc(100vh - 184px)' }}
>
<NavigationControl position="top-left" />
</Map>
Expand Down
16 changes: 7 additions & 9 deletions client-next/src/components/SearchBarContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useTripQuery } from '../hooks/useTripQuery.ts';

export function SearchBarContainer() {
const [data, callback] = useTripQuery();

return (
<>
<button onClick={() => callback()}>Make request</button>
{data && <pre>{JSON.stringify(data.trip.tripPatterns, null, 2)}</pre>}
</>
);
return (
<section style={{
height: '4rem'
}}>
SearchBarContainer
</section>
);
}
9 changes: 8 additions & 1 deletion client-next/src/screens/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import {Stack} from "react-bootstrap";
import { MapView } from '../components/MapView.tsx';
import { NavBarContainer } from '../components/NavBarContainer.tsx';
import { SearchBarContainer } from '../components/SearchBarContainer.tsx';
import {ItineraryListContainer} from "../components/ItineraryListContainer.tsx";
import {DetailsViewContainer} from "../components/DetailsViewContainer.tsx";

export function App() {
return (
<div className="app">
<NavBarContainer />
<SearchBarContainer />
<MapView />
<Stack direction="horizontal" gap={0}>
<ItineraryListContainer />
<MapView />
</Stack>
<DetailsViewContainer />
</div>
);
}

0 comments on commit a27bcb4

Please sign in to comment.