Skip to content

Commit

Permalink
[material-ui] Replace the Album template with a landing page (#37557)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Andai <diego@mui.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
  • Loading branch information
4 people authored Feb 5, 2024
1 parent 154920c commit 0766bde
Show file tree
Hide file tree
Showing 42 changed files with 4,650 additions and 296 deletions.
137 changes: 0 additions & 137 deletions docs/data/material/getting-started/templates/album/Album.js

This file was deleted.

137 changes: 0 additions & 137 deletions docs/data/material/getting-started/templates/album/Album.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import * as React from 'react';
import PropTypes from 'prop-types';

import CssBaseline from '@mui/material/CssBaseline';
import Box from '@mui/material/Box';
import Divider from '@mui/material/Divider';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import ToggleButton from '@mui/material/ToggleButton';
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
import AutoAwesomeRoundedIcon from '@mui/icons-material/AutoAwesomeRounded';
import SvgMaterialDesign from 'docs/src/icons/SvgMaterialDesign';
import AppAppBar from './components/AppAppBar';
import Hero from './components/Hero';
import LogoCollection from './components/LogoCollection';
import Highlights from './components/Highlights';
import Pricing from './components/Pricing';
import Features from './components/Features';
import Testimonials from './components/Testimonials';
import FAQ from './components/FAQ';
import Footer from './components/Footer';
import getLPTheme from './getLPTheme';

const defaultTheme = createTheme({});

function ToggleCustomTheme({ showCustomTheme, toggleCustomTheme }) {
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
width: '100dvw',
position: 'fixed',
bottom: 24,
}}
>
<ToggleButtonGroup
color="primary"
exclusive
value={showCustomTheme}
onChange={toggleCustomTheme}
aria-label="Platform"
sx={{
backgroundColor: 'background.default',
'& .Mui-selected': {
pointerEvents: 'none',
},
}}
>
<ToggleButton value>
<AutoAwesomeRoundedIcon sx={{ fontSize: '20px', mr: 1 }} />
Custom theme
</ToggleButton>
<ToggleButton value={false}>
<SvgMaterialDesign sx={{ fontSize: '20px', mr: 1 }} />
Material Design
</ToggleButton>
</ToggleButtonGroup>
</Box>
);
}

ToggleCustomTheme.propTypes = {
showCustomTheme: PropTypes.shape({
valueOf: PropTypes.func.isRequired,
}).isRequired,
toggleCustomTheme: PropTypes.func.isRequired,
};

export default function LandingPage() {
const [mode, setMode] = React.useState('dark');
const [showCustomTheme, setShowCustomTheme] = React.useState(true);
const LPtheme = createTheme(getLPTheme(mode));

const toggleColorMode = () => {
setMode((prev) => (prev === 'dark' ? 'light' : 'dark'));
};

const toggleCustomTheme = () => {
setShowCustomTheme((prev) => !prev);
};

return (
<ThemeProvider theme={showCustomTheme ? LPtheme : defaultTheme}>
<CssBaseline />
<AppAppBar mode={mode} toggleColorMode={toggleColorMode} />
<Hero />
<Box sx={{ bgcolor: 'background.default' }}>
<LogoCollection />
<Features />
<Divider />
<Testimonials />
<Divider />
<Highlights />
<Divider />
<Pricing />
<Divider />
<FAQ />
<Divider />
<Footer />
</Box>
<ToggleCustomTheme
showCustomTheme={showCustomTheme}
toggleCustomTheme={toggleCustomTheme}
/>
</ThemeProvider>
);
}
Loading

0 comments on commit 0766bde

Please sign in to comment.