Skip to content
Snippets Groups Projects
Unverified Commit 24060bec authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge branch 'develop' into greenkeeper/scratch-l10n-3.1.20181213173343

parents 8b4d6694 60be9c52
No related branches found
No related tags found
No related merge requests found
...@@ -7,9 +7,12 @@ ...@@ -7,9 +7,12 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
justify-content: space-between; justify-content: flex-start;
border-radius: $space; border-radius: $space;
padding: $space; padding-top: .875rem;
padding-bottom: .875rem;
padding-left: 1rem;
padding-right: 1rem;
margin-bottom: 7px; margin-bottom: 7px;
min-height: 1.5rem; min-height: 1.5rem;
} }
...@@ -26,20 +29,28 @@ ...@@ -26,20 +29,28 @@
box-shadow: 0px 0px 0px 2px $extensions-light; box-shadow: 0px 0px 0px 2px $extensions-light;
} }
.alert-spinner {
self-align: center;
}
.icon-section {
min-width: 1.25rem;
min-height: 1.25rem;
display: flex;
padding-right: 1rem;
}
.alert-icon { .alert-icon {
margin-left: .25rem;
margin-right: .25rem;
vertical-align: middle; vertical-align: middle;
} }
.alert-message { .alert-message {
color: #555; color: #555;
font-weight: bold; font-weight: bold;
font-size: .75rem; font-size: .8125rem;
line-height: 14px; line-height: .875rem;
display: flex; display: flex;
align-items: center; align-items: center;
padding-left: .5rem;
padding-right: .5rem; padding-right: .5rem;
} }
...@@ -61,6 +72,7 @@ ...@@ -61,6 +72,7 @@
.alert-connection-button { .alert-connection-button {
min-height: 2rem; min-height: 2rem;
width: 6.5rem;
padding: 0.55rem 0.9rem; padding: 0.55rem 0.9rem;
border-radius: 0.35rem; border-radius: 0.35rem;
background: #FF8C1A; background: #FF8C1A;
...@@ -70,8 +82,9 @@ ...@@ -70,8 +82,9 @@
border: none; border: none;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
align-self: center; align-self: stretch;
outline-style:none; outline-style:none;
} }
...@@ -82,3 +95,9 @@ ...@@ -82,3 +95,9 @@
[dir="rtl"] .alert-connection-button { [dir="rtl"] .alert-connection-button {
margin-left: 13px; margin-left: 13px;
} }
/* prevent last button in list from too much margin to edge of alert */
.alert-buttons > :last-child {
margin-left: 0;
margin-right: 0;
}
...@@ -34,14 +34,21 @@ const AlertComponent = ({ ...@@ -34,14 +34,21 @@ const AlertComponent = ({
className={classNames(styles.alert, styles[level])} className={classNames(styles.alert, styles[level])}
> >
{/* TODO: implement Rtl handling */} {/* TODO: implement Rtl handling */}
{iconSpinner && ( {(iconSpinner || iconURL) && (
<Spinner className={styles.alertSpinner} /> <div className={styles.iconSection}>
)} {iconSpinner && (
{iconURL && ( <Spinner
<img className={styles.alertSpinner}
className={styles.alertIcon} level={level}
src={iconURL} />
/> )}
{iconURL && (
<img
className={styles.alertIcon}
src={iconURL}
/>
)}
</div>
)} )}
<div className={styles.alertMessage}> <div className={styles.alertMessage}>
{extensionName ? ( {extensionName ? (
......
.alerts-inner-container {
min-width: 200px;
max-width: 548px;
}
...@@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; ...@@ -4,6 +4,8 @@ import PropTypes from 'prop-types';
import Box from '../box/box.jsx'; import Box from '../box/box.jsx';
import Alert from '../../containers/alert.jsx'; import Alert from '../../containers/alert.jsx';
import styles from './alerts.css';
const AlertsComponent = ({ const AlertsComponent = ({
alertsList, alertsList,
className, className,
...@@ -13,24 +15,26 @@ const AlertsComponent = ({ ...@@ -13,24 +15,26 @@ const AlertsComponent = ({
bounds="parent" bounds="parent"
className={className} className={className}
> >
{alertsList.map((a, index) => ( <Box className={styles.alertsInnerContainer} >
<Alert {alertsList.map((a, index) => (
closeButton={a.closeButton} <Alert
content={a.content} closeButton={a.closeButton}
extensionId={a.extensionId} content={a.content}
extensionName={a.extensionName} extensionId={a.extensionId}
iconSpinner={a.iconSpinner} extensionName={a.extensionName}
iconURL={a.iconURL} iconSpinner={a.iconSpinner}
index={index} iconURL={a.iconURL}
key={index} index={index}
level={a.level} key={index}
message={a.message} level={a.level}
showDownload={a.showDownload} message={a.message}
showReconnect={a.showReconnect} showDownload={a.showDownload}
showSaveNow={a.showSaveNow} showReconnect={a.showReconnect}
onCloseAlert={onCloseAlert} showSaveNow={a.showSaveNow}
/> onCloseAlert={onCloseAlert}
))} />
))}
</Box>
</Box> </Box>
); );
......
...@@ -20,6 +20,7 @@ const InlineMessageComponent = ({ ...@@ -20,6 +20,7 @@ const InlineMessageComponent = ({
<Spinner <Spinner
small small
className={styles.spinner} className={styles.spinner}
level={'info'}
/> />
)} )}
{content} {content}
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
.backpack-item { .backpack-item {
min-width: 4rem; min-width: 4rem;
max-width: 6rem;
margin: 0 0.25rem; margin: 0 0.25rem;
} }
......
...@@ -234,7 +234,11 @@ const Cards = props => { ...@@ -234,7 +234,11 @@ const Cards = props => {
if (x === 0 && y === 0) { if (x === 0 && y === 0) {
// initialize positions // initialize positions
x = isRtl ? -292 : 292; x = isRtl ? -292 : 292;
y = 365; // The tallest cards are about 385px high, and the default position is pinned
// to near the bottom of the blocks palette to allow room to work above.
const tallCardHeight = 385;
const bottomMargin = 60; // To avoid overlapping the backpack region
y = window.innerHeight - tallCardHeight - bottomMargin;
} }
const steps = content[activeDeckId].steps; const steps = content[activeDeckId].steps;
......
...@@ -303,12 +303,10 @@ $fade-out-distance: 15px; ...@@ -303,12 +303,10 @@ $fade-out-distance: 15px;
/* Alerts */ /* Alerts */
.alerts-container { .alerts-container {
width: 448px; display: flex;
min-width: 448px; justify-content: center;
width: 100%;
z-index: $z-index-alerts; z-index: $z-index-alerts;
left: 0;
right: 0;
margin: auto;
position: absolute; position: absolute;
margin-top: 53px; margin-top: 53px;
} }
......
...@@ -348,23 +348,25 @@ class MenuBar extends React.Component { ...@@ -348,23 +348,25 @@ class MenuBar extends React.Component {
{newProjectMessage} {newProjectMessage}
</MenuItem> </MenuItem>
</MenuSection> </MenuSection>
<MenuSection> {(this.props.canSave || this.props.canCreateCopy || this.props.canRemix) && (
{this.props.canSave ? ( <MenuSection>
<MenuItem onClick={this.handleClickSave}> {this.props.canSave ? (
{saveNowMessage} <MenuItem onClick={this.handleClickSave}>
</MenuItem> {saveNowMessage}
) : []} </MenuItem>
{this.props.canCreateCopy ? ( ) : []}
<MenuItem onClick={this.handleClickSaveAsCopy}> {this.props.canCreateCopy ? (
{createCopyMessage} <MenuItem onClick={this.handleClickSaveAsCopy}>
</MenuItem> {createCopyMessage}
) : []} </MenuItem>
{this.props.canRemix ? ( ) : []}
<MenuItem onClick={this.handleClickRemix}> {this.props.canRemix ? (
{remixMessage} <MenuItem onClick={this.handleClickRemix}>
</MenuItem> {remixMessage}
) : []} </MenuItem>
</MenuSection> ) : []}
</MenuSection>
)}
<MenuSection> <MenuSection>
<SBFileUploader onUpdateProjectTitle={this.props.onUpdateProjectTitle}> <SBFileUploader onUpdateProjectTitle={this.props.onUpdateProjectTitle}>
{(className, renderFileInput, loadProject) => ( {(className, renderFileInput, loadProject) => (
......
@import "../../css/colors.css"; @import "../../css/colors.css";
.spinner { .spinner {
width: 1rem; width: 1.25rem;
height: 1rem; height: 1.25rem;
display: inline-block; display: inline-block;
position: relative; position: relative;
border-radius: 50%; border-radius: 50%;
border-width: .1875rem; border-width: .1875rem;
border-style: solid; border-style: solid;
border-color: $ui-white-transparent; border-color: $ui-white-transparent;
box-sizing: content-box;
} }
.spinner::before, .spinner::after { .spinner::before, .spinner::after {
width: 1rem; width: 1.25rem;
height: 1rem; height: 1.25rem;
content: ''; content: '';
border-radius: 50%; border-radius: 50%;
display: block; display: block;
...@@ -48,17 +49,25 @@ ...@@ -48,17 +49,25 @@
} }
} }
.spinner.orange { .spinner.success {
border-color: $extensions-transparent;
}
.spinner.success::after {
border-top-color: $extensions-primary;
}
.spinner.warn {
border-color: $error-transparent; border-color: $error-transparent;
} }
.spinner.orange::after { .spinner.warn::after {
border-top-color: $error-primary; border-top-color: $error-primary;
} }
.spinner.white { .spinner.info {
border-color: $ui-white-transparent; border-color: $ui-white-transparent;
} }
.spinner.white::after { .spinner.info::after {
border-top-color: $ui-white; border-top-color: $ui-white;
} }
...@@ -7,6 +7,7 @@ import styles from './spinner.css'; ...@@ -7,6 +7,7 @@ import styles from './spinner.css';
const SpinnerComponent = function (props) { const SpinnerComponent = function (props) {
const { const {
className, className,
level,
small small
} = props; } = props;
return ( return (
...@@ -14,6 +15,7 @@ const SpinnerComponent = function (props) { ...@@ -14,6 +15,7 @@ const SpinnerComponent = function (props) {
className={classNames( className={classNames(
className, className,
styles.spinner, styles.spinner,
styles[level],
{[styles.small]: small} {[styles.small]: small}
)} )}
/> />
...@@ -21,9 +23,11 @@ const SpinnerComponent = function (props) { ...@@ -21,9 +23,11 @@ const SpinnerComponent = function (props) {
}; };
SpinnerComponent.propTypes = { SpinnerComponent.propTypes = {
className: PropTypes.string, className: PropTypes.string,
level: PropTypes.string,
small: PropTypes.bool small: PropTypes.bool
}; };
SpinnerComponent.defaultProps = { SpinnerComponent.defaultProps = {
className: '' className: '',
level: 'info'
}; };
export default SpinnerComponent; export default SpinnerComponent;
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
*/ */
box-sizing: border-box; box-sizing: border-box;
width: calc((100% / $sprites-per-row ) - $space); width: calc((100% / $sprites-per-row ) - $space);
max-width: 6rem;
min-width: 4rem; min-width: 4rem;
min-height: 4rem; /* @todo: calc height same as width */ min-height: 4rem; /* @todo: calc height same as width */
margin: calc($space / 2); margin: calc($space / 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment