mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
Merge pull request #3117 from benjiwheeler/join-flow-use-css
Format join flow using ModalTitle, ModalInnerContent, NextStepButton components
This commit is contained in:
commit
96a1b89ccb
5 changed files with 55 additions and 19 deletions
|
@ -2,6 +2,10 @@ const React = require('react');
|
|||
const PropTypes = require('prop-types');
|
||||
|
||||
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 = ({
|
||||
children,
|
||||
|
@ -12,19 +16,22 @@ const JoinFlowStep = ({
|
|||
}) => (
|
||||
<form onSubmit={onSubmit}>
|
||||
<div>
|
||||
{title && (
|
||||
<h2>
|
||||
{title}
|
||||
</h2>
|
||||
)}
|
||||
{description && (
|
||||
<p>
|
||||
<span>
|
||||
{description}
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
{children}
|
||||
<ModalInnerContent className="join-flow-inner-content">
|
||||
{title && (
|
||||
<ModalTitle
|
||||
className="join-flow-title"
|
||||
title={title}
|
||||
/>
|
||||
)}
|
||||
{description && (
|
||||
<p>
|
||||
<span>
|
||||
{description}
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
{children}
|
||||
</ModalInnerContent>
|
||||
</div>
|
||||
<NextStepButton waiting={waiting} />
|
||||
</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 Spinner = require('../../components/spinner/spinner.jsx');
|
||||
const ModalTitle = require('../modal/base/modal-title.jsx');
|
||||
|
||||
require('./next-step-button.scss');
|
||||
|
||||
const NextStepButton = props => (
|
||||
<button
|
||||
className="modal-flush-bottom-button"
|
||||
disabled={props.waiting}
|
||||
type="submit"
|
||||
{...omit(props, ['text', 'waiting'])}
|
||||
{...omit(props, ['intl', 'text', 'waiting'])}
|
||||
>
|
||||
{props.waiting ?
|
||||
<Spinner /> :
|
||||
(props.text ?
|
||||
props.text : (
|
||||
<intl.FormattedMessage id="registration.nextStep" />
|
||||
)
|
||||
<Spinner /> : (
|
||||
<ModalTitle
|
||||
title={props.text ? props.text : props.intl.formatMessage({id: 'registration.nextStep'})}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</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";
|
||||
|
||||
.mod-join {
|
||||
width: 27.4375rem;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue