generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: align UI with wireframes (#43)
- Loading branch information
Showing
14 changed files
with
1,160 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ jobs: | |
steps: | ||
- uses: bcgov-nr/[email protected] | ||
with: | ||
keep_versions: 50 | ||
package: ${{ matrix.package }} | ||
tag: ${{ github.event.number }} | ||
tag_fallback: latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import Box from '@mui/material/Box' | ||
import Grid from '@mui/material/Grid' | ||
import Header from '@/components/Header' | ||
import Footer from '@/components/Footer' | ||
import AppRoutes from '@/routes' | ||
import { BrowserRouter } from 'react-router-dom' | ||
import LeftDrawer from '@/components/LeftDrawer' | ||
import { Stack } from '@mui/system' | ||
import { useDispatch } from 'react-redux' | ||
import { useDispatch, useSelector } from 'react-redux' | ||
import { fetchOMRRData } from '@/features/omrr/omrr-slice' | ||
import { useEffect } from 'react' | ||
import apiService from '@/service/api-service' | ||
import { AxiosResponse } from '~/axios' | ||
|
||
const styles = { | ||
container: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
minHeight: '100vh', | ||
}, | ||
content: { | ||
flexGrow: 1, | ||
marginTop: '5em', | ||
marginRight: '1em', | ||
marginLeft: '1em', | ||
marginBottom: '5em', | ||
height: '100%', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'flex-start', | ||
}, | ||
} | ||
|
||
import { RootState } from '@/app/store' | ||
import CircularProgress from '@mui/material/CircularProgress' | ||
import Snackbar from '@mui/material/Snackbar' | ||
import Alert from '@mui/material/Alert' | ||
import L from 'leaflet' | ||
import 'leaflet/dist/leaflet.css' // Import Leaflet CSS | ||
export default function App() { | ||
const status: string = useSelector((state: RootState) => state.omrr.status) | ||
const dispatch = useDispatch() | ||
useEffect(() => { | ||
//@ts-expect-error | ||
dispatch(fetchOMRRData()) | ||
}, [dispatch]) | ||
return ( | ||
<Box sx={styles.container}> | ||
<Header /> | ||
<BrowserRouter> | ||
<Stack direction="row" spacing={2} sx={{ margin: '5em' }}> | ||
<LeftDrawer /> | ||
<AppRoutes /> | ||
</Stack> | ||
</BrowserRouter> | ||
<Footer /> | ||
</Box> | ||
<Grid container spacing={0}> | ||
<Grid item xs={12}> | ||
<Header /> | ||
</Grid> | ||
<Grid item style={{ flexGrow: 1, minHeight:'93vh' }} xs={12}> | ||
{status === 'loading' ? ( | ||
<CircularProgress /> | ||
) : status === 'failed' ? ( | ||
<Snackbar | ||
message="Loading Failed, Please try later refreshing the page" | ||
sx={{ background: '#fffffff', backgroundColor: '#fffffff' }} | ||
color="error" | ||
anchorOrigin={{ vertical: 'top', horizontal: 'right' }} | ||
autoHideDuration={6000} | ||
draggable | ||
open={true} | ||
></Snackbar> | ||
) : ( | ||
<BrowserRouter> | ||
<AppRoutes /> | ||
</BrowserRouter> | ||
)} | ||
</Grid> | ||
<Grid item xs={12}> | ||
<Footer /> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import React from 'react' | ||
import { useLocation } from 'react-router-dom' | ||
import { Button, Card, Grid, Stack,Chip } from '@mui/material' | ||
import { MapContainer, Marker, TileLayer } from 'react-leaflet' | ||
import { useNavigate } from 'react-router' | ||
import L, { LatLngLiteral } from 'leaflet' | ||
// @ts-ignore | ||
import pin from '../assets/marker-icon-2x-red.png' | ||
// @ts-ignore | ||
import shadow from '../assets/marker-shadow.png' | ||
|
||
export default function AuthorizationDetails() { | ||
//define red icon | ||
const redIcon = new L.Icon({ | ||
//read from assets | ||
iconUrl: pin, | ||
shadowUrl: shadow, | ||
iconSize: [25, 41], | ||
iconAnchor: [12, 41], | ||
popupAnchor: [1, -34], | ||
shadowSize: [41, 41], | ||
}) | ||
const navigate = useNavigate() | ||
const buttonClicked = (route: any) => { | ||
navigate(route) // reset the state | ||
} | ||
const location = useLocation() | ||
const data = location?.state?.data | ||
const facilityLocation: LatLngLiteral = { lat: data.Latitude, lng: data.Longitude } | ||
return ( | ||
|
||
<Grid container spacing={1} sx={{marginTop:'6em', marginLeft:'2em', maxWidth:'95%' }}> | ||
<Grid item xs={3} sm={6} md={12}> | ||
<Button sx={{ | ||
background: '#8D8D8D', | ||
padding: '8px 16px', | ||
borderRadius: '6px;', | ||
color:'#000000', | ||
textTransform: 'none', | ||
}} onClick={() => buttonClicked('/search')}>Back To Search</Button> | ||
</Grid> | ||
<Grid item xs={3} sm={6} md={12} > | ||
<Stack direction="row" justifyContent="space-between"> | ||
<span style={{ | ||
color:'#000000', | ||
fontFamily: 'BC Sans', | ||
fontStyle: 'bold', | ||
fontSize: '2em', | ||
lineHeight: '3em', | ||
}}>{data['Regulated Party']}</span> | ||
</Stack> | ||
<Grid container direction="row" spacing={1}> | ||
<Grid item xs={3}> | ||
<span style={{ | ||
color: '#000000', | ||
fontFamily: 'BC Sans', | ||
fontStyle: 'normal', | ||
fontWeight: 'bold', | ||
fontSize: '1em', | ||
lineHeight: '1em', | ||
}}>Authorization Status</span> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span style={{ | ||
color: '#000000', | ||
fontFamily: 'BC Sans', | ||
fontStyle: 'normal', | ||
fontWeight: 'bold', | ||
fontSize: '1em', | ||
lineHeight: '1em', | ||
}}>Authorization Number</span> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span style={{ | ||
color: '#000000', | ||
fontFamily: 'BC Sans', | ||
fontStyle: 'normal', | ||
fontWeight: 'bold', | ||
fontSize: '1em', | ||
lineHeight: '1em', | ||
}}>Effective/Issue Date</span> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span style={{ | ||
color: '#000000', | ||
fontFamily: 'BC Sans', | ||
fontStyle: 'normal', | ||
fontWeight: 'bold', | ||
fontSize: '1em', | ||
lineHeight: '1em', | ||
}}>Last Amendment Date</span> | ||
</Grid> | ||
</Grid> | ||
<Grid container direction="row" spacing={1}> | ||
<Grid item xs={3}> | ||
<Chip | ||
sx={{ | ||
background: | ||
data['Authorization Status'] === 'Active' | ||
? '#353433' | ||
: '#605E5C', | ||
color: '#ffffff', | ||
}} | ||
label={data['Authorization Status']} | ||
/> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span>{data['Authorization Number']}</span> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span>{data['Effective/Issue Date']}</span> | ||
</Grid> | ||
<Grid item xs={3}> | ||
<span>{data['Last Amendment Date']}</span> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
<Grid item xs={12} sx={{marginTop:'2em'}}> | ||
<MapContainer | ||
id="map" | ||
center={facilityLocation} | ||
scrollWheelZoom={false} | ||
zoom={12} | ||
style={{ height: '60em' }} | ||
className="map-container" | ||
> | ||
<TileLayer | ||
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
/> | ||
<Marker key={data['Authorization Number']} position={facilityLocation} icon={redIcon} /> | ||
</MapContainer> | ||
</Grid> | ||
<Grid item xs={4}> | ||
<Card>{/* Content of the third card */}</Card> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |
Oops, something went wrong.