Skip to content

Commit

Permalink
[docs] Add a new onepirate theme (#13769)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Dec 3, 2018
1 parent 28d2ca0 commit dc4d1eb
Show file tree
Hide file tree
Showing 67 changed files with 2,922 additions and 20 deletions.
3 changes: 2 additions & 1 deletion docs/src/modules/styles/getPageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import { create, SheetsRegistry } from 'jss';
import rtl from 'jss-rtl';
import { createMuiTheme, createGenerateClassName, jssPreset } from '@material-ui/core/styles';
import { createGenerateClassName, jssPreset } from '@material-ui/styles';
import { createMuiTheme } from '@material-ui/core/styles';
import themeInitialState from './themeInitialState';

function getTheme(uiTheme) {
Expand Down
20 changes: 15 additions & 5 deletions docs/src/pages/premium-themes/PremiumThemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ const themes = [
{
name: 'Material Dashboard Pro',
description: 'Material Dashboard Pro React is a Premium Material-UI Admin.',
src: '/static/images/themes/creative-tim-dashboard.jpg',
src: '/static/themes/creative-tim-dashboard.jpg',
price: '$59',
category: 'Admin & Dashboard',
href: 'https://www.creative-tim.com/product/material-dashboard-pro-react?partner=104080',
},
{
name: 'Material Kit Pro',
description: 'A Badass Material-UI Kit based on Material Design.',
src: '/static/images/themes/creative-tim-kit.jpg',
src: '/static/themes/creative-tim-kit.jpg',
price: '$89',
category: 'Components',
href: 'https://www.creative-tim.com/product/material-kit-pro-react?partner=104080',
},
{
name: 'Material Dashboard',
description: 'Material Dashboard React is a Free Material-UI Admin.',
src: '/static/images/themes/creative-tim-dashboard.jpg',
src: '/static/themes/creative-tim-dashboard.jpg',
price: 'FREE',
category: 'Admin & Dashboard',
href: 'https://www.creative-tim.com/product/material-dashboard-react?partner=104080',
},
{
name: 'Material Kit',
description: 'A Badass Material-UI Kit based on Material Design.',
src: '/static/images/themes/creative-tim-kit.jpg',
src: '/static/themes/creative-tim-kit.jpg',
price: 'FREE',
category: 'Components',
href: 'https://www.creative-tim.com/product/material-kit-react?partner=104080',
Expand All @@ -61,13 +61,23 @@ const themes = [
description:
'A page that mimics Firebase. ' +
'This item includes theming using the theme provider component.',
src: '/static/images/themes/paperbase.png',
src: '/static/themes/paperbase.png',
price: 'FREE',
category: 'Admin & Dashboard',
href: '/premium-themes/paperbase',
source:
'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/premium-themes/paperbase',
},
{
name: 'Onepirate',
description: 'An example landing and sign-up page.',
src: '/static/themes/onepirate.jpg',
price: 'FREE',
category: 'Landing page',
href: '/premium-themes/onepirate',
source:
'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/premium-themes/onepirate',
},
];

function PremiumThemes(props) {
Expand Down
121 changes: 121 additions & 0 deletions docs/src/pages/premium-themes/onepirate/ForgotPassword.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import withRoot from './modules/withRoot';
// --- Post bootstrap -----
import React from 'react';
import PropTypes from 'prop-types';
import compose from 'recompose/compose';
import { withStyles } from '@material-ui/core/styles';
import { Field, Form, FormSpy } from 'react-final-form';
import Typography from './modules/components/Typography';
import AppFooter from './modules/views/AppFooter';
import AppAppBar from './modules/views/AppAppBar';
import AppForm from './modules/views/AppForm';
import { email, required } from './modules/form/validation';
import RFTextField from './modules/form/RFTextField';
import FormButton from './modules/form/FormButton';
import FormFeedback from './modules/form/FormFeedback';

const styles = theme => ({
form: {
marginTop: theme.spacing.unit * 6,
},
button: {
marginTop: theme.spacing.unit * 3,
marginBottom: theme.spacing.unit * 2,
},
feedback: {
marginTop: theme.spacing.unit * 2,
},
});

class ForgotPassword extends React.Component {
state = {
sent: false,
};

validate = values => {
const errors = required(['email', 'password'], values, this.props);

if (!errors.email) {
const emailError = email(values.email, values, this.props);
if (emailError) {
errors.email = email(values.email, values, this.props);
}
}

return errors;
};

handleSubmit = () => {};

render() {
const { classes } = this.props;
const { sent } = this.state;

return (
<React.Fragment>
<AppAppBar />
<AppForm>
<React.Fragment>
<Typography variant="h3" gutterBottom marked="center" align="center">
Forgot your password?
</Typography>
<Typography variant="body2" align="center">
{"Enter your email address below and we we'll" +
'send you a link to reset your password.'}
</Typography>
</React.Fragment>
<Form
onSubmit={this.handleSubmit}
subscription={{ submitting: true }}
validate={this.validate}
>
{({ handleSubmit, submitting }) => (
<form onSubmit={handleSubmit} className={classes.form} noValidate>
<Field
autoFocus
autoComplete="email"
component={RFTextField}
disabled={submitting || sent}
fullWidth
label="Email"
margin="normal"
name="email"
required
size="large"
/>
<FormSpy subscription={{ submitError: true }}>
{({ submitError }) =>
submitError ? (
<FormFeedback className={classes.feedback} error>
{submitError}
</FormFeedback>
) : null
}
</FormSpy>
<FormButton
className={classes.button}
disabled={submitting || sent}
size="large"
color="secondary"
fullWidth
>
{submitting || sent ? 'In progress…' : 'Send reset link'}
</FormButton>
</form>
)}
</Form>
</AppForm>
<AppFooter />
</React.Fragment>
);
}
}

ForgotPassword.propTypes = {
classes: PropTypes.object.isRequired,
};

export default compose(
withRoot,
withStyles(styles),
)(ForgotPassword);
28 changes: 28 additions & 0 deletions docs/src/pages/premium-themes/onepirate/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import withRoot from './modules/withRoot';
// --- Post bootstrap -----
import React from 'react';
import ProductCategories from './modules/views/ProductCategories';
import ProductSmokingHero from './modules/views/ProductSmokingHero';
import AppFooter from './modules/views/AppFooter';
import ProductHero from './modules/views/ProductHero';
import ProductValues from './modules/views/ProductValues';
import ProductHowItWorks from './modules/views/ProductHowItWorks';
import ProductCTA from './modules/views/ProductCTA';
import AppAppBar from './modules/views/AppAppBar';

function Index() {
return (
<React.Fragment>
<AppAppBar />
<ProductHero />
<ProductValues />
<ProductCategories />
<ProductHowItWorks />
<ProductCTA />
<ProductSmokingHero />
<AppFooter />
</React.Fragment>
);
}

export default withRoot(Index);
26 changes: 26 additions & 0 deletions docs/src/pages/premium-themes/onepirate/Privacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import withRoot from './modules/withRoot';
// --- Post bootstrap -----
import React from 'react';
import Markdown from './modules/components/Markdown';
import Typography from './modules/components/Typography';
import LayoutBody from './modules/components/LayoutBody';
import AppAppBar from './modules/views/AppAppBar';
import privacy from './modules/views/privacy.md';
import AppFooter from './modules/views/AppFooter';

function Privacy() {
return (
<React.Fragment>
<AppAppBar />
<LayoutBody margin marginBottom>
<Typography variant="h3" gutterBottom marked="center" align="center">
Privacy
</Typography>
<Markdown>{privacy}</Markdown>
</LayoutBody>
<AppFooter />
</React.Fragment>
);
}

export default withRoot(Privacy);
148 changes: 148 additions & 0 deletions docs/src/pages/premium-themes/onepirate/SignIn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import withRoot from './modules/withRoot';
// --- Post bootstrap -----
import React from 'react';
import PropTypes from 'prop-types';
import compose from 'recompose/compose';
import { withStyles } from '@material-ui/core/styles';
import { Field, Form, FormSpy } from 'react-final-form';
import Typography from './modules/components/Typography';
import AppFooter from './modules/views/AppFooter';
import AppAppBar from './modules/views/AppAppBar';
import Link from './modules/next/Link';
import AppForm from './modules/views/AppForm';
import { email, required } from './modules/form/validation';
import RFTextField from './modules/form/RFTextField';
import FormButton from './modules/form/FormButton';
import FormFeedback from './modules/form/FormFeedback';

const styles = theme => ({
form: {
marginTop: theme.spacing.unit * 6,
},
button: {
marginTop: theme.spacing.unit * 3,
marginBottom: theme.spacing.unit * 2,
},
feedback: {
marginTop: theme.spacing.unit * 2,
},
});

class SignIn extends React.Component {
state = {
sent: false,
};

validate = values => {
const errors = required(['email', 'password'], values, this.props);

if (!errors.email) {
const emailError = email(values.email, values, this.props);
if (emailError) {
errors.email = email(values.email, values, this.props);
}
}

return errors;
};

handleSubmit = () => {};

render() {
const { classes } = this.props;
const { sent } = this.state;

return (
<React.Fragment>
<AppAppBar />
<AppForm>
<React.Fragment>
<Typography variant="h3" gutterBottom marked="center" align="center">
Sign In
</Typography>
<Typography variant="body2" align="center">
{'Not a member yet? '}
<Link href="/premium-themes/onepirate/sign-up" variant="underline">
Sign Up here
</Link>
</Typography>
</React.Fragment>
<Form
onSubmit={this.handleSubmit}
subscription={{ submitting: true }}
validate={this.validate}
>
{({ handleSubmit, submitting }) => (
<form onSubmit={handleSubmit} className={classes.form} noValidate>
<Field
autoComplete="email"
autoFocus
component={RFTextField}
disabled={submitting || sent}
fullWidth
label="Email"
margin="normal"
name="email"
required
size="large"
/>
<Field
fullWidth
size="large"
component={RFTextField}
disabled={submitting || sent}
required
name="password"
autoComplete="current-password"
label="Password"
type="password"
margin="normal"
/>
<FormSpy subscription={{ submitError: true }}>
{({ submitError }) =>
submitError ? (
<FormFeedback className={classes.feedback} error>
{submitError}
</FormFeedback>
) : null
}
</FormSpy>
<FormButton
className={classes.button}
disabled={submitting || sent}
size="large"
color="secondary"
fullWidth
>
{submitting || sent ? 'In progress…' : 'Sign In'}
</FormButton>
</form>
)}
</Form>
<Typography
component={linkProps => (
<Link
{...linkProps}
variant="underline"
href="/premium-themes/onepirate/forgot-password"
/>
)}
align="center"
>
Forgot password?
</Typography>
</AppForm>
<AppFooter />
</React.Fragment>
);
}
}

SignIn.propTypes = {
classes: PropTypes.object.isRequired,
};

export default compose(
withRoot,
withStyles(styles),
)(SignIn);
Loading

0 comments on commit dc4d1eb

Please sign in to comment.