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

49 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');
Refactor Extension Landing Pages (#2006) * Add extension-landing generalized styles, install scratch link component * Make EV3 page use generalized stuff * Use OS_ENUM file instead of class variable * use extension-landing/os-enum in os chooser * Use extension-landing class in extension-landing.scss * Use extension-landing styles and components on microbit page * Add view-specific styles * Move install scratch link l10n strings to src/l10n.json * Start moving steps display to its own components * Finish initial pass at Step, Steps components for extension landing pages * Create ProjectCard component * Use new components on InstallScratchLInk component * Use new components on EV3 page * allow className prop in Steps component * Use new components on micro:bit landing page * imageUrl -> imageSrc in ProjectCard * Create ExtensionHeader component and use it on micro:bit and EV3 pages * Fix a spacing issue in the InstallScratchLink component * Add ExtensionRequirements component * Use ExtensionRequirements component on landing pages * Remove requirements l10n string for ev3 page * Move project card styles out of things-to-try section * Don't render the number row in a step if compact and number props are not set * Add ExtensionSection component * Use ExtensionSection on ev3 and microbit pages * Move state configuration to ExtensionLanding class * Move tip box, screenshot styles outside of specific section * Add TipBox component and use it on the EV3 page * Use hr element instead of section-separator div * Remove refactor TODO comments :)
2018-08-02 13:09:55 -04:00
const OS_ENUM = require('../../components/extension-landing/os-enum.js');
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
Refactor Extension Landing Pages (#2006) * Add extension-landing generalized styles, install scratch link component * Make EV3 page use generalized stuff * Use OS_ENUM file instead of class variable * use extension-landing/os-enum in os chooser * Use extension-landing class in extension-landing.scss * Use extension-landing styles and components on microbit page * Add view-specific styles * Move install scratch link l10n strings to src/l10n.json * Start moving steps display to its own components * Finish initial pass at Step, Steps components for extension landing pages * Create ProjectCard component * Use new components on InstallScratchLInk component * Use new components on EV3 page * allow className prop in Steps component * Use new components on micro:bit landing page * imageUrl -> imageSrc in ProjectCard * Create ExtensionHeader component and use it on micro:bit and EV3 pages * Fix a spacing issue in the InstallScratchLink component * Add ExtensionRequirements component * Use ExtensionRequirements component on landing pages * Remove requirements l10n string for ev3 page * Move project card styles out of things-to-try section * Don't render the number row in a step if compact and number props are not set * Add ExtensionSection component * Use ExtensionSection on ev3 and microbit pages * Move state configuration to ExtensionLanding class * Move tip box, screenshot styles outside of specific section * Add TipBox component and use it on the EV3 page * Use hr element instead of section-separator div * Remove refactor TODO comments :)
2018-08-02 13:09:55 -04:00
require('./os-chooser.scss');
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 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;