mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
commit
8d385afa44
8 changed files with 57 additions and 100 deletions
|
@ -4,8 +4,6 @@ const React = require('react');
|
|||
|
||||
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
||||
|
||||
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
|
||||
|
||||
require('./extension-landing.scss');
|
||||
|
||||
const ExtensionRequirements = props => (
|
||||
|
@ -30,24 +28,22 @@ const ExtensionRequirements = props => (
|
|||
/>
|
||||
macOS 10.13+
|
||||
</span>
|
||||
{CHROME_APP_RELEASED && (
|
||||
<React.Fragment>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/chromeos.svg"
|
||||
/>
|
||||
ChromeOS
|
||||
</span>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/android.svg"
|
||||
/>
|
||||
Android 6.0+
|
||||
</span>
|
||||
</React.Fragment>
|
||||
)}
|
||||
<React.Fragment>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/chromeos.svg"
|
||||
/>
|
||||
ChromeOS
|
||||
</span>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/android.svg"
|
||||
/>
|
||||
Android 6.0+
|
||||
</span>
|
||||
</React.Fragment>
|
||||
<span>
|
||||
<img src="/svgs/extensions/bluetooth.svg" />
|
||||
Bluetooth
|
||||
|
|
|
@ -3,7 +3,6 @@ const FormattedMessage = require('react-intl').FormattedMessage;
|
|||
const React = require('react');
|
||||
|
||||
const OS_ENUM = require('../../lib/os-enum.js');
|
||||
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
|
||||
|
||||
const {isDownloaded, isFromGooglePlay} = require('./install-util.js');
|
||||
|
||||
|
@ -27,24 +26,10 @@ const InstallScratch = ({
|
|||
<div className="blue install-scratch">
|
||||
<FlexRow className="inner column">
|
||||
<h2 className="title">
|
||||
{CHROME_APP_RELEASED ? (
|
||||
<FormattedMessage
|
||||
id="installScratch.appHeaderTitle"
|
||||
values={{operatingsystem: currentOS}}
|
||||
/>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
{isDownloaded(currentOS) && (
|
||||
<FormattedMessage id="installScratch.desktopHeaderTitle" />
|
||||
)}
|
||||
{isFromGooglePlay(currentOS) && (
|
||||
<FormattedMessage
|
||||
id="installScratch.appHeaderTitle"
|
||||
values={{operatingsystem: currentOS}}
|
||||
/>
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
<FormattedMessage
|
||||
id="installScratch.appHeaderTitle"
|
||||
values={{operatingsystem: currentOS}}
|
||||
/>
|
||||
</h2>
|
||||
<Steps>
|
||||
<div className="step">
|
||||
|
@ -56,14 +41,12 @@ const InstallScratch = ({
|
|||
<React.Fragment>
|
||||
{currentOS === OS_ENUM.WINDOWS && (
|
||||
<FormattedMessage
|
||||
id={CHROME_APP_RELEASED ? 'installScratch.getScratchAppWindows' :
|
||||
'installScratch.downloadScratchDesktop'}
|
||||
id="installScratch.getScratchAppWindows"
|
||||
/>
|
||||
)}
|
||||
{currentOS === OS_ENUM.MACOS && (
|
||||
<FormattedMessage
|
||||
id={CHROME_APP_RELEASED ? 'installScratch.getScratchAppMacOs' :
|
||||
'installScratch.downloadScratchDesktop'}
|
||||
id="installScratch.getScratchAppMacOs"
|
||||
/>
|
||||
)}
|
||||
{isFromGooglePlay(currentOS) && (
|
||||
|
|
|
@ -4,8 +4,6 @@ const FormattedMessage = require('react-intl').FormattedMessage;
|
|||
const PropTypes = require('prop-types');
|
||||
const React = require('react');
|
||||
|
||||
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
|
||||
|
||||
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
||||
const Button = require('../../components/forms/button.jsx');
|
||||
|
||||
|
@ -35,28 +33,24 @@ const OSChooser = props => (
|
|||
<img src="/svgs/extensions/mac.svg" />
|
||||
macOS
|
||||
</Button>
|
||||
{CHROME_APP_RELEASED && (
|
||||
<React.Fragment>
|
||||
<Button
|
||||
className={classNames({active: props.currentOS === OS_ENUM.CHROMEOS})}
|
||||
onClick={() => // eslint-disable-line react/jsx-no-bind
|
||||
props.handleSetOS(OS_ENUM.CHROMEOS)
|
||||
}
|
||||
>
|
||||
<img src="/svgs/extensions/chromeos.svg" />
|
||||
ChromeOS
|
||||
</Button>
|
||||
<Button
|
||||
className={classNames({active: props.currentOS === OS_ENUM.ANDROID})}
|
||||
onClick={() => // eslint-disable-line react/jsx-no-bind
|
||||
props.handleSetOS(OS_ENUM.ANDROID)
|
||||
}
|
||||
>
|
||||
<img src="/svgs/extensions/android.svg" />
|
||||
Android
|
||||
</Button>
|
||||
</React.Fragment>
|
||||
)}
|
||||
<Button
|
||||
className={classNames({active: props.currentOS === OS_ENUM.CHROMEOS})}
|
||||
onClick={() => // eslint-disable-line react/jsx-no-bind
|
||||
props.handleSetOS(OS_ENUM.CHROMEOS)
|
||||
}
|
||||
>
|
||||
<img src="/svgs/extensions/chromeos.svg" />
|
||||
ChromeOS
|
||||
</Button>
|
||||
<Button
|
||||
className={classNames({active: props.currentOS === OS_ENUM.ANDROID})}
|
||||
onClick={() => // eslint-disable-line react/jsx-no-bind
|
||||
props.handleSetOS(OS_ENUM.ANDROID)
|
||||
}
|
||||
>
|
||||
<img src="/svgs/extensions/android.svg" />
|
||||
Android
|
||||
</Button>
|
||||
</FlexRow>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -141,10 +141,7 @@
|
|||
|
||||
"installScratch.or": "or",
|
||||
"installScratch.directDownload": "Direct download",
|
||||
"installScratch.desktopHeaderTitle": "Install Scratch Desktop",
|
||||
"installScratch.appHeaderTitle": "Install the Scratch app for {operatingsystem}",
|
||||
"installScratch.downloadScratchDesktop": "Download Scratch Desktop",
|
||||
"installScratch.downloadScratchAppGeneric": "Download Scratch for {operatingsystem}",
|
||||
"installScratch.getScratchAppPlay": "Get the Scratch app on the Google Play Store",
|
||||
"installScratch.getScratchAppMacOs": "Get the Scratch app on the Mac App Store",
|
||||
"installScratch.getScratchAppWindows": "Get the Scratch app on the Microsoft Store",
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import bowser from 'bowser';
|
||||
import OS_ENUM from './os-enum.js';
|
||||
import {CHROME_APP_RELEASED} from './feature-flags.js';
|
||||
|
||||
/**
|
||||
* Helper function to the current Operating System.
|
||||
|
@ -9,10 +8,8 @@ import {CHROME_APP_RELEASED} from './feature-flags.js';
|
|||
export default function () {
|
||||
// matching OS strings from https://github.com/lancedikson/bowser/blob/master/src/constants.js
|
||||
if (bowser.osname === 'macOS') return OS_ENUM.MACOS;
|
||||
if (CHROME_APP_RELEASED) {
|
||||
if (bowser.osname === 'Chrome OS') return OS_ENUM.CHROMEOS;
|
||||
if (bowser.osname === 'Android') return OS_ENUM.ANDROID;
|
||||
}
|
||||
if (bowser.osname === 'Chrome OS') return OS_ENUM.CHROMEOS;
|
||||
if (bowser.osname === 'Android') return OS_ENUM.ANDROID;
|
||||
// if (bowser.osname === 'iOS') return OS_ENUM.IOS; // @todo
|
||||
return OS_ENUM.WINDOWS;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,5 @@ const flagInUrl = flag => {
|
|||
};
|
||||
|
||||
module.exports = {
|
||||
CHROME_APP_RELEASED: true,
|
||||
CONTACT_US_POPUP: isStaging() && flagInUrl('CONTACT_US_POPUP')
|
||||
};
|
||||
|
|
|
@ -10,7 +10,6 @@ const Page = require('../../components/page/www/page.jsx');
|
|||
const render = require('../../lib/render.jsx');
|
||||
const detectOS = require('../../lib/detect-os.js').default;
|
||||
const OS_ENUM = require('../../lib/os-enum.js');
|
||||
const {CHROME_APP_RELEASED} = require('../../lib/feature-flags.js');
|
||||
const OSChooser = require('../../components/os-chooser/os-chooser.jsx');
|
||||
const InstallScratch = require('../../components/install-scratch/install-scratch.jsx');
|
||||
const {isDownloaded, isFromGooglePlay} = require('../../components/install-scratch/install-util.js');
|
||||
|
@ -52,14 +51,12 @@ class Download extends React.Component {
|
|||
width="40"
|
||||
/>
|
||||
<FormattedMessage
|
||||
id={CHROME_APP_RELEASED ? 'download.appTitle' :
|
||||
'download.title'}
|
||||
id="download.appTitle"
|
||||
/>
|
||||
</h1>
|
||||
<span className="download-description">
|
||||
<FormattedMessage
|
||||
id={CHROME_APP_RELEASED ? 'download.appIntro' :
|
||||
'download.intro'}
|
||||
id="download.appIntro"
|
||||
/>
|
||||
</span>
|
||||
</FlexRow>
|
||||
|
@ -82,24 +79,20 @@ class Download extends React.Component {
|
|||
/>
|
||||
macOS 10.13+
|
||||
</span>
|
||||
{CHROME_APP_RELEASED && (
|
||||
<React.Fragment>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/chromeos.svg"
|
||||
/>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/chromeos.svg"
|
||||
/>
|
||||
ChromeOS
|
||||
</span>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/android.svg"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
<img
|
||||
alt=""
|
||||
src="/svgs/extensions/android.svg"
|
||||
/>
|
||||
Android 6.0+
|
||||
</span>
|
||||
</React.Fragment>
|
||||
)}
|
||||
</span>
|
||||
</FlexRow>
|
||||
</FlexRow>
|
||||
</FlexRow>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
{
|
||||
"download.title": "Scratch Desktop",
|
||||
"download.intro": "You can install the Scratch Desktop editor to work on projects without an internet connection. This version will work on Windows and MacOS.",
|
||||
"download.appTitle": "Download the Scratch App",
|
||||
"download.appIntro": "Would you like to create and save Scratch projects without an internet connection? Download the free Scratch app.",
|
||||
"download.requirements": "Requirements",
|
||||
|
@ -23,7 +21,7 @@
|
|||
"download.macMoveToApplications" : "Open the .dmg file. Move Scratch Desktop into Applications.",
|
||||
"download.winMoveToApplications" : "Run the .exe file.",
|
||||
"download.doIHaveToDownload" : "Do I have to download an app to use Scratch?",
|
||||
"download.doIHaveToDownloadAnswer" : "No. You can also use the Scratch project editor in any web browser on any device by going to scratch.mit.edu and clicking \"Create\".",
|
||||
"download.doIHaveToDownloadAnswer" : "No. You can also use the Scratch project editor in most web browsers on most devices by going to scratch.mit.edu and clicking \"Create\".",
|
||||
"download.canIUseScratchLink" : "Can I use Scratch Link to connect to extensions?",
|
||||
"download.canIUseScratchLinkAnswer" : "Yes. However, you will need an Internet connection to use Scratch Link.",
|
||||
"download.canIUseExtensions" : "Can I connect to hardware extensions?",
|
||||
|
|
Loading…
Reference in a new issue