mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
Format join flow using ModalTitle, ModalInnerContent, NextStepButton components
This commit is contained in:
parent
92430584dc
commit
2773495878
5 changed files with 55 additions and 19 deletions
|
@ -2,6 +2,10 @@ const React = require('react');
|
||||||
const PropTypes = require('prop-types');
|
const PropTypes = require('prop-types');
|
||||||
|
|
||||||
const NextStepButton = require('./next-step-button.jsx');
|
const NextStepButton = require('./next-step-button.jsx');
|
||||||
|
const ModalTitle = require('../modal/base/modal-title.jsx');
|
||||||
|
const ModalInnerContent = require('../modal/base/modal-inner-content.jsx');
|
||||||
|
|
||||||
|
require('./join-flow-step.scss');
|
||||||
|
|
||||||
const JoinFlowStep = ({
|
const JoinFlowStep = ({
|
||||||
children,
|
children,
|
||||||
|
@ -12,10 +16,12 @@ const JoinFlowStep = ({
|
||||||
}) => (
|
}) => (
|
||||||
<form onSubmit={onSubmit}>
|
<form onSubmit={onSubmit}>
|
||||||
<div>
|
<div>
|
||||||
|
<ModalInnerContent className="join-flow-inner-content">
|
||||||
{title && (
|
{title && (
|
||||||
<h2>
|
<ModalTitle
|
||||||
{title}
|
className="join-flow-title"
|
||||||
</h2>
|
title={title}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{description && (
|
{description && (
|
||||||
<p>
|
<p>
|
||||||
|
@ -25,6 +31,7 @@ const JoinFlowStep = ({
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{children}
|
{children}
|
||||||
|
</ModalInnerContent>
|
||||||
</div>
|
</div>
|
||||||
<NextStepButton waiting={waiting} />
|
<NextStepButton waiting={waiting} />
|
||||||
</form>
|
</form>
|
||||||
|
|
14
src/components/join-flow/join-flow-step.scss
Normal file
14
src/components/join-flow/join-flow-step.scss
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
@import "../../colors";
|
||||||
|
@import "../../frameless";
|
||||||
|
|
||||||
|
.join-flow-title {
|
||||||
|
color: $type-gray;
|
||||||
|
font-size: 1.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.join-flow-inner-content {
|
||||||
|
box-shadow: none;
|
||||||
|
width: calc(100% - 5.875rem);
|
||||||
|
margin: 2.3125rem auto 2.5rem;
|
||||||
|
font-size: .875rem;
|
||||||
|
}
|
|
@ -5,19 +5,22 @@ const injectIntl = require('react-intl').injectIntl;
|
||||||
|
|
||||||
const intl = require('../../lib/intl.jsx');
|
const intl = require('../../lib/intl.jsx');
|
||||||
const Spinner = require('../../components/spinner/spinner.jsx');
|
const Spinner = require('../../components/spinner/spinner.jsx');
|
||||||
|
const ModalTitle = require('../modal/base/modal-title.jsx');
|
||||||
|
|
||||||
|
require('./next-step-button.scss');
|
||||||
|
|
||||||
const NextStepButton = props => (
|
const NextStepButton = props => (
|
||||||
<button
|
<button
|
||||||
|
className="modal-flush-bottom-button"
|
||||||
disabled={props.waiting}
|
disabled={props.waiting}
|
||||||
type="submit"
|
type="submit"
|
||||||
{...omit(props, ['text', 'waiting'])}
|
{...omit(props, ['intl', 'text', 'waiting'])}
|
||||||
>
|
>
|
||||||
{props.waiting ?
|
{props.waiting ?
|
||||||
<Spinner /> :
|
<Spinner /> : (
|
||||||
(props.text ?
|
<ModalTitle
|
||||||
props.text : (
|
title={props.text ? props.text : props.intl.formatMessage({id: 'registration.nextStep'})}
|
||||||
<intl.FormattedMessage id="registration.nextStep" />
|
/>
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
|
|
11
src/components/join-flow/next-step-button.scss
Normal file
11
src/components/join-flow/next-step-button.scss
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
@import "../../colors";
|
||||||
|
@import "../../frameless";
|
||||||
|
|
||||||
|
.modal-flush-bottom-button {
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
border-bottom-left-radius: 1rem;
|
||||||
|
border-bottom-right-radius: 1rem;
|
||||||
|
height: 4rem;
|
||||||
|
background-color: $ui-orange;
|
||||||
|
}
|
|
@ -2,4 +2,5 @@
|
||||||
@import "../../../frameless";
|
@import "../../../frameless";
|
||||||
|
|
||||||
.mod-join {
|
.mod-join {
|
||||||
|
width: 27.4375rem;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue