Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | import { Container, styled } from "@mui/material";
import { DASHBOARD } from "i18n/namespaces";
import { useTranslation } from "next-i18next";
import HeroButton from "./HeroButton";
import HeroImage from "./HeroImage";
import HeroImageAttribution from "./HeroImageAttribution";
import HeroLinks from "./HeroLinks";
import HeroSearch from "./HeroSearch";
// Photo by Mesut Kaya on Unsplash - https://unsplash.com/photos/eOcyhe5-9sQ
const StyledContainer = styled(Container)(({ theme }) => ({
zIndex: 1,
position: "relative",
display: "flex",
flexDirection: "column",
padding: theme.spacing(2, 2),
[theme.breakpoints.up("sm")]: {
padding: theme.spacing(4, 2),
},
}));
const StyledOuterContainer = styled("div")(({ theme }) => ({
position: "relative",
}));
export default function Hero() {
const { t } = useTranslation(DASHBOARD);
return (
<StyledOuterContainer>
<StyledContainer maxWidth="md">
<HeroLinks />
<HeroSearch />
<HeroButton />
</StyledContainer>
<HeroImageAttribution />
<HeroImage
alt={t("hero_image_alt")}
// export as tiny PNG (a few px by a few px), then
// echo "data:image/png;base64,$(cat 5.png | base64 -w 0)"
placeHolderSrc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAIAAADUVFKvAAAAO0lEQVQI1wEwAM//AZqxot4B/d78+d38/N/8+wRIDRH9AQHu+vnD1NQQHhsBUWNNFQ0N+/n39fT3/Q8PwSsbXi/QOgYAAAAASUVORK5CYII="
imageWidths={[
{
width: 1024,
fileName: "https://cdn.couchers.org/img/hero/1024.jpeg",
},
{
width: 2048,
fileName: "https://cdn.couchers.org/img/hero/2048.jpeg",
},
{
width: 4096,
fileName: "https://cdn.couchers.org/img/hero/4096.jpeg",
},
]}
/>
</StyledOuterContainer>
);
}
|