on master help sign in
Merge branch 'mino' into feat/ethereum-design-improvements
commitd89042cf3209a01ac55e9167cdb5933624d08605 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateTue 20 Aug 2019, 17:31 (7 years ago) parent8aab3df64dc313
29 files changed+259−113
package-lock.json+2−1 package.json+2−2 src/components/Accordion.js+17−3 src/components/Passport.js+1−1 src/components/Sigil.js+2−1 src/components/Tabs.js+27−26 src/components/View.js+1−1 src/indigo-react/components/Input.js+3−3 src/store/network.js+1−1 src/style/bridge.scss+4−18 src/style/form-reset.scss+47 src/style/index.scss+3 src/style/indigo-proposals.scss+8 src/views/AcceptTransfer.js+1−1 src/views/Activate/ActivateCode.js+20−6 src/views/Activate/PassportVerify.js+17−3 src/views/Admin/AdminCancelTransfer.js+1−1 src/views/Admin/AdminHome.js+2−2 src/views/Admin/AdminTransfer.js+1−1 src/views/Admin/Reticket/ReticketConfirm.js+3−2 src/views/Admin/Reticket/ReticketDownload.js+2−1 src/views/Admin/Reticket/ReticketExecute.js+11−12 src/views/Admin/Reticket/ReticketVerify.js+7−3 src/views/CreateGalaxy.js+1−1 src/views/IssueChild.js+1−1 src/views/Login/Hardware.js+17−2 src/views/Login/Ticket.js+53−18 src/views/Party/PartySetPoolSize.js+1−1 src/views/Points.js+3−1
package-lock.json+2−1
@@ -14369,7 +14369,8 @@
1436914369 "react-app-rewire-hot-loader": {
1437014370 "version": "2.0.1",
1437114371 "resolved": "https://registry.npmjs.org/react-app-rewire-hot-loader/-/react-app-rewire-hot-loader-2.0.1.tgz",
14372− "integrity": "sha512-XTUPOv5q0zJeEtXECfilDPfqCiktSVbIyupiqigIHOO8EMZec2YfNpwZzqDWMu3yfaEHRs54qRCcCgRR/1w3EQ=="
14372+ "integrity": "sha512-XTUPOv5q0zJeEtXECfilDPfqCiktSVbIyupiqigIHOO8EMZec2YfNpwZzqDWMu3yfaEHRs54qRCcCgRR/1w3EQ==",
14373+ "dev": true
1437314374 },
1437414375 "react-app-rewired": {
1437514376 "version": "2.1.3",
package.json+2−2
@@ -41,7 +41,6 @@
4141 "more-entropy": "^0.0.7",
4242 "prop-types": "^15.6.2",
4343 "react": "^16.8.6",
44− "react-app-rewire-hot-loader": "^2.0.1",
4544 "react-dom": "^16.8.6",
4645 "react-final-form": "^6.3.0",
4746 "react-final-form-arrays": "^3.1.0",
@@ -66,6 +65,7 @@
6665 "npm-run-all": "^4.1.3",
6766 "prettier": "^1.18.2",
6867 "react-app-rewire-aliases": "^0.2.0",
68+ "react-app-rewire-hot-loader": "^2.0.1",
6969 "react-app-rewired": "^2.1.3",
7070 "serve": "^11.0.1",
7171 "source-map-explorer": "^2.0.0",
@@ -79,7 +79,7 @@
7979 "checksum": "cd build && find . -exec shasum -a256 {} ';' > ../checksums.txt && cd ..",
8080 "zip": "zip -ur bridge-$npm_package_version.zip README.md bridge-https.py checksums.txt && cd build && zip -ur ../bridge-$npm_package_version.zip ./* && cd ..",
8181 "release": "npm install && npm run build && npm run checksum && npm run zip",
82− "pilot:ganache": "ganache-cli --blockTime 1 --networkId 1 -m 'benefit crew supreme gesture quantum web media hazard theory mercy wing kitten' > /dev/null &",
82+ "pilot:ganache": "ganache-cli --blockTime 1 --networkId 1 --host '0.0.0.0' -m 'benefit crew supreme gesture quantum web media hazard theory mercy wing kitten' > /dev/null &",
8383 "pilot:deploy": "cd node_modules/azimuth-solidity && truffle deploy",
8484 "pilot:setup": "npm run pilot:ganache && npm run pilot:deploy",
8585 "pilot": "HTTPS=true npm-run-all pilot:setup start pilot:cleanup --continue-on-error",
src/components/Accordion.js+17−3
@@ -1,4 +1,5 @@
11import React from 'react';
2+import cn from 'classnames';
23import { Grid, AccessoryIcon } from 'indigo-react';
34
45export default function Accordion({
@@ -22,9 +23,19 @@ export default function Accordion({
2223 <React.Fragment key={option.value}>
2324 <Grid.Item
2425 full
25− className="f5 pv3 rel clickable"
26− onClick={() => onTabChange(isActive ? undefined : option.value)}>
26+ className={cn('f5 pv3 rel', {
27+ clickable: !option.disabled,
28+ gray3: option.disabled,
29+ })}
30+ onClick={
31+ option.disabled
32+ ? null
33+ : () => onTabChange(isActive ? undefined : option.value)
34+ }>
2735 {option.text}
36+ {option.disabled && (
37+ <sup className="f6 lowercase">{option.disabled}</sup>
38+ )}
2839 <div
2940 className="abs"
3041 style={{
@@ -34,7 +45,10 @@ export default function Accordion({
3445 width: '44px',
3546 overflow: 'hidden',
3647 }}>
37− <AccessoryIcon className="black">
48+ <AccessoryIcon
49+ className={cn({
50+ black: !option.disabled,
51+ })}>
3852 {isActive ? '▲' : '▼'}
3953 </AccessoryIcon>
4054 </div>
src/components/Passport.js+1−1
@@ -78,7 +78,7 @@ function Passport({ point, className, ticket = null, address = Nothing() }) {
7878 <MaybeSigil patp={name} size={64} />
7979 </Grid.Item>
8080 <Grid.Item as={Flex} cols={[4, 13]} col justify="between">
81− <Flex.Item className="mono white f5">{visualName}</Flex.Item>
81+ <Flex.Item className="mono white f5 pb2">{visualName}</Flex.Item>
8282 <Flex.Item as={Flex} col>
8383 <Flex.Item as={Text} className="mono f6 f5-ns gray4 uppercase">
8484 Birth Time
src/components/Sigil.js+2−1
@@ -4,8 +4,9 @@ export default function Sigil({ patp, size, colors, ...rest }) {
44 return sigil({
55 patp,
66 renderer: reactRenderer,
7− style: { width: '100%', height: '100%' }, //NOTE scale to container
7+ style: { width: '100%', height: '100%' }, // NOTE: scale to container
88 size,
9+ margin: size / 8,
910 colors,
1011 ...rest,
1112 });
src/components/Tabs.js+27−26
@@ -14,33 +14,34 @@ export default function Tabs({
1414
1515 return (
1616 <Grid className={className}>
17− <Grid.Item full as={Flex} wrap className="b-gray3 bb1">
18− {options.map((option, i) => {
19− const isActive = option.value === currentTab;
20− const isFirst = i === 0;
17+ <Grid.Item full as={Flex} className="b-gray3 bb1 scroll-x hidden-y">
18+ <Flex.Item as={Flex}>
19+ {options.map((option, i) => {
20+ const isActive = option.value === currentTab;
21+ const isFirst = i === 0;
2122
22− return (
23− <Flex.Item
24− key={option.value}
25− onClick={() => onTabChange(option.value)}
26− className={cn(
27− 'f5 pv3 clickable',
28− {
29− 'black b-black bb1': isActive,
30− gray3: !isActive,
31− },
32− {
33− // all items have right margin/padding
34− 'mr2 pr2': true,
35− // the first one is flush to the left
36− 'ml2 pl2': !isFirst,
37− }
38− )}
39− style={{ marginBottom: '-1px' }}>
40− {option.text}
41− </Flex.Item>
42− );
43− })}
23+ return (
24+ <Flex.Item
25+ key={option.value}
26+ onClick={() => onTabChange(option.value)}
27+ className={cn(
28+ 'f5 pv3 clickable nowrap',
29+ {
30+ 'black b-black bb1': isActive,
31+ gray3: !isActive,
32+ },
33+ {
34+ // all items have right margin/padding
35+ 'mr2 pr2': true,
36+ // the first one is flush to the left
37+ 'ml2 pl2': !isFirst,
38+ }
39+ )}>
40+ {option.text}
41+ </Flex.Item>
42+ );
43+ })}
44+ </Flex.Item>
4445 </Grid.Item>
4546 <Grid.Item full as={Tab} {...rest} />
4647 </Grid>
src/components/View.js+1−1
@@ -62,7 +62,7 @@ function View({
6262 <Flex.Item as={Footer.Target} />
6363 </Flex.Item>
6464
65− <Flex.Item style={{ width: '48px' }} className={cn(insetPadding)} />
65+ <Flex.Item style={{ width: '48px' }} />
6666 </Flex>
6767 );
6868}
src/indigo-react/components/Input.js+3−3
@@ -78,8 +78,8 @@ export default function Input({
7878 flex
7979 as={BaseComponent}
8080 {...rest}
81− // NOTE: 24px = 12px * 2 (from p3 styling)
82− style={type === 'textarea' ? { minHeight: 'calc(1rem + 24px)' } : {}}
81+ // NOTE: 1.15 from input line-height, 24px = 12px * 2 (from p3 styling)
82+ style={type === 'textarea' ? { minHeight: 'calc(1.5rem * 3)' } : {}}
8383 className={cn(
8484 'b b1 p3 outline-none bs-none',
8585 { mono },
@@ -110,7 +110,7 @@ export default function Input({
110110 top: 0,
111111 right: 0,
112112 height: '100%',
113− width: '44px',
113+ width: 'calc(1.5em + 24px)',
114114 overflow: 'hidden',
115115 }}>
116116 {accessory}
src/store/network.js+1−1
@@ -41,7 +41,7 @@ function _useNetwork(initialNetworkType = null) {
4141 switch (networkType) {
4242 case NETWORK_TYPES.LOCAL: {
4343 const protocol = isDevelopment ? 'ws' : 'wss';
44− const endpoint = `${protocol}://localhost:8545`;
44+ const endpoint = `${protocol}://${document.location.hostname}:8545`;
4545
4646 return initWeb3(
4747 new Web3.providers.WebsocketProvider(endpoint),
src/style/bridge.scss+4−18
@@ -1,18 +1,4 @@
1−@keyframes autofill {
2− to {
3− color: #000;
4− background: transparent;
5− }
6−}
7−
8−/* avoid yellow autofill highlight on browsers that respect this attribute */
9−input:-webkit-autofill {
10− animation-name: autofill;
11− animation-fill-mode: both;
12−
13− -webkit-animation-name: autofill;
14− -webkit-animation-fill-mode: both;
15−}
1+$handle-extent: 24px; // $lh-regular
162
173// min-height the top elements so footer behavior works correctly
184html {
@@ -36,7 +22,7 @@ input[type='range'] {
3622
3723 /* Chrome */
3824 &::-webkit-slider-runnable-track {
39− height: 24px;
25+ height: $handle-extent;
4026 -webkit-appearance: none;
4127 background-color: #e6e6e6;
4228 margin-top: -1px;
@@ -44,7 +30,7 @@ input[type='range'] {
4430
4531 &::-webkit-slider-thumb {
4632 -webkit-appearance: none;
47− width: 24px;
33+ width: $handle-extent;
4834 height: 100%;
4935 background-color: #000;
5036 border: none;
@@ -63,7 +49,7 @@ input[type='range'] {
6349 }
6450
6551 &::-moz-range-thumb {
66− width: 24px;
52+ width: $handle-extent;
6753 height: 100%;
6854 background-color: #000;
6955 border: none;
src/style/form-reset.scssnew file+47
@@ -0,0 +1,47 @@
1+$form-padding: 24px; // indigo pv3
2+$form-line-height: 1.5rem; // $lh-regular
3+
4+@keyframes autofill {
5+ to {
6+ color: #000;
7+ background: transparent;
8+ }
9+}
10+
11+input,
12+button,
13+textarea,
14+select {
15+ padding: 0;
16+ margin: 0;
17+ border-radius: 0;
18+ -webkit-appearance: none;
19+
20+ &:focus,
21+ &:hover,
22+ &:active {
23+ outline: 0;
24+ }
25+
26+ &::-moz-focus-inner {
27+ border: 0;
28+ }
29+}
30+
31+input {
32+ // enforce border-box
33+ box-sizing: border-box;
34+
35+ // enforce height & line-height for accessories
36+ height: calc(#{$form-line-height} + #{$form-padding});
37+ line-height: $form-line-height;
38+
39+ // avoid yellow autofill highlight on browsers that respect this attribute
40+ &:-webkit-autofill {
41+ animation-name: autofill;
42+ animation-fill-mode: both;
43+
44+ -webkit-animation-name: autofill;
45+ -webkit-animation-fill-mode: both;
46+ }
47+}
src/style/index.scss+3
@@ -1,3 +1,6 @@
1+/* Form Reset */
2+@import './form-reset.scss';
3+
14/* Indigo */
25@import '../indigo-react/indigo.css';
36@import './indigo-proposals.scss';
src/style/indigo-proposals.scss+8
@@ -52,3 +52,11 @@
5252.arial {
5353 font-family: Arial, monospace;
5454}
55+
56+.scroll-x {
57+ overflow-x: auto;
58+}
59+
60+.hidden-y {
61+ overflow-y: hidden;
62+}
src/views/AcceptTransfer.js+1−1
@@ -73,7 +73,7 @@ export default function AcceptTransfer() {
7373 <Grid.Item
7474 full
7575 as={Text}
76− className={cn('f5', {
76+ className={cn('f5 wrap', {
7777 green3: completed,
7878 })}>
7979 {completed
src/views/Activate/ActivateCode.js+20−6
@@ -1,7 +1,7 @@
11import React, { useCallback, useMemo, useRef } from 'react';
22import { Just } from 'folktale/maybe';
33import * as azimuth from 'azimuth-js';
4−import { Grid, H4 } from 'indigo-react';
4+import { Grid, H4, CheckboxInput } from 'indigo-react';
55import { FORM_ERROR } from 'final-form';
66
77import View from 'components/View';
@@ -31,6 +31,7 @@ import {
3131 composeValidator,
3232 buildPatqValidator,
3333 hasErrors,
34+ buildCheckboxValidator,
3435} from 'form/validators';
3536import FormError from 'form/FormError';
3637
@@ -79,7 +80,11 @@ export default function ActivateCode() {
7980 }, []);
8081
8182 const validate = useMemo(
82− () => composeValidator({ ticket: buildPatqValidator() }, validateForm),
83+ () =>
84+ composeValidator(
85+ { ticket: buildPatqValidator(), showTicket: buildCheckboxValidator() },
86+ validateForm
87+ ),
8388 [validateForm]
8489 );
8590
@@ -132,9 +137,10 @@ export default function ActivateCode() {
132137 [contracts, setDerivedPoint, setDerivedWallet, setInviteWallet]
133138 );
134139
135− const initialValues = useMemo(() => ({ ticket: impliedTicket || '' }), [
136− impliedTicket,
137− ]);
140+ const initialValues = useMemo(
141+ () => ({ ticket: impliedTicket || '', showTicket: true }),
142+ [impliedTicket]
143+ );
138144
139145 return (
140146 <View inset>
@@ -148,16 +154,24 @@ export default function ActivateCode() {
148154 onSubmit={onSubmit}
149155 afterSubmit={goToPassport}
150156 initialValues={initialValues}>
151− {({ validating, submitting, handleSubmit }) => (
157+ {({ validating, values, submitting, handleSubmit }) => (
152158 <>
153159 <Grid.Item
154160 full
155161 as={TicketInput}
162+ type={values.showTicket ? 'text' : 'password'}
156163 name="ticket"
157164 label="Activation Code"
158165 disabled={!activationAllowed}
159166 />
160167
168+ <Grid.Item
169+ full
170+ as={CheckboxInput}
171+ name="showTicket"
172+ label="Show"
173+ />
174+
161175 <Grid.Item full as={FormError} />
162176
163177 <Grid.Item
src/views/Activate/PassportVerify.js+17−3
@@ -1,5 +1,5 @@
11import React, { useCallback, useMemo } from 'react';
2−import { Grid, P } from 'indigo-react';
2+import { Grid, P, CheckboxInput } from 'indigo-react';
33
44import * as need from 'lib/need';
55import { useLocalRouter } from 'lib/LocalRouter';
@@ -8,7 +8,11 @@ import { isDevelopment } from 'lib/flags';
88
99import SubmitButton from 'form/SubmitButton';
1010import { TicketInput } from 'form/Inputs';
11−import { composeValidator, buildPatqValidator } from 'form/validators';
11+import {
12+ composeValidator,
13+ buildPatqValidator,
14+ buildCheckboxValidator,
15+} from 'form/validators';
1216import BridgeForm from 'form/BridgeForm';
1317
1418import { useActivateFlow } from './ActivateFlow';
@@ -29,6 +33,7 @@ export default function PassportVerify({ className }) {
2933 ticket: buildPatqValidator([
3034 validateExactly(ticket, 'Does not match expected master ticket.'),
3135 ]),
36+ showTicket: buildCheckboxValidator(),
3237 }),
3338 [ticket]
3439 );
@@ -36,6 +41,7 @@ export default function PassportVerify({ className }) {
3641 const initialValues = useMemo(
3742 () => ({
3843 ticket: STUB_VERIFY_TICKET ? ticket : undefined,
44+ showTicket: true,
3945 }),
4046 [ticket]
4147 );
@@ -52,15 +58,23 @@ export default function PassportVerify({ className }) {
5258 validate={validate}
5359 afterSubmit={goToTransfer}
5460 initialValues={initialValues}>
55− {({ handleSubmit }) => (
61+ {({ values, handleSubmit }) => (
5662 <>
5763 <Grid.Item
5864 full
5965 as={TicketInput}
66+ type={values.showTicket ? 'text' : 'password'}
6067 name="ticket"
6168 label="Master Ticket"
6269 />
6370
71+ <Grid.Item
72+ full
73+ as={CheckboxInput}
74+ name="showTicket"
75+ label="Show"
76+ />
77+
6478 <Grid.Item full as={FormError} />
6579
6680 <Grid.Item
src/views/Admin/AdminCancelTransfer.js+1−1
@@ -65,7 +65,7 @@ export default function AdminCancelTransfer() {
6565 <Grid.Item
6666 full
6767 as={Text}
68− className={cn('f5', {
68+ className={cn('f5 wrap', {
6969 green3: completed,
7070 })}>
7171 {completed
src/views/Admin/AdminHome.js+2−2
@@ -59,8 +59,8 @@ export default function AdminHome() {
5959 full
6060 as={DownloadKeyfileButton}
6161 {...keyfileBind}
62− detail="Download your Arvo Keyfile">
63− Redownload Arvo Keyfile
62+ detail="Download your current Arvo Keyfile">
63+ Download Arvo Keyfile
6464 </Grid.Item>
6565 <Grid.Divider />
6666 <Grid.Item
src/views/Admin/AdminTransfer.js+1−1
@@ -78,7 +78,7 @@ export default function AdminTransfer() {
7878 <Grid.Item
7979 full
8080 as={Text}
81− className={cn('f5', {
81+ className={cn('f5 wrap', {
8282 green3: completed,
8383 })}>
8484 {completed
src/views/Admin/Reticket/ReticketConfirm.js+3−2
@@ -65,12 +65,12 @@ export default function ReticketConfirm({ newWallet, setNewWallet }) {
6565 });
6666
6767 return (
68− <Grid gap={4} className="mt4">
68+ <Grid className="mt4">
6969 <Grid.Item full as={Text}>
7070 Reticketing is the process of generating a completely fresh wallet and
7171 transferring ownership of your point to that wallet.
7272 </Grid.Item>
73− <Grid.Item full as={WarningBox}>
73+ <Grid.Item full as={WarningBox} className="mt4">
7474 Beware, this resets your proxy addresses; if you're using smart
7575 contracts, this might break them! It will also change your networking
7676 keys!
@@ -79,6 +79,7 @@ export default function ReticketConfirm({ newWallet, setNewWallet }) {
7979 full
8080 as={ForwardButton}
8181 solid
82+ className="mt4"
8283 accessory={blinkIf(Nothing.hasInstance(newWallet))}
8384 disabled={Nothing.hasInstance(newWallet)}
8485 onClick={goDownload}>
src/views/Admin/Reticket/ReticketDownload.js+2−1
@@ -20,13 +20,14 @@ export default function ReticketDownload({ newWallet }) {
2020 const goVerify = useCallback(() => push(names.VERIFY), [push, names]);
2121
2222 return (
23− <Grid gap={4} className="mt4">
23+ <Grid className="mt4">
2424 <Grid.Item full as={Text}>
2525 Download the thing, and keep it somewhere safe!
2626 </Grid.Item>
2727 <Grid.Item
2828 full
2929 as={!downloaded ? DownloadButton : ForwardButton}
30+ className="mt4"
3031 disabled={Nothing.hasInstance(newWallet)}
3132 onClick={!downloaded ? download : goVerify}
3233 success={downloaded}
src/views/Admin/Reticket/ReticketExecute.js+11−12
@@ -110,12 +110,12 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
110110 if (generalError) {
111111 return (
112112 <>
113− <Grid.Item full>
113+ <Grid.Item full className="mt4">
114114 <ErrorText>{generalError.message.toString()}</ErrorText>
115115 </Grid.Item>
116116 <Grid.Item
117117 full
118− className="mt3"
118+ className="mt4"
119119 as={RestartButton}
120120 solid
121121 onClick={goToRestart}>
@@ -127,7 +127,7 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
127127
128128 if (needFunds) {
129129 return (
130− <Grid.Item full>
130+ <Grid.Item full className="mt4">
131131 <Highlighted warning>
132132 The address {needFunds.address} needs at least{' '}
133133 {fromWei(needFunds.minBalance)} ETH and currently has{' '}
@@ -139,21 +139,21 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
139139 }
140140
141141 return (
142− <Grid.Item full as={WarningBox}>
142+ <Grid.Item full as={WarningBox} className="mt4">
143143 Never give your Master Ticket to anyone
144144 </Grid.Item>
145145 );
146146 };
147147
148148 return (
149− <Grid gap={4} className="mt4">
149+ <Grid className="mt4">
150150 <Grid.Item full as={H4}>
151151 {labelForProgress(progress)}
152152 </Grid.Item>
153153
154154 {isDone ? (
155155 <>
156− <Grid.Item full as={Text}>
156+ <Grid.Item full as={Text} className="mt4">
157157 Your changes are now reflected on-chain and you can use the new
158158 ticket to manage your point.
159159 </Grid.Item>
@@ -161,6 +161,7 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
161161 full
162162 as={ForwardButton}
163163 solid
164+ className="mt4"
164165 accessory="↺"
165166 onClick={loginAndGoHome}>
166167 Login with New Master Ticket
@@ -168,13 +169,11 @@ export default function ReticketExecute({ newWallet, setNewWallet }) {
168169 </>
169170 ) : (
170171 <>
171− <Grid.Item full as={Grid} className="mt3" gap={3}>
172+ <Grid.Item full as={Grid} className="mt4" gap={3}>
172173 <Grid.Item full as={LoadingBar} progress={progress} />
173− <Grid.Item full>
174− <Text className="f5 green4">
175− This process can take up to 5 minutes to complete. Don't close
176− this page until the process is complete.
177− </Text>
174+ <Grid.Item full as={Text} className="f5 green4">
175+ This process can take up to 5 minutes to complete. Don't close
176+ this page until the process is complete.
178177 </Grid.Item>
179178 </Grid.Item>
180179
src/views/Admin/Reticket/ReticketVerify.js+7−3
@@ -1,5 +1,5 @@
11import React, { useCallback, useMemo } from 'react';
2−import { Text, Grid } from 'indigo-react';
2+import { Text, Grid, CheckboxInput } from 'indigo-react';
33
44import { useLocalRouter } from 'lib/LocalRouter';
55import { validateExactly } from 'lib/validators';
@@ -37,7 +37,7 @@ export default function ReticketVerify({ newWallet }) {
3737 const goExecute = useCallback(() => push(names.EXECUTE), [push, names]);
3838
3939 return (
40− <Grid gap={4} className="mt4">
40+ <Grid className="mt4">
4141 <Grid.Item full as={Text}>
4242 Verify New Master Ticket
4343 </Grid.Item>
@@ -45,15 +45,19 @@ export default function ReticketVerify({ newWallet }) {
4545 validate={validate}
4646 afterSubmit={goExecute}
4747 initialValues={initialValues}>
48− {({ handleSubmit }) => (
48+ {({ handleSubmit, values }) => (
4949 <>
5050 <Grid.Item
5151 full
5252 as={TicketInput}
53+ className="mt4"
54+ type={values.showTicket ? 'text' : 'password'}
5355 name="ticket"
5456 label="New master ticket"
5557 />
5658
59+ <Grid.Item full as={CheckboxInput} name="showTicket" label="Show" />
60+
5761 <Grid.Item full as={FormError} />
5862
5963 <Grid.Item full as={SubmitButton} handleSubmit={handleSubmit}>
src/views/CreateGalaxy.js+1−1
@@ -123,7 +123,7 @@ export default function CreateGalaxy() {
123123 <Grid.Item
124124 full
125125 as={Text}
126− className={cn('f5', {
126+ className={cn('f5 wrap', {
127127 green3: completed,
128128 })}>
129129 {values.galaxyName} has been created and can be claimed by{' '}
src/views/IssueChild.js+1−1
@@ -149,7 +149,7 @@ export default function IssueChild() {
149149 <Grid.Item
150150 full
151151 as={Text}
152− className={cn('f5', {
152+ className={cn('f5 wrap', {
153153 green3: completed,
154154 })}>
155155 {values.point} has been spawned and can be claimed by{' '}
src/views/Login/Hardware.js+17−2
@@ -1,4 +1,6 @@
1−import React, { useState } from 'react';
1+import React, { useMemo, useState } from 'react';
2+
3+import useBreakpoints from 'lib/useBreakpoints';
24
35import Accordion from 'components/Accordion';
46
@@ -23,11 +25,24 @@ const OPTIONS = [
2325export default function Hardware({ className, ...rest }) {
2426 const [currentTab, setCurrentTab] = useState(undefined);
2527
28+ // using breakpoint to decide if we're on mobile or not
29+ // see ActivateCode for more details on this approach
30+ const hardwareAllowed = useBreakpoints([false, true, true]);
31+
32+ const options = useMemo(
33+ () =>
34+ OPTIONS.map(option => ({
35+ ...option,
36+ disabled: !hardwareAllowed && ' not availble on mobile',
37+ })),
38+ [hardwareAllowed]
39+ );
40+
2641 return (
2742 <Accordion
2843 className={className}
2944 views={VIEWS}
30− options={OPTIONS}
45+ options={options}
3146 currentTab={currentTab}
3247 onTabChange={setCurrentTab}
3348 //
src/views/Login/Ticket.js+53−18
@@ -3,7 +3,7 @@ import { Just } from 'folktale/maybe';
33import cn from 'classnames';
44import * as azimuth from 'azimuth-js';
55import * as kg from 'urbit-key-generation/dist/index';
6−import { Grid, CheckboxInput } from 'indigo-react';
6+import { Grid, CheckboxInput, Flex, ToggleInput } from 'indigo-react';
77import { FORM_ERROR } from 'final-form';
88
99import { useNetwork } from 'store/network';
@@ -116,6 +116,7 @@ export default function Ticket({ className, goHome }) {
116116 () =>
117117 composeValidator(
118118 {
119+ useAdvanced: buildCheckboxValidator(),
119120 usePassphrase: buildCheckboxValidator(),
120121 useShards: buildCheckboxValidator(),
121122 point: buildPointValidator(4),
@@ -123,6 +124,7 @@ export default function Ticket({ className, goHome }) {
123124 shard1: buildPatqValidator(),
124125 shard2: buildPatqValidator(),
125126 shard3: buildPatqValidator(),
127+ showTicket: buildCheckboxValidator(),
126128 passphrase: buildPassphraseValidator(),
127129 },
128130 validateForm
@@ -135,6 +137,8 @@ export default function Ticket({ className, goHome }) {
135137 point: impliedPoint || '',
136138 usePasshrase: false,
137139 useShards: false,
140+ showTicket: true,
141+ useAdvanced: false,
138142 }),
139143 [impliedPoint]
140144 );
@@ -146,7 +150,7 @@ export default function Ticket({ className, goHome }) {
146150 onSubmit={onSubmit}
147151 afterSubmit={goHome}
148152 initialValues={initialValues}>
149− {({ handleSubmit, submitting }) => (
153+ {({ handleSubmit, values, submitting }) => (
150154 <>
151155 <Grid.Item full as={PointInput} name="point" />
152156
@@ -154,17 +158,38 @@ export default function Ticket({ className, goHome }) {
154158 <Grid.Item
155159 full
156160 as={TicketInput}
161+ type={values.showTicket ? 'text' : 'password'}
157162 name="ticket"
158163 label="Master Ticket"
159164 />
160165 </Condition>
161166
162167 <Condition when="useShards" is={true}>
163− <Grid.Item full as={TicketInput} name="shard1" label="Shard 1" />
164− <Grid.Item full as={TicketInput} name="shard2" label="Shard 2" />
165− <Grid.Item full as={TicketInput} name="shard3" label="Shard 3" />
168+ <Grid.Item
169+ full
170+ as={TicketInput}
171+ type={values.showTicket ? 'text' : 'password'}
172+ name="shard1"
173+ label="Shard 1"
174+ />
175+ <Grid.Item
176+ full
177+ as={TicketInput}
178+ type={values.showTicket ? 'text' : 'password'}
179+ name="shard2"
180+ label="Shard 2"
181+ />
182+ <Grid.Item
183+ full
184+ as={TicketInput}
185+ type={values.showTicket ? 'text' : 'password'}
186+ name="shard3"
187+ label="Shard 3"
188+ />
166189 </Condition>
167190
191+ <Grid.Item full as={CheckboxInput} name="showTicket" label="Show" />
192+
168193 <Condition when="usePassphrase" is={true}>
169194 <Grid.Item
170195 full
@@ -174,19 +199,6 @@ export default function Ticket({ className, goHome }) {
174199 />
175200 </Condition>
176201
177− <Grid.Item
178− full
179− as={CheckboxInput}
180− name="usePassphrase"
181− label="Passphrase"
182− />
183− <Grid.Item
184− full
185− as={CheckboxInput}
186− name="useShards"
187− label="Shards"
188− />
189−
190202 <Grid.Item full as={FormError} />
191203
192204 <Grid.Item full as={SubmitButton} handleSubmit={handleSubmit}>
@@ -198,6 +210,29 @@ export default function Ticket({ className, goHome }) {
198210 : 'Continue'
199211 }
200212 </Grid.Item>
213+
214+ <Grid.Item full as={Flex} justify="between">
215+ <Flex.Item
216+ as={ToggleInput}
217+ name="useAdvanced"
218+ label="Advanced"
219+ inverseLabel="Hide"
220+ />
221+ <Condition when="useAdvanced" is={true}>
222+ <Flex.Item as={Flex}>
223+ <Flex.Item
224+ as={CheckboxInput}
225+ name="usePassphrase"
226+ label="Passphrase"
227+ />
228+ <Flex.Item
229+ as={CheckboxInput}
230+ name="useShards"
231+ label="Shards"
232+ />
233+ </Flex.Item>
234+ </Condition>
235+ </Grid.Item>
201236 </>
202237 )}
203238 </BridgeForm>
src/views/Party/PartySetPoolSize.js+1−1
@@ -116,7 +116,7 @@ export default function PartySetPoolSize() {
116116 <Grid.Item
117117 full
118118 as={Text}
119− className={cn('f5', {
119+ className={cn('f5 wrap', {
120120 green3: completed,
121121 })}>
122122 {completed
src/views/Points.js+3−1
@@ -40,7 +40,9 @@ const PointList = function({ points, className, actions, ...rest }) {
4040 return (
4141 <Grid gap={3} className={className}>
4242 {points.map((point, i) => (
43− <Grid.Item half={(i % 2) + 1} key={point}>
43+ <Grid.Item
44+ key={point}
45+ className={`full half-${(i % 2) + 1}-md half-${(i % 2) + 1}-lg`}>
4446 <Flex col>
4547 <Passport.Mini
4648 point={point}