@@ -40,12 +40,14 @@ class Shards extends React.Component {
4040 shard1: '',
4141 shard2: '',
4242 shard3: '',
43+ passphrase: '',
4344 pointName: ''
4445 }
4546
4647 this.pointPlaceholder = placeholder(4)
4748 this.ticketPlaceholder = placeholder(16)
4849
50+ this.handlePassphraseInput = this.handlePassphraseInput.bind(this)
4951 this.handleShardInput = this.handleShardInput.bind(this)
5052 this.handlePointNameInput = this.handlePointNameInput.bind(this)
5153 }
@@ -60,19 +62,17 @@ class Shards extends React.Component {
6062 }
6163 }
6264
65+ handlePassphraseInput(passphrase) {
66+ this.setState({ passphrase })
67+ }
68+
6369 handlePointNameInput(pointName) {
6470 if (pointName.length < 15) {
6571 this.setState({ pointName })
6672 }
6773 }
6874
69− // buttonTriState = (wallet) => {
70− // if (wallet.isNothing()) return 'blue'
71− // if (wallet === false) return 'yellow'
72− // if (Maybe.Nothing.hasInstance(wallet)) return 'green'
73− // }
74−
75− async walletFromShards(shard1, shard2, shard3, pointName) {
75+ async walletFromShards(shard1, shard2, shard3, pointName, passphrase) {
7676 const { setWallet, setUrbitWallet } = this.props
7777
7878 const s1 = shard1 === '' ? undefined : shard1
@@ -89,10 +89,11 @@ class Shards extends React.Component {
8989 if (ticket !== undefined) {
9090 const urbitWallet = await kg.generateWallet({
9191 ticket: ticket,
92− ship: ob.patp2dec(pointName)
92+ ship: ob.patp2dec(pointName),
93+ passphrase: passphrase
9394 })
9495 const mnemonic = urbitWallet.ownership.seed
95− const wallet = walletFromMnemonic(mnemonic, DEFAULT_HD_PATH)
96+ const wallet = walletFromMnemonic(mnemonic, DEFAULT_HD_PATH, passphrase)
9697 setWallet(wallet)
9798 setUrbitWallet(Just(urbitWallet))
9899 }
@@ -100,7 +101,7 @@ class Shards extends React.Component {
100101
101102 render() {
102103 const { popRoute, pushRoute, wallet } = this.props
103− const { shard1, shard2, shard3, pointName } = this.state
104+ const { shard1, shard2, shard3, pointName, passphrase } = this.state
104105
105106 const phPoint = this.pointPlaceholder
106107 const phTick = this.ticketPlaceholder
@@ -176,13 +177,34 @@ class Shards extends React.Component {
176177 <InnerLabel>{ 'Shard 3' }</InnerLabel>
177178 </ShardInput>
178179
180+ <InputCaption>
181+ { 'If your wallet requires a passphrase, you may enter it below.' }
182+ </InputCaption>
183+
184+ <Input
185+ className='pt-8'
186+ prop-size='md'
187+ prop-format='innerLabel'
188+ name='passphrase'
189+ type='password'
190+ value={ passphrase }
191+ autocomplete='off'
192+ onChange={ this.handlePassphraseInput }>
193+ <InnerLabel>{'Passphrase'}</InnerLabel>
194+ </Input>
195+
179196 <Button
180197 disabled={ !ready }
181198 className={'mt-8'}
182199 prop-size={'lg wide'}
183200 // prop-color={this.buttonTriState(wallet)}
184201 onClick={() =>
185− this.walletFromShards(shard1, shard2, shard3, pointName)
202+ this.walletFromShards(
203+ shard1,
204+ shard2,
205+ shard3,
206+ pointName,
207+ passphrase)
186208 }>
187209 {'Unlock Wallet →'}
188210 </Button>