-
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.
Implement layout and improve the first visualization
- Loading branch information
1 parent
25cf69c
commit 4c03bff
Showing
8 changed files
with
788 additions
and
56 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,11 +1,19 @@ | ||
import { useDataQuery } from './hooks/useDataQuery.ts'; | ||
import { DiskVisualization } from './viz/DiskVisualization.tsx'; | ||
import { Box, Grid, Typography } from '@mui/joy'; | ||
|
||
export const Homepage = () => { | ||
const { data } = useDataQuery('geographyDisk'); | ||
return data ? ( | ||
<> | ||
<DiskVisualization data={data.tree} /> | ||
</> | ||
<Box> | ||
<Grid container justifyContent="center"> | ||
<Grid xs={12} sm={10} md={8} lg={7} xl={6}> | ||
<Typography level="h3" color="neutral" textAlign="center" sx={{ mb: 3 }}> | ||
Place of birth | ||
</Typography> | ||
<DiskVisualization data={data.tree} /> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
) : null; | ||
}; |
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,51 @@ | ||
import React from 'react'; | ||
import { Box, Container, CssBaseline, Divider, IconButton, Stack, Tooltip, Typography } from '@mui/joy'; | ||
import { AutoStories, GitHub } from '@mui/icons-material'; | ||
|
||
interface LayoutProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
export const Layout: React.FC<LayoutProps> = ({ children }) => { | ||
const renderDateBuilt = () => { | ||
const timestamp = import.meta.env.BUILD_TIMESTAMP as number | undefined; | ||
const date = new Date(timestamp ?? new Date().getTime()); | ||
return date.toLocaleDateString('en-us', { year: 'numeric', month: 'short', day: 'numeric' }); | ||
}; | ||
return ( | ||
<> | ||
<CssBaseline /> | ||
<Container sx={{ my: 2 }}> | ||
<Stack direction="row" justifyContent="space-between"> | ||
<Stack direction="column" sx={{ mb: 2 }}> | ||
<Stack direction="row" spacing={1} alignItems="center"> | ||
<AutoStories /> | ||
<Typography level="h3" color="neutral"> | ||
Florian Cassayre | ||
</Typography> | ||
</Stack> | ||
<Typography color="neutral">Genealogy and family history</Typography> | ||
</Stack> | ||
<Box> | ||
<Tooltip title="View on GitHub"> | ||
<IconButton | ||
variant="outlined" | ||
component="a" | ||
href="https://github.com/FlorianCassayre/genealogy-visualization" | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
<GitHub /> | ||
</IconButton> | ||
</Tooltip> | ||
</Box> | ||
</Stack> | ||
{children} | ||
<Divider sx={{ my: 2 }} /> | ||
<footer> | ||
<Typography textAlign="center">Date updated: {renderDateBuilt()}</Typography> | ||
</footer> | ||
</Container> | ||
</> | ||
); | ||
}; |
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
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