import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; import { pair } from '../redux/actions'; import { useShallowEqualSelector } from '../utils'; import { makeStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/Button'; import Typography from '@material-ui/core/Typography'; import FormControl from '@material-ui/core/FormControl'; import FormHelperText from '@material-ui/core/FormHelperText'; import Box from '@material-ui/core/Box'; import Link from '@material-ui/core/Link'; import { AboutDialog } from './about-dialog'; import { TopMenu } from './topmenu'; import ChromeIconPath from '../images/chrome-icon.svg'; const useStyles = makeStyles(theme => ({ main: { position: 'relative', flex: '1 1 auto', display: 'flex', justifyContent: 'center', flexDirection: 'column', alignItems: 'center', }, button: { marginTop: theme.spacing(3), minWidth: 150, }, spacing: { marginTop: theme.spacing(1), }, chromeLogo: { marginTop: theme.spacing(1), width: 96, height: 96, }, why: { alignSelf: 'flex-start', marginTop: theme.spacing(3), }, headBox: { display: 'flex', justifyContent: 'space-between', }, })); export const Welcome = (props: {}) => { const classes = useStyles(); const dispatch = useDispatch(); const { browserSupported, pairingFailed, pairingMessage } = useShallowEqualSelector(state => state.appState); if (pairingMessage.toLowerCase().match(/denied/)) { // show linux instructions } // Access denied. const [showWhyUnsupported, setWhyUnsupported] = useState(false); const handleLearnWhy = (event: React.SyntheticEvent) => { event.preventDefault(); setWhyUnsupported(true); }; return ( Web MiniDisc Brings NetMD Devices to the Web {browserSupported ? ( Press the button to connect to a NetMD device {pairingMessage} ) : ( This Web browser is not supported.  Learn Why Chrome Logo Try using{' '} Chrome {' '} instead {showWhyUnsupported ? ( <> Web MiniDisc requires a browser that supports both{' '} WebUSB {' '} and{' '} WebAssembly .
  • WebUSB is needed to control the NetMD device via the USB connection to your computer.
  • WebAssembly is used to convert the music to a MiniDisc compatible format
) : null}
)}
); };