Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new account button in empty tray #1433

Merged
merged 2 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions app/tray/AccountSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import AccountController from './AccountController'
import { accountSort as byCreation } from '../../../resources/domain/account'
import { matchFilter } from '../../../resources/utils'

import { Cluster, ClusterBox, ClusterValue, ClusterRow } from '../../../resources/Components/Cluster'

import svg from '../../../resources/svg'
import link from '../../../resources/link'

Expand Down Expand Up @@ -41,8 +43,10 @@ class AccountSelector extends React.Component {
}

renderAccountFilter() {
const accounts = this.store('main.accounts')
const open = this.store('selected.open')
if (open) return null
if (Object.keys(accounts).length === 0 || open) return null

return (
<div className='panelFilterMain'>
<div className='panelFilterIcon'>{svg.search(12)}</div>
Expand Down Expand Up @@ -102,7 +106,30 @@ class AccountSelector extends React.Component {
/>
))
) : Object.keys(accounts).length === 0 ? (
<div className='noSigners'>{'No Accounts Added'}</div>
<ClusterBox style={{ pointerEvents: 'auto' }}>
<Cluster>
<ClusterRow>
<ClusterValue>
<div className='noSigners'>{'No Accounts Added'}</div>
</ClusterValue>
</ClusterRow>
<ClusterRow>
<ClusterValue
onClick={() => {
link.send('tray:action', 'navDash', {
view: 'accounts',
data: { showAddAccounts: true }
})
}}
>
<div className='newAccountButton'>
<div className='newAccountIcon'>{svg.accounts(16)}</div>
<div className='newAccountText'>{'Add New Account'}</div>
</div>
</ClusterValue>
</ClusterRow>
</Cluster>
</ClusterBox>
) : (
<div className='noSigners'>{'No Matching Accounts'}</div>
)}
Expand Down
10 changes: 10 additions & 0 deletions app/tray/AccountSelector/style/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
font-size 19px
position relative
z-index 100
padding 24px

.introLogo
padding-bottom 38px
Expand Down Expand Up @@ -186,3 +187,12 @@
pointer-events none
*
pointer-events none

.newAccountButton
display flex
padding 16px
color var(--good)
font-weight 400

.newAccountIcon
padding-right 10px