Skip to content

Commit

Permalink
Update imports to remove Album
Browse files Browse the repository at this point in the history
  • Loading branch information
zanivan committed Jan 12, 2024
1 parent d7fb70e commit 681d818
Show file tree
Hide file tree
Showing 30 changed files with 359 additions and 122 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Link from '@mui/material/Link';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Divider from '@mui/material/Divider';

import AppBar from './components/AppBar';
import AppAppBar from './components/AppBar';
import Hero from './components/Hero';
import LogoCollection from './components/LogoCollection';
import Highlights from './components/Highlights';
Expand All @@ -15,7 +15,7 @@ import Features from './components/Features';
import Testimonials from './components/Testimonials';
import FAQ from './components/FAQ';

import getAlbumTheme from './getAlbumTheme';
import getLPTheme from './getLPTheme';

function Copyright() {
return (
Expand All @@ -32,7 +32,7 @@ function Copyright() {

export const ColorModeContext = React.createContext(undefined);

export default function Album() {
export default function LandingPage() {
const [colorMode, setColorMode] = React.useState({
mode: 'light',
toggleColorMode: () => {
Expand All @@ -44,15 +44,15 @@ export default function Album() {
});

const theme = React.useMemo(
() => createTheme(getAlbumTheme(colorMode.mode)),
() => createTheme(getLPTheme(colorMode.mode)),
[colorMode.mode],
);

return (
<ColorModeContext.Provider value={colorMode}>
<ThemeProvider theme={theme}>
<CssBaseline />
<AppBar />
<AppAppBar />
<Hero />
<Box
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Features from './components/Features';
import Testimonials from './components/Testimonials';
import FAQ from './components/FAQ';

import getAlbumTheme from './getAlbumTheme';
import getLPTheme from './getLPTheme';

function Copyright() {
return (
Expand All @@ -39,7 +39,7 @@ export const ColorModeContext = React.createContext<ColorMode | undefined>(
undefined,
);

export default function Album() {
export default function LandingPage() {
const [colorMode, setColorMode] = React.useState<ColorMode>({
mode: 'light',
toggleColorMode: () => {
Expand All @@ -51,7 +51,7 @@ export default function Album() {
});

const theme = React.useMemo(
() => createTheme(getAlbumTheme(colorMode.mode)),
() => createTheme(getLPTheme(colorMode.mode)),
[colorMode.mode],
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Album template
# Landing page template

## Usage

<!-- #default-branch-switch -->

1. Copy the files into your project, or one of the [example projects](https://github.com/mui/material-ui/tree/master/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `Album` component.
3. Import and use the `LandingPage` component.

## Demo

<!-- #default-branch-switch -->

View the demo at https://mui.com/material-ui/getting-started/templates/album/.
View the demo at https://mui.com/material-ui/getting-started/templates/landing-page/.
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import Button from '@mui/material/Button';
import ToggleColorMode from './ToggleColorMode';
import Container from '@mui/material/Container';
import Divider from '@mui/material/Divider';
import Typography from '@mui/material/Typography';
import MenuItem from '@mui/material/MenuItem';
import Drawer from '@mui/material/Drawer';

import MenuIcon from '@mui/icons-material/Menu';

const logoStyle = {
width: '140px',
height: 'auto',
};

function AppAppBar() {
const [open, setOpen] = React.useState(false);

const toggleDrawer = (newOpen) => () => {
setOpen(newOpen);
};

const scrollToSection = (sectionId) => {
const sectionElement = document.getElementById(sectionId);
const offset = 128;
if (sectionElement) {
const targetScroll = sectionElement.offsetTop - offset;
sectionElement.scrollIntoView({ behavior: 'smooth' });
window.scrollTo({
top: targetScroll,
behavior: 'smooth',
});
setOpen(false);
}
};

return (
<div>
<AppBar
enableColorOnDark
position="fixed"
sx={{
boxShadow: 0,
bgcolor: (theme) => (theme.palette.mode === 'light' ? '#fff' : '#000'),
borderBottom: 1,
borderColor: 'divider',
paddingX: 0,
}}
>
<Container maxWidth="lg">
<Toolbar disableGutters sx={{}}>
<Box
sx={{
flexGrow: 1,
display: 'flex',
alignItems: 'center',
ml: '-18px',
}}
>
<img
src={
'https://assets-global.website-files.com/61ed56ae9da9fd7e0ef0a967/61f12e6faf73568658154dae_SitemarkDefault.svg'
}
style={logoStyle}
/>
<Box sx={{ display: { xs: 'none', md: 'flex' } }}>
<MenuItem onClick={() => scrollToSection('features')}>
<Typography variant="body2" color="text.primary">
Features
</Typography>
</MenuItem>
<MenuItem onClick={() => scrollToSection('testimonials')}>
<Typography variant="body2" color="text.primary">
Testimonials
</Typography>
</MenuItem>
<MenuItem onClick={() => scrollToSection('highlights')}>
<Typography variant="body2" color="text.primary">
Highlights
</Typography>
</MenuItem>
<MenuItem onClick={() => scrollToSection('pricing')}>
<Typography variant="body2" color="text.primary">
Pricing
</Typography>
</MenuItem>
<MenuItem onClick={() => scrollToSection('faq')}>
{' '}
<Typography variant="body2" color="text.primary">
FAQ
</Typography>
</MenuItem>
</Box>
</Box>

<Box sx={{ display: { xs: 'none', md: 'flex' }, gap: 1 }}>
<Button
color="primary"
variant="contained"
size="small"
component="a"
href="/material-ui/getting-started/templates/sign-up/"
target="_blank"
>
Sign up
</Button>
<Button
color="primary"
variant="outlined"
size="small"
component="a"
href="/material-ui/getting-started/templates/sign-in/"
target="_blank"
>
Sign in
</Button>
<ToggleColorMode />
</Box>

<Box sx={{ display: { sm: '', md: 'none' } }}>
<Button
variant="outlined"
color="primary"
aria-label="menu"
onClick={toggleDrawer(true)}
sx={{ minWidth: '30px', p: '4px' }}
>
<MenuIcon />
</Button>
<Drawer anchor="right" open={open} onClose={toggleDrawer(false)}>
<Box
sx={{
minWidth: '60dvw',
p: 2,
backgroundColor: 'background.paper',
flexGrow: 1,
}}
>
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'end',
flexGrow: 1,
}}
>
<ToggleColorMode />
</Box>
<MenuItem onClick={() => scrollToSection('features')}>
Features
</MenuItem>
<MenuItem onClick={() => scrollToSection('testimonials')}>
Testimonials
</MenuItem>
<MenuItem onClick={() => scrollToSection('highlights')}>
Highlights
</MenuItem>
<MenuItem onClick={() => scrollToSection('pricing')}>
Pricing
</MenuItem>
<MenuItem onClick={() => scrollToSection('faq')}>FAQ</MenuItem>
<Divider />
<MenuItem>
<Button
color="primary"
variant="contained"
component="a"
href="/material-ui/getting-started/templates/sign-up/"
target="_blank"
sx={{ width: '100%' }}
>
Sign up
</Button>
</MenuItem>
<MenuItem>
<Button
color="primary"
variant="outlined"
component="a"
href="/material-ui/getting-started/templates/sign-in/"
target="_blank"
sx={{ width: '100%' }}
>
Sign in
</Button>
</MenuItem>
</Box>
</Drawer>
</Box>
</Toolbar>
</Container>
</AppBar>
</div>
);
}

export default AppAppBar;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function FAQ() {
};

return (
<Box>
<Box id="faq">
<Container
sx={{
position: 'relative',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
import { alpha } from '@mui/system';

import { greyColor, brandColor } from '../getAlbumTheme';
import { greyColor, brandColor } from '../getLPTheme';

import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded';
import ViewQuiltRoundedIcon from '@mui/icons-material/ViewQuiltRounded';
Expand Down Expand Up @@ -51,7 +51,7 @@ export default function Features() {
};

return (
<Box>
<Box id="features">
<Container>
<Grid container spacing={4}>
<Grid item xs={12} md={6}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
import { alpha } from '@mui/system';

import { greyColor, brandColor } from '../getAlbumTheme';
import { greyColor, brandColor } from '../getLPTheme';

import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded';
import ViewQuiltRoundedIcon from '@mui/icons-material/ViewQuiltRounded';
Expand Down
Loading

0 comments on commit 681d818

Please sign in to comment.