Skip to content
Snippets Groups Projects
Commit 85629423 authored by Eric Rosenbaum's avatar Eric Rosenbaum
Browse files

Add prescan step

parent 2b413ca0
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ import keyMirror from 'keymirror'; ...@@ -5,6 +5,7 @@ import keyMirror from 'keymirror';
import Box from '../box/box.jsx'; import Box from '../box/box.jsx';
import Modal from '../modal/modal.jsx'; import Modal from '../modal/modal.jsx';
import PrescanStep from './prescan-step.jsx';
import ScanningStep from '../../containers/scanning-step.jsx'; import ScanningStep from '../../containers/scanning-step.jsx';
import ConnectingStep from './connecting-step.jsx'; import ConnectingStep from './connecting-step.jsx';
import ConnectedStep from './connected-step.jsx'; import ConnectedStep from './connected-step.jsx';
...@@ -14,6 +15,7 @@ import UnavailableStep from './unavailable-step.jsx'; ...@@ -14,6 +15,7 @@ import UnavailableStep from './unavailable-step.jsx';
import styles from './connection-modal.css'; import styles from './connection-modal.css';
const PHASES = keyMirror({ const PHASES = keyMirror({
prescan: null,
scanning: null, scanning: null,
connecting: null, connecting: null,
connected: null, connected: null,
...@@ -31,6 +33,7 @@ const ConnectionModalComponent = props => ( ...@@ -31,6 +33,7 @@ const ConnectionModalComponent = props => (
onRequestClose={props.onCancel} onRequestClose={props.onCancel}
> >
<Box className={styles.body}> <Box className={styles.body}>
{props.phase === PHASES.prescan && <PrescanStep {...props} />}
{props.phase === PHASES.scanning && <ScanningStep {...props} />} {props.phase === PHASES.scanning && <ScanningStep {...props} />}
{props.phase === PHASES.connecting && <ConnectingStep {...props} />} {props.phase === PHASES.connecting && <ConnectingStep {...props} />}
{props.phase === PHASES.connected && <ConnectedStep {...props} />} {props.phase === PHASES.connected && <ConnectedStep {...props} />}
......
import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react';
import Box from '../box/box.jsx';
import Dots from './dots.jsx';
import radarIcon from './icons/searching.png';
import bluetoothIcon from './icons/bluetooth-white.svg';
import styles from './connection-modal.css';
const PrescanStep = props => (
<Box className={styles.body}>
<Box className={styles.activityArea}>
<Box className={styles.centeredRow}>
<div className={styles.centeredRow}>
<img
className={styles.radar}
src={radarIcon}
/>
<img
className={styles.bluetoothConnectingIcon}
src={bluetoothIcon}
/>
</div>
</Box>
</Box>
<Box className={styles.bottomArea}>
<Box className={styles.instructions}>
{props.connectingMessage}
</Box>
<Dots
counter={1}
total={4}
/>
<button
className={styles.connectionButton}
// onClick={props.onRefresh}
>
<FormattedMessage
defaultMessage="Search for WeDo"
description="Button in prompt for starting a search"
id="gui.connection.startSearch"
/>
</button>
</Box>
</Box>
);
PrescanStep.propTypes = {
connectingMessage: PropTypes.node.isRequired
};
export default PrescanStep;
...@@ -153,6 +153,19 @@ export default [ ...@@ -153,6 +153,19 @@ export default [
/> />
), ),
featured: true, featured: true,
disabled: true disabled: false,
launchDeviceConnectionFlow: true,
startWithPrescanStep: true,
deviceImage: ev3DeviceImage,
smallDeviceImage: ev3MenuImage,
connectingMessage: (
<FormattedMessage
defaultMessage="Connecting"
description="Message to help people connect to their WeDo."
id="gui.extension.wedo2.connectingMessage"
/>
),
helpLink: 'https://scratch.mit.edu/wedo'
} }
]; ];
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