Compare commits

...

5 Commits

Author SHA1 Message Date
desmukh
4c347be679 fix footer content 2023-01-09 09:43:39 +05:00
desmukh
a2c3602641 rename homepage file 2023-01-09 01:19:24 +05:00
desmukh
796826aecc home: make core values buttons layout responsive 2023-01-09 01:00:56 +05:00
desmukh
1565b1cf4a layout: show navmenu in drawer on mobile 2023-01-09 00:57:24 +05:00
desmukh
5dd356f4db layout: hide nav menu and display hamburger 2023-01-09 00:34:10 +05:00
3 changed files with 55 additions and 20 deletions

View File

@ -44,7 +44,7 @@ const ConnectWithUs = () => (
const connectLinks = [ const connectLinks = [
{ label: "RSS feed", url: "/" }, { label: "RSS feed", url: "/" },
{ label: "Fedivers", url: "/" }, { label: "Fediverse", url: "/" },
{ label: "Gitea", url: "/" }, { label: "Gitea", url: "/" },
{ label: "Matrix", url: "/" }, { label: "Matrix", url: "/" },
] ]
@ -107,7 +107,13 @@ const Footer = () => (
<ConnectWithUs /> <ConnectWithUs />
<Stack direction="row" spacing={2}> <Stack direction="row" spacing={2}>
{connectLinks.map(({ label, url }) => ( {connectLinks.map(({ label, url }) => (
<Link key={label} href={url} target="_blank" fontSize={10}> <Link
key={label}
href={url}
target="_blank"
fontSize={10}
textTransform="lowercase"
>
{label} {label}
</Link> </Link>
))} ))}

View File

@ -1,10 +1,12 @@
import * as React from "react" import React, { useState } from "react"
import { Link as GatsbyLink } from "gatsby" import { Link as GatsbyLink } from "gatsby"
import { AppBar, Box, Container, CssBaseline, Grid, Link, ThemeProvider, Toolbar } from "@mui/material" import { AppBar, Box, Container, CssBaseline, Drawer, Grid, IconButton, Link, ThemeProvider, Toolbar } from "@mui/material"
import NavMenu from "./nav-menu" import NavMenu from "./nav-menu"
import theme from "./theme" import theme from "./theme"
import Footer from "./footer" import Footer from "./footer"
import flower from "../images/flower.png" import flower from "../images/flower.png"
import MenuIcon from "@mui/icons-material/Menu"
import CloseIcon from "@mui/icons-material/Close"
const Layout = ({ location, title, children, noHeader }) => { const Layout = ({ location, title, children, noHeader }) => {
// const rootPath = `${__PATH_PREFIX__}/` // const rootPath = `${__PATH_PREFIX__}/`
@ -25,18 +27,22 @@ const Layout = ({ location, title, children, noHeader }) => {
// ) // )
// } // }
const [showDrawer, setShowDrawer] = useState(false)
return ( return (
<> <>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<CssBaseline /> <CssBaseline />
{!noHeader && ( <AppBar
<AppBar component="header"
component="header" color="transparent"
color="transparent" position="relative"
position="relative" elevation={0}
elevation={0} >
<Toolbar
sx={{ justifyContent: noHeader ? "flex-end" : "space-between" }}
> >
<Toolbar> {!noHeader && (
<Link <Link
underline="hover" underline="hover"
component={GatsbyLink} component={GatsbyLink}
@ -45,13 +51,22 @@ const Layout = ({ location, title, children, noHeader }) => {
> >
{title} {title}
</Link> </Link>
</Toolbar> )}
</AppBar> <IconButton
)} color="primary"
sx={{ display: { xs: "inline-flex", md: "none" } }}
onClick={() => setShowDrawer(!showDrawer)}
>
<MenuIcon />
</IconButton>
</Toolbar>
</AppBar>
<Container maxWidth="lg" sx={{ py: 8 }}> <Container maxWidth="lg" sx={{ py: 8 }}>
<Grid container spacing={2}> <Grid container spacing={2}>
<Grid item xs={12} md={2}> <Grid item xs={false} md={2}>
<NavMenu location={location} /> <Box display={{ xs: "none", md: "block" }}>
<NavMenu location={location} />
</Box>
</Grid> </Grid>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<main>{children}</main> <main>{children}</main>
@ -74,6 +89,20 @@ const Layout = ({ location, title, children, noHeader }) => {
</Grid> </Grid>
</Container> </Container>
<Footer /> <Footer />
<Drawer
anchor="right"
open={showDrawer}
onClose={() => setShowDrawer(false)}
>
<Box minWidth={240}>
<Box display="flex" justifyContent="flex-end" height={56} pr={2}>
<IconButton color="primary" onClick={() => setShowDrawer(false)}>
<CloseIcon />
</IconButton>
</Box>
<NavMenu location={location} />
</Box>
</Drawer>
</ThemeProvider> </ThemeProvider>
</> </>
) )

View File

@ -4,7 +4,7 @@ import { Link as GatsbyLink, graphql } from "gatsby"
import Bio from "../components/bio" import Bio from "../components/bio"
import Layout from "../components/layout" import Layout from "../components/layout"
import Seo from "../components/seo" import Seo from "../components/seo"
import { Box, Button, Link, List, ListItem, ListItemIcon, ListItemText, Stack, SvgIcon, Typography } from "@mui/material" import { Box, Button, Link, List, ListItem, ListItemIcon, ListItemText, Stack, Typography } from "@mui/material"
import EastIcon from '@mui/icons-material/East' import EastIcon from '@mui/icons-material/East'
import { H1Separator, H2Separator } from "../components/heading-separators" import { H1Separator, H2Separator } from "../components/heading-separators"
import LeafIcon from "../components/leaf-icon" import LeafIcon from "../components/leaf-icon"
@ -23,7 +23,7 @@ const coreValues = [
{ label: "Transparency", path: "/"}, { label: "Transparency", path: "/"},
] ]
const BlogIndex = ({ data, location }) => { const HomePage = ({ data, location }) => {
const siteTitle = data.site.siteMetadata?.title || `Title` const siteTitle = data.site.siteMetadata?.title || `Title`
const posts = data.allMarkdownRemark.nodes const posts = data.allMarkdownRemark.nodes
@ -81,7 +81,7 @@ const BlogIndex = ({ data, location }) => {
positive impact on the world. All of our services reflect our commitment positive impact on the world. All of our services reflect our commitment
to our core values: to our core values:
</Typography> </Typography>
<Stack direction="row"> <Stack direction={{ xs: "column", md: "row" }}>
{coreValues.map(({ label, path }) => ( {coreValues.map(({ label, path }) => (
<Button <Button
component={GatsbyLink} component={GatsbyLink}
@ -126,7 +126,7 @@ const BlogIndex = ({ data, location }) => {
) )
} }
export default BlogIndex export default HomePage
/** /**
* Head export to define metadata for the page * Head export to define metadata for the page