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 | import { styled, StyledEngineProvider, ThemeProvider } from "@mui/material"; import Button from "components/Button"; import { DASHBOARD } from "i18n/namespaces"; import Link from "next/link"; import { useTranslation } from "next-i18next"; import { searchRoute } from "../../../routes"; import { theme } from "../../../theme"; import useHeroBackgroundTheme from "./useHeroBackgroundTheme"; const StyledButtonContainer = styled("div")(({ theme }) => ({ display: "flex", justifyContent: "center", margin: theme.spacing(6, 0), })); export default function HeroButton() { const { t } = useTranslation(DASHBOARD); // because this component is over an image background and has a special button, we adjust the theme const heroTheme = useHeroBackgroundTheme(); return ( <StyledButtonContainer> <StyledEngineProvider injectFirst> <ThemeProvider theme={heroTheme}> <Button component={Link} href={searchRoute} variant="contained" size="large" sx={{ "& span": { background: `-webkit-linear-gradient(0deg, ${theme.palette.primary.main}, ${theme.palette.secondary.main})`, WebkitBackgroundClip: "text", WebkitTextFillColor: "transparent", }, }} > <span>{t("show_map")}</span> </Button> </ThemeProvider> </StyledEngineProvider> </StyledButtonContainer> ); } |