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

Finance: refactor to new styles for 0.8 #929

Merged
merged 107 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
e769e00
Remove unused file
AquiGorka Jul 18, 2019
e0a22da
TransferFilters: update to new styles
AquiGorka Jul 18, 2019
98ed369
Transfers: update to new styles and remove unused stuff
AquiGorka Jul 18, 2019
db9acaa
Balances: update to new styles
AquiGorka Jul 18, 2019
63eddda
Transfer types: update copy
AquiGorka Jul 18, 2019
6a04221
BalanceToken: refactor to new styles
AquiGorka Jul 18, 2019
e37025b
DatePicker: update button base styles
AquiGorka Jul 18, 2019
d9dc0f4
DateRangePicker: remove unused var and update one liner
AquiGorka Jul 18, 2019
cd108a3
Add main container component
AquiGorka Jul 18, 2019
821e3d5
App: refactor to new styles
AquiGorka Jul 18, 2019
610a8f4
Transfers: fix download check
AquiGorka Jul 18, 2019
ac4efc6
Transfers: fix download of filtered transfers
AquiGorka Jul 18, 2019
f985d94
Remove unused components
AquiGorka Jul 22, 2019
5d98ca3
Transfers: fix prop types
AquiGorka Jul 22, 2019
120cf0d
Transfers: remove checkboxes and accompanying functionality
AquiGorka Jul 22, 2019
615d083
Transfers: hide filters on small layouts for the time being
AquiGorka Jul 22, 2019
b0b6363
Add no results svg
AquiGorka Jul 22, 2019
cde3431
EmptyFilteredTransfers: add component
AquiGorka Jul 22, 2019
5490804
Transfers: add empty card for zero filtered transfers
AquiGorka Jul 22, 2019
3df9790
Autocomplete: use border radius from aragon ui
AquiGorka Jul 23, 2019
541da0f
AutoCompleteSelected: use radius from aragon ui and pass down button …
AquiGorka Jul 23, 2019
bdc1edd
LocalIdentitiesAutoComplete: update styles
AquiGorka Jul 23, 2019
47912a3
DateRangeInput: add labels to avoid showing text with monospaced font
AquiGorka Jul 23, 2019
19db0d4
Transfer types: update copy
AquiGorka Jul 24, 2019
42375a3
Transfers: update dropdowns imports and api
AquiGorka Jul 24, 2019
29862db
DateRangeInput: update selected date range accented status
AquiGorka Jul 24, 2019
bf20a95
TransfersFilters: update dropdown interface
AquiGorka Jul 25, 2019
c5314f2
Transfers: use page instead of current page
AquiGorka Jul 26, 2019
cb34eb4
Deposit: update default value for dropdown
AquiGorka Jul 26, 2019
7a45b99
TokenSelector: fix dropdown interface and width
AquiGorka Jul 26, 2019
ba5baae
Withdrawal: fix dropdown api
AquiGorka Jul 26, 2019
4c6ff51
TransfersFilters: update dropdown component
AquiGorka Jul 26, 2019
e8fda94
Finance: deploy preview to now (#938)
sohkai Jul 29, 2019
40a2702
App: sort imports
AquiGorka Jul 31, 2019
3e3dce8
TokenSelector: fix handler when setting custom token address
AquiGorka Jul 31, 2019
d37bce0
LocalIdentitiesAutoComplete: use experimental autocomplete component
AquiGorka Jul 31, 2019
e0df595
Remove local autocomplete
AquiGorka Jul 31, 2019
fed7cc3
TokenSelector: update comment
AquiGorka Jul 31, 2019
987e3b0
TransferFilters: remove added option to symbols
AquiGorka Jul 31, 2019
eeda882
Transfers: add all tokens option to filter
AquiGorka Jul 31, 2019
18d6f58
EmptyFilteredTransfers: add height for image to avoid jump on loading
AquiGorka Jul 31, 2019
1aa5a2d
Remove unused component and hooks
AquiGorka Jul 31, 2019
e079d04
Transfers: move const declaration up with others
AquiGorka Jul 31, 2019
265c9cd
Transfers: use new theme all around
AquiGorka Jul 31, 2019
14d4659
Transfers: move function nearer other friendly functions
AquiGorka Jul 31, 2019
b93f09a
Transfers: add noopener to external link
AquiGorka Jul 31, 2019
6aaa0d2
Transfers: remove selection count renderer from DataView
AquiGorka Jul 31, 2019
7b86fc3
BalanceToken: refactor fractional styles
AquiGorka Aug 1, 2019
4836e10
Withdrawals: update info to warning mode
AquiGorka Aug 1, 2019
484530a
Update aragon ui version
AquiGorka Aug 9, 2019
11cd603
TransfersFilters: update dropdown interface
AquiGorka Aug 9, 2019
e64bd01
Transfers: update selected options zero to display placeholder
AquiGorka Aug 9, 2019
fbc8e25
index.html: Override default overflow
AquiGorka Aug 9, 2019
e3aaad0
Finance: update DatePicker
sohkai Aug 10, 2019
49a89e7
Finance: update token list
sohkai Aug 10, 2019
918b1fa
Finance: remove unused icons
sohkai Aug 10, 2019
d57f022
Finance: update for new DropDown API
sohkai Aug 10, 2019
8705776
Finance: use new useTheme() consistently
sohkai Aug 10, 2019
a0ef4ff
Finance: use grid units consistently
sohkai Aug 10, 2019
bc28573
Finance: update validation errors for new icon styling
sohkai Aug 10, 2019
f9bbad9
Finance: update for new Tag
sohkai Aug 10, 2019
ec36ae8
Finance: move small styled components to inline declarations
sohkai Aug 10, 2019
258c108
Finance: use TokenBadge from aragonUI
sohkai Aug 10, 2019
e4e333b
Finance: use constants for transfers filters
sohkai Aug 10, 2019
dea5507
Finance: fix no token found validation error appearing without token …
sohkai Aug 10, 2019
a6ff9ec
Finance: fix passed prop for disabled
sohkai Aug 10, 2019
4782806
Finance: render the TokenBadge in all deposit situations (outside of …
sohkai Aug 10, 2019
39f4a74
Finance: add margin to withdrawal panel's validation error
sohkai Aug 11, 2019
f6d5a81
Finance: deprecate <Text/> for textStyles()
sohkai Aug 11, 2019
59eca44
Finance: update deprecated <Info/> components
sohkai Aug 11, 2019
7eb6dc7
Finance: update LocalIdentityBadge to apply the network type by default
sohkai Aug 11, 2019
4aa95d2
Finance: fix passing props in styled components requiring theming
sohkai Aug 11, 2019
8645584
Add no transfers illustration
AquiGorka Aug 12, 2019
c8d8877
EmptyTransactions: add component
AquiGorka Aug 12, 2019
3aafbce
Transfers: render empty transfers when it there are no transfers
AquiGorka Aug 12, 2019
556e16b
Balances: add empty balances state
AquiGorka Aug 12, 2019
068cab4
Transfers: fix header padding
AquiGorka Aug 13, 2019
b85af29
DateRange: update color and remove shadow
AquiGorka Aug 13, 2019
c0c19b3
Transfers: update export button styles
AquiGorka Aug 13, 2019
d4a3fa9
EmptyFilteredTransfers: udpate copy
AquiGorka Aug 13, 2019
f6dbff8
Deposit: remove info title and update copy
AquiGorka Aug 13, 2019
50cfe38
TokenSelectorInstance: update addresses to use readOnly & compact Ide…
AquiGorka Aug 13, 2019
f1941f0
Withdrawal: add space between amount and token list
AquiGorka Aug 13, 2019
3d37fa1
EmptyFilteredTransfers: udpate copy
AquiGorka Aug 13, 2019
888bcc1
Deposit: remove duplicate text
AquiGorka Aug 16, 2019
3102992
TokenSelectorInstance: fix incorrect prop
AquiGorka Aug 16, 2019
abce5be
TransfersFilters: use DateRange from aragonUI
AquiGorka Aug 16, 2019
2bd051c
Remove local DateRange
AquiGorka Aug 16, 2019
42a2499
Finance: update context menu items to fit new style
sohkai Aug 17, 2019
c727b57
Finance: remove duplicated or unnecessary nodes from App's layout
sohkai Aug 17, 2019
54fac34
Finance: make empty transaction view's vertical padding slightly smaller
sohkai Aug 17, 2019
c8bf479
Finance: consolidate rendering of balances' empty state with non-empt…
sohkai Aug 17, 2019
46b925f
Finance: update for ButtonText
sohkai Aug 17, 2019
7ba1b03
Finance: state's proxyAddress is the finance app's proxy address, not…
sohkai Aug 18, 2019
8891cea
Finance: update empty transactions to say loading if still syncing
sohkai Aug 18, 2019
5d7942b
Finance: remove dead code
sohkai Aug 18, 2019
fad188c
Finance: prefer Tabs over TabBar
sohkai Aug 18, 2019
a96aa3e
Finance: update for newstyle Field and TextInput components
sohkai Aug 18, 2019
e593d3d
Finance: update for newstyle Link
sohkai Aug 18, 2019
1d99854
Finance: fix export icon spacing
sohkai Aug 18, 2019
c8683e1
Finance: clarify reference field is optional in panels
sohkai Aug 18, 2019
ab4d89b
Finance: update empty transactions with loading ring
sohkai Aug 18, 2019
8a0ef7a
Finance: change deposit panel's spacing to be more consistent with ot…
sohkai Aug 18, 2019
a5e0d00
Finance: update to new Button API
sohkai Aug 18, 2019
875a12f
Finance: simplify TokenSelectorInstance
sohkai Aug 18, 2019
25fac75
Finance: update TokenSelector API to be closer to DropDown's
sohkai Aug 18, 2019
8e72afa
Finance: update to use new ContextMenu API
sohkai Aug 19, 2019
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
9 changes: 9 additions & 0 deletions apps/finance/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Finance</title>
<style>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is the way we'd like to solve this. We should probably find a more generic solution to this with @bpierre.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to suggestions.

Copy link
Contributor Author

@AquiGorka AquiGorka Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @chadoh maybe he has 2 satoshis to share on this

Copy link
Contributor

@bpierre bpierre Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should try to avoid requiring boilerplate CSS to make aragonUI components work, if possible.

A solution might be to use BaseStyles for this, and use Layout for the height: 100% + overflow: auto (the same way AppView was doing it).

The idea with Layout is that it can be nested to set another width (to simulate the behavior of iframe apps on internal apps or global settings), so we should ensure it works properly in these cases. We should also make sure this works well with the client itself.

Another solution I can see would be to apply overflow: hidden to html and body when the SidePanel starts its opening transition, but it would create a jump :-/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another solution I can see would be to apply overflow: hidden to html and body when the SidePanel starts its opening transition, but it would create a jump :-/

Yeah, I want to avoid that as it is the JS solution and I think this can be solved by setting the right css rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The html and body overflow hidden is more of a safeguard as #root should not take more than 100vh, what I'm thinking is should/could we provide a main container for apps for this or should app developers be responsible for it?

Copy link
Contributor

@bpierre bpierre Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should provide it yes :-) If we want to avoid having another component, Layout seems the best place to do that? We could add in the documentation that if the layout is disabled (on Main), then it is the author’s responsibility to do it.

html, body {
overflow: hidden;
}
#root {
height: 100vh;
overflow: auto;
}
</style>
</head>
<body>
<noscript>
Expand Down
10 changes: 10 additions & 0 deletions apps/finance/app/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 2,
"public": true,
"scope": "aragon",
"name": "finance",
"alias": "nightly-finance.aragon.org",
"builds": [
{ "src": "package.json", "use": "@now/static-build", "config": { "distDir": "build" } }
]
}
9 changes: 5 additions & 4 deletions apps/finance/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@aragon/api": "^2.0.0-beta.4",
"@aragon/api-react": "^2.0.0-beta.4",
"@aragon/templates-tokens": "^1.2.0",
"@aragon/ui": "^0.40.0",
"@aragon/ui": "^1.0.0-alpha.11",
"@babel/polyfill": "^7.0.0",
"bn.js": "^4.11.8",
"core-js": "^2.6.5",
Expand All @@ -30,7 +30,7 @@
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-styled-components": "^1.7.1",
"babel-plugin-styled-components": "^1.10.6",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.1.0",
"eslint-config-standard": "^12.0.0",
Expand All @@ -46,11 +46,12 @@
},
"scripts": {
"lint": "eslint ./src",
"sync-assets": "copy-aragon-ui-assets -n aragon-ui ./build && rsync -rtu ./public/ ./build",
"start": "npm run sync-assets && npm run watch:script & parcel serve index.html -p 3002 --out-dir build/",
"build": "npm run sync-assets && npm run build:script && parcel build index.html --out-dir build/ --public-url \".\"",
"build:script": "parcel build src/script.js --out-dir build/",
"watch:script": "parcel watch src/script.js --out-dir build/ --no-hmr",
"build:script": "parcel build src/script.js --out-dir build/"
"sync-assets": "copy-aragon-ui-assets -n aragon-ui ./build && rsync -rtu ./public/ ./build",
"now-build": "npm run build"
},
"browserslist": [
">2%",
Expand Down
139 changes: 57 additions & 82 deletions apps/finance/app/src/App.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { SyncIndicator, EmptyStateCard, Main, SidePanel } from '@aragon/ui'
import {
Button,
Header,
IconPlus,
AquiGorka marked this conversation as resolved.
Show resolved Hide resolved
SidePanel,
SyncIndicator,
useViewport,
} from '@aragon/ui'
import { useAragonApi } from '@aragon/api-react'
import Balances from './components/Balances'
import NewTransferPanelContent from './components/NewTransfer/PanelContent'
import Transfers from './components/Transfers'
import AppLayout from './components/AppLayout'
import NewTransferIcon from './components/NewTransferIcon'
import { ETHER_TOKEN_FAKE_ADDRESS } from './lib/token-utils'
import { IdentityProvider } from './components/IdentityManager/IdentityManager'

import addFundsIcon from './components/assets/add-funds-icon.svg'

class App extends React.Component {
static propTypes = {
api: PropTypes.object,
Expand Down Expand Up @@ -85,90 +87,63 @@ class App extends React.Component {
}

render() {
const { appState, isSyncing } = this.props
const { appState, isSyncing, compactMode } = this.props
const { newTransferOpened } = this.state
const { balances, transactions, tokens, proxyAddress } = appState

return (
<Main assetsUrl="./aragon-ui">
<div css="min-width: 320px">
<IdentityProvider
onResolve={this.handleResolveLocalIdentity}
onShowLocalIdentityModal={this.handleShowLocalIdentityModal}
>
<SyncIndicator visible={isSyncing} />
<AppLayout
title="Finance"
mainButton={{
label: 'New transfer',
icon: <NewTransferIcon />,
onClick: this.handleNewTransferOpen,
}}
smallViewPadding={0}
>
{balances.length > 0 && (
<SpacedBlock>
<Balances balances={balances} />
</SpacedBlock>
)}
{transactions.length > 0 && (
<SpacedBlock>
<Transfers
dao={proxyAddress}
transactions={transactions}
tokens={tokens}
/>
</SpacedBlock>
)}
{!isSyncing &&
balances.length === 0 &&
transactions.length === 0 && (
<EmptyScreen>
<EmptyStateCard
icon={<img src={addFundsIcon} alt="" />}
title="There are no funds yet"
text="Create a new transfer to get started."
actionText="New transfer"
onActivate={this.handleNewTransferOpen}
/>
</EmptyScreen>
sohkai marked this conversation as resolved.
Show resolved Hide resolved
)}
</AppLayout>
<SidePanel
opened={newTransferOpened}
onClose={this.handleNewTransferClose}
title="New transfer"
>
<NewTransferPanelContent
opened={newTransferOpened}
tokens={tokens}
onWithdraw={this.handleWithdraw}
onDeposit={this.handleDeposit}
proxyAddress={proxyAddress}
/>
</SidePanel>
</IdentityProvider>
</div>
</Main>
<IdentityProvider
onResolve={this.handleResolveLocalIdentity}
onShowLocalIdentityModal={this.handleShowLocalIdentityModal}
>
<SyncIndicator visible={isSyncing} />
<Header
primary="Finance"
secondary={
<Button
mode="strong"
onClick={this.handleNewTransferOpen}
label="New transfer"
icon={<IconPlus />}
display={compactMode ? 'icon' : 'label'}
/>
}
/>
<Balances balances={balances} compactMode={compactMode} />
<Transfers
proxyAddress={proxyAddress}
transactions={transactions}
tokens={tokens}
/>
<SidePanel
opened={newTransferOpened}
onClose={this.handleNewTransferClose}
title="New transfer"
>
<NewTransferPanelContent
opened={newTransferOpened}
tokens={tokens}
onWithdraw={this.handleWithdraw}
onDeposit={this.handleDeposit}
proxyAddress={proxyAddress}
/>
</SidePanel>
</IdentityProvider>
)
}
}

const EmptyScreen = styled.div`
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
`

const SpacedBlock = styled.div`
margin-top: 30px;
&:first-child {
margin-top: 0;
}
`

export default () => {
const { api, appState } = useAragonApi()
return <App api={api} appState={appState} isSyncing={appState.isSyncing} />
const { below } = useViewport()
const compactMode = below('medium')

return (
<App
api={api}
appState={appState}
isSyncing={appState.isSyncing}
compactMode={compactMode}
/>
)
}
112 changes: 0 additions & 112 deletions apps/finance/app/src/components/AppLayout.js

This file was deleted.

Loading