create h2 separator component
This commit is contained in:
parent
779747a405
commit
c8beb23dbd
44
src/components/h2-separator.js
Normal file
44
src/components/h2-separator.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { Box, Typography } from "@mui/material"
|
||||||
|
import React from "react"
|
||||||
|
|
||||||
|
const TerminalDiamond = ({ right }) => (
|
||||||
|
<Box position="relative">
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: 5,
|
||||||
|
height: 5,
|
||||||
|
bgcolor: "primary.main",
|
||||||
|
transform: "rotate(45deg)",
|
||||||
|
position: "absolute",
|
||||||
|
top: -3,
|
||||||
|
left: right ? "inherit" : -3,
|
||||||
|
right: right ? -3 : "inherit",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
|
||||||
|
const H2Separator = ({ title }) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box display="flex">
|
||||||
|
<Box width={80} borderTop={1}>
|
||||||
|
<TerminalDiamond />
|
||||||
|
</Box>
|
||||||
|
<Box py={1.5} px={1} border={1} borderTop={0}>
|
||||||
|
<Typography
|
||||||
|
variant="h1"
|
||||||
|
component="h2"
|
||||||
|
sx={{ textTransform: "uppercase" }}
|
||||||
|
>
|
||||||
|
{title}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Box flexGrow={1} borderTop={1}>
|
||||||
|
<TerminalDiamond right />
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default H2Separator
|
@ -6,6 +6,7 @@ import Layout from "../components/layout"
|
|||||||
import Seo from "../components/seo"
|
import Seo from "../components/seo"
|
||||||
import { Box, Button, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Stack, Typography } from "@mui/material"
|
import { Box, Button, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, Stack, Typography } from "@mui/material"
|
||||||
import EastIcon from '@mui/icons-material/East'
|
import EastIcon from '@mui/icons-material/East'
|
||||||
|
import H2Separator from "../components/h2-separator"
|
||||||
|
|
||||||
const serviceMenu = [
|
const serviceMenu = [
|
||||||
{ label: "Support", path: "/" },
|
{ label: "Support", path: "/" },
|
||||||
@ -40,13 +41,15 @@ const BlogIndex = ({ data, location }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout location={location} title={siteTitle}>
|
<Layout location={location} title={siteTitle}>
|
||||||
<Typography
|
<Box py={4}>
|
||||||
variant="h1"
|
<Typography
|
||||||
sx={{ fontWeight: 400, fontSize: 44, lineHeight: "40px" }}
|
variant="h1"
|
||||||
>
|
sx={{ fontWeight: 400, fontSize: 44, lineHeight: "40px" }}
|
||||||
Autonomic is a co-operative that is owned and run by its workers
|
>
|
||||||
</Typography>
|
Autonomic is a co-operative that is owned and run by its workers
|
||||||
<Typography variant="h1" component="h2" sx={{textTransform: "uppercase"}}>What we offer</Typography>
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<H2Separator title="What we offer" />
|
||||||
<List>
|
<List>
|
||||||
{serviceMenu.map(({ label, path }) => (
|
{serviceMenu.map(({ label, path }) => (
|
||||||
<ListItem key={label}>
|
<ListItem key={label}>
|
||||||
|
Loading…
Reference in New Issue
Block a user