Files
scratch-gui/src/components/forms/label.jsx
T
chrisgarrity 3548995797 Fix sprite-info pane for ‘wide’ languages
Move the labels above the inputs for languages that don’t fix in the width of the sprite-info pane.

Because of the different widths of everything I left aligned them.

Examples,
Abkhaz, Catalan, Greek.

renamed the `rtl-locales` lib file as `locale-utils` as  it’s doing more than rtl now. RTL should probably move into the scratch-l10n repo, but should the `wide-locales` setting? That seems like something that is gui specific. I don’t like having to hard code the specific languages that don’t fit, but there didn’t seem to be a better way to handle it right now.
2018-09-25 08:07:43 -04:00

28 lines
658 B
React

import PropTypes from 'prop-types';
import React from 'react';
import styles from './label.css';
const Label = props => (
<label className={props.above ? styles.inputGroupColumn : styles.inputGroup}>
<span className={props.secondary ? styles.inputLabelSecondary : styles.inputLabel}>
{props.text}
</span>
{props.children}
</label>
);
Label.propTypes = {
above: PropTypes.bool,
children: PropTypes.node,
secondary: PropTypes.bool,
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
};
Label.defaultProps = {
above: false,
secondary: false
};
export default Label;