Skip to content

Commit

Permalink
Panel: add more warnings
Browse files Browse the repository at this point in the history
Also:

- Rename the component to UpdateTokenPanel.
- Change the label to be more explicit: “Number of tokens to remove”.
  • Loading branch information
bpierre committed Nov 26, 2019
1 parent f02afde commit 5535c0b
Show file tree
Hide file tree
Showing 3 changed files with 385 additions and 340 deletions.
49 changes: 23 additions & 26 deletions apps/token-manager/app/src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import React from 'react'
import React, { useEffect } from 'react'
import PropTypes from 'prop-types'
import BN from 'bn.js'
import {
Button,
GU,
Header,
IconPlus,
SidePanel,
SyncIndicator,
Tag,
textStyle,
useLayout,
useTheme,
useThemeMode,
} from '@aragon/ui'
import { useAragonApi } from '@aragon/api-react'
import { IdentityProvider } from './components/IdentityManager/IdentityManager'
import TokenPanelContent from './components/Panels/TokenPanelContent'
import UpdateTokenPanel from './components/UpdateTokenPanel/UpdateTokenPanel'
import EmptyState from './screens/EmptyState'
import Holders from './screens/Holders'
import { addressesEqual } from './web3-utils'
Expand Down Expand Up @@ -179,29 +179,21 @@ class App extends React.PureComponent {
</React.Fragment>
)}

<SidePanel
title={
assignTokensConfig.mode === 'assign'
? 'Add tokens'
: 'Remove tokens'
}
opened={sidepanelOpened}
onClose={this.handleSidepanelClose}
onTransitionEnd={this.handleSidepanelTransitionEnd}
>
{appStateReady && (
<TokenPanelContent
getHolderBalance={this.getHolderBalance}
holderAddress={assignTokensConfig.holderAddress}
maxAccountTokens={maxAccountTokens}
onUpdateTokens={this.handleUpdateTokens}
opened={sidepanelOpened}
tokenDecimals={numData.tokenDecimals}
tokenDecimalsBase={tokenDecimalsBase}
{...assignTokensConfig}
/>
)}
</SidePanel>
{appStateReady && (
<UpdateTokenPanel
getHolderBalance={this.getHolderBalance}
holderAddress={assignTokensConfig.holderAddress}
maxAccountTokens={maxAccountTokens}
mode={assignTokensConfig.mode}
onClose={this.handleSidepanelClose}
onTransitionEnd={this.handleSidepanelTransitionEnd}
onUpdateTokens={this.handleUpdateTokens}
opened={sidepanelOpened}
tokenDecimals={numData.tokenDecimals}
tokenDecimalsBase={tokenDecimalsBase}
tokenSymbol={tokenSymbol}
/>
)}
</IdentityProvider>
)
}
Expand All @@ -212,5 +204,10 @@ export default () => {
const theme = useTheme()
const { layoutName } = useLayout()

const themeMode = useThemeMode()
useEffect(() => {
// themeMode.set('dark')
}, [themeMode])

return <App api={api} layoutName={layoutName} theme={theme} {...appState} />
}
314 changes: 0 additions & 314 deletions apps/token-manager/app/src/components/Panels/TokenPanelContent.js

This file was deleted.

Loading

0 comments on commit 5535c0b

Please sign in to comment.