scratch-www/src/components/os-chooser/os-chooser.jsx

52 lines
1.5 KiB
React
Raw Normal View History

Add landing pages for the micro:bit and EV3 extensions (#1981) * start building ev3 landing page structure * Inject translations, add more content and structure to ev3 landing page * Add ev3 route * add active styles for os chooser buttons * Add ev3 assets * Add content and intial styles for everything down to "Sample Projects" * Add correct padding to all sections on ev3 page * Add more margins to match the mockup * Create os chooser component for reuse on other landing pages * Make EV3 page stateful, add OS logic, change step styles, fix images on Chrome * Add sample project cards and styles * Add fixed ev3 icon svg * Add app store badges (no href on links yet) * Add section separator, fix sample project card margins * Add border to project cards, make project cards clickable links * Add FAQ boilerplate and styling from InformationPage component * Add indented ol style, example * Add link style with underline * Add EV3 retail link * Content updates * Fix some z-index issues with os chooser * micro:bit page mega-commit * os chooser should not have a higher z-index than nav * Update starter projects * Localize OS chooser * Add localization configuration for EV3 page * Localize section titles on ev3 page * Add starter project images and descriptions * Add link to microbit.org * Fix tip box width on microbit and ev3 pages * add l10n strings up to things to try on ev3 page * Fix lint error in ev3.scss * Add download link style to ev3 * microbit getting started text and images * Remove tip about microbit name * Hex file and starter project download links * microbit wording updates * update images * Fix issues with download link style * text fix * Add ev3 starter project downloads * Add microbit l10n file and config * Add l10n strings for microbit header and scratch link sections * Add l10n strings for microbit page up to faq * content updates * Fix some page overflow issues * microbit faq content and style * Use zipped version of microbit hex file * Add platform name to scratch link download button * Add EV3 faq to l10n.json * Add final strings from micro:bit and EV3 pages to l10n.json files * Add white download asset * Tweak styles for ev3 and microbit * Add some final tweaks to the EV3 page styles * Add TODO comments about refactoring duplicate code
2018-07-19 18:08:44 -04:00
const classNames = require('classnames');
const injectIntl = require('react-intl').injectIntl;
const FormattedMessage = require('react-intl').FormattedMessage;
const PropTypes = require('prop-types');
const React = require('react');
const FlexRow = require('../../components/flex-row/flex-row.jsx');
const Button = require('../../components/forms/button.jsx');
require('./os-chooser.scss');
const OS_ENUM = {
WINDOWS: 'Windows',
MACOS: 'macOS'
};
const OSChooser = props => (
<div className="os-chooser">
<FlexRow className="inner">
<FormattedMessage id="oschooser.choose" />
<Button
className={classNames({active: props.currentOS === OS_ENUM.WINDOWS})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.WINDOWS)
}
>
<img src="/svgs/extensions/windows.svg" />
Windows
</Button>
<Button
className={classNames({active: props.currentOS === OS_ENUM.MACOS})}
onClick={() => // eslint-disable-line react/jsx-no-bind
props.handleSetOS(OS_ENUM.MACOS)
}
>
<img src="/svgs/extensions/mac.svg" />
macOS
</Button>
</FlexRow>
</div>
);
OSChooser.propTypes = {
currentOS: PropTypes.string,
handleSetOS: PropTypes.func
};
const wrappedOSChooser = injectIntl(OSChooser);
module.exports = wrappedOSChooser;