Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Refine and polish out Templates page #43131

Merged
merged 15 commits into from
Aug 7, 2024
4 changes: 3 additions & 1 deletion docs/data/material/getting-started/templates/blog/Blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function ToggleCustomTheme({ showCustomTheme, toggleCustomTheme }) {
<AutoAwesomeRoundedIcon sx={{ fontSize: '20px', mr: 1 }} />
Custom theme
</ToggleButton>
<ToggleButton value={false}>Material Design 2</ToggleButton>
<ToggleButton data-screenshot="toggle-default-theme" value={false}>
Material Design 2
</ToggleButton>
</ToggleButtonGroup>
</Box>
);
Expand Down
4 changes: 3 additions & 1 deletion docs/data/material/getting-started/templates/blog/Blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ function ToggleCustomTheme({
<AutoAwesomeRoundedIcon sx={{ fontSize: '20px', mr: 1 }} />
Custom theme
</ToggleButton>
<ToggleButton value={false}>Material Design 2</ToggleButton>
<ToggleButton data-screenshot="toggle-default-theme" value={false}>
Material Design 2
</ToggleButton>
</ToggleButtonGroup>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Features from './components/Features';
import Testimonials from './components/Testimonials';
import FAQ from './components/FAQ';
import Footer from './components/Footer';
import getLPTheme from './getLPTheme';
import getMPTheme from './getMPTheme';

function ToggleCustomTheme({ showCustomTheme, toggleCustomTheme }) {
return (
Expand Down Expand Up @@ -63,10 +63,10 @@ ToggleCustomTheme.propTypes = {
toggleCustomTheme: PropTypes.func.isRequired,
};

export default function LandingPage() {
export default function MarketingPage() {
const [mode, setMode] = React.useState('light');
const [showCustomTheme, setShowCustomTheme] = React.useState(true);
const LPtheme = createTheme(getLPTheme(mode));
const MPTheme = createTheme(getMPTheme(mode));
const defaultTheme = createTheme({ palette: { mode } });

const toggleColorMode = () => {
Expand All @@ -78,7 +78,7 @@ export default function LandingPage() {
};

return (
<ThemeProvider theme={showCustomTheme ? LPtheme : defaultTheme}>
<ThemeProvider theme={showCustomTheme ? MPTheme : defaultTheme}>
<CssBaseline />
<AppAppBar mode={mode} toggleColorMode={toggleColorMode} />
<Hero />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Features from './components/Features';
import Testimonials from './components/Testimonials';
import FAQ from './components/FAQ';
import Footer from './components/Footer';
import getLPTheme from './getLPTheme';
import getMPTheme from './getMPTheme';

interface ToggleCustomThemeProps {
showCustomTheme: Boolean;
Expand Down Expand Up @@ -63,10 +63,10 @@ function ToggleCustomTheme({
);
}

export default function LandingPage() {
export default function MarketingPage() {
const [mode, setMode] = React.useState<PaletteMode>('light');
const [showCustomTheme, setShowCustomTheme] = React.useState(true);
const LPtheme = createTheme(getLPTheme(mode));
const MPTheme = createTheme(getMPTheme(mode));
const defaultTheme = createTheme({ palette: { mode } });

const toggleColorMode = () => {
Expand All @@ -78,7 +78,7 @@ export default function LandingPage() {
};

return (
<ThemeProvider theme={showCustomTheme ? LPtheme : defaultTheme}>
<ThemeProvider theme={showCustomTheme ? MPTheme : defaultTheme}>
<CssBaseline />
<AppAppBar mode={mode} toggleColorMode={toggleColorMode} />
<Hero />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Landing page template
# Marketing 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/next/examples).
2. Make sure your project has the required dependencies: @mui/material, @mui/icons-material, @emotion/styled, @emotion/react.
3. Import and use the `LandingPage` component.
3. Import and use the `MarketingPage` component.

## Demo

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

View the demo at https://next.mui.com/material-ui/getting-started/templates/landing-page/.
View the demo at https://next.mui.com/material-ui/getting-started/templates/marketing-page/.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const getDesignTokens = (mode) => ({
},
});

export default function getLPTheme(mode) {
export default function getMPTheme(mode) {
return {
...getDesignTokens(mode),
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const getDesignTokens = (mode: PaletteMode) => ({
},
});

export default function getLPTheme(mode: PaletteMode): ThemeOptions {
export default function getMPTheme(mode: PaletteMode): ThemeOptions {
return {
...getDesignTokens(mode),
components: {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions docs/data/material/getting-started/templates/templates.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
productId: material-ui
title: 9+ Free React Templates
title: New Free React Templates
---

# React Templates

<p class="description">Browse our collection of free React templates to get started building your app with Material UI, including a React dashboard, React landing page, and more.</p>
<p class="description">Browse our collection of free React templates to get started building your app with Material UI, including a React dashboard, React marketing page, and more.</p>

Check warning on line 8 in docs/data/material/getting-started/templates/templates.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'our'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'our'.", "location": {"path": "docs/data/material/getting-started/templates/templates.md", "range": {"start": {"line": 8, "column": 31}}}, "severity": "WARNING"}

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

## Free templates

Our curated collection of free Material UI templates includes dashboards, landing pages, sign-in and sign-up pages, a blog, a checkout flow, and more.
Our curated collection of free Material UI templates includes dashboards, marketing pages, sign-in and sign-up pages, a blog, a checkout flow, and more.

Check warning on line 14 in docs/data/material/getting-started/templates/templates.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'Our'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'Our'.", "location": {"path": "docs/data/material/getting-started/templates/templates.md", "range": {"start": {"line": 14, "column": 1}}}, "severity": "WARNING"}
They can be combined with one of the [example projects](/material-ui/getting-started/example-projects/) to form a complete starter.

Sections of each layout are clearly defined either by comments or use of separate files,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from 'react';
import AppTheme from 'docs/src/modules/components/AppTheme';
import LandingPage from 'docs/data/material/getting-started/templates/landing-page/LandingPage';
import MarketingPage from 'docs/data/material/getting-started/templates/marketing-page/MarketingPage';

export default function Page() {
return (
<AppTheme>
<LandingPage />
<MarketingPage />
</AppTheme>
);
}
11 changes: 0 additions & 11 deletions docs/pages/material-ui/getting-started/templates/pricing.js

This file was deleted.

11 changes: 0 additions & 11 deletions docs/pages/material-ui/getting-started/templates/sticky-footer.js

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Loading
Loading