-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add a new onepirate theme (#13769)
- Loading branch information
1 parent
28d2ca0
commit dc4d1eb
Showing
67 changed files
with
2,922 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
docs/src/pages/premium-themes/onepirate/ForgotPassword.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Oops, something went wrong.