@@ -21,6 +21,8 @@ import { useLocalRouter } from 'lib/LocalRouter';
21import useImpliedTicket from 'lib/useImpliedTicket';
21import useImpliedTicket from 'lib/useImpliedTicket';
22import timeout from 'lib/timeout';
22import timeout from 'lib/timeout';
23import useHasDisclaimed from 'lib/useHasDisclaimed';
23import useHasDisclaimed from 'lib/useHasDisclaimed';
24+import useBreakpoints from 'lib/useBreakpoints';
25+import WarningBox from 'components/WarningBox';
25import BridgeForm from 'form/BridgeForm';
27import BridgeForm from 'form/BridgeForm';
26import SubmitButton from 'form/SubmitButton';
28import SubmitButton from 'form/SubmitButton';
@@ -42,6 +44,12 @@ export default function ActivateCode() {
42 derivedPoint,
44 derivedPoint,
43 setDerivedPoint,
45 setDerivedPoint,
44 } = useActivateFlow();
46 } = useActivateFlow();
47+ // this is a pretty naive way to detect if we're on a mobile device
48+ // (i.e. we're checking the width of the screen)
49+ // but it will suffice for the 99% case and if someone wants to get around it
50+ // well by golly they're allowed to turn their phone into landscape mode
52+ const activationAllowed = useBreakpoints([false, true, true]);
46 const goToLogin = useCallback(() => history.popAndPush(ROUTE_NAMES.LOGIN), [
54 const goToLogin = useCallback(() => history.popAndPush(ROUTE_NAMES.LOGIN), [
@@ -129,6 +137,7 @@ export default function ActivateCode() {
129 as={TicketInput}
137 as={TicketInput}
130 name="ticket"
138 name="ticket"
131 label="Activation Code"
139 label="Activation Code"
140+ disabled={!activationAllowed}
134 <Grid.Item full as={FormError} />
143 <Grid.Item full as={FormError} />
@@ -144,6 +153,12 @@ export default function ActivateCode() {
144 ? 'Generating...'
153 ? 'Generating...'
146 </Grid.Item>
155 </Grid.Item>
157+ {!activationAllowed && (
158+ <Grid.Item full as={WarningBox} className="mt4">
159+ For your security, please access Bridge on a desktop device.
149 </BridgeForm>
164 </BridgeForm>