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

Voting new styles for 0.8 #935

Merged
merged 176 commits into from
Aug 19, 2019
Merged
Changes from 1 commit
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
1068385
Add no votes illustration
AquiGorka Jul 26, 2019
da1c8b4
NoVotes: add no votes + syncing card
AquiGorka Jul 26, 2019
5a23ed0
Vote: add boilerplate component
AquiGorka Jul 26, 2019
2bac62a
Remove old empty state component
AquiGorka Jul 26, 2019
aba16f8
Votes: setup boilerplate for new layout
AquiGorka Jul 26, 2019
6c2654a
App: add boilerplate for new layout
AquiGorka Jul 26, 2019
e2157f5
Voting: deploy preview to now (#939)
sohkai Jul 29, 2019
fd19b08
DateRange: add component
AquiGorka Jul 29, 2019
72734c0
VoteStatus: udpate styles and content
AquiGorka Jul 29, 2019
82ef580
VotingCardGroup: update styles
AquiGorka Jul 29, 2019
588dad4
VotingCard: update content and styles
AquiGorka Jul 29, 2019
ad6a42f
App: remove button on selected vote
AquiGorka Jul 29, 2019
04574de
Votes: update layout, styles and structure
AquiGorka Jul 29, 2019
2cb228e
Votes: include start date when filtering by date range
AquiGorka Jul 29, 2019
9518881
VoteActions: add component
AquiGorka Jul 29, 2019
17132d5
App: pass down action handlers
AquiGorka Jul 29, 2019
d812205
Votes: pass down vote action handlers and fix filters
AquiGorka Jul 29, 2019
66c7574
Vote: add boilerplate content
AquiGorka Jul 29, 2019
f1f943f
SummaryBar: remove margin
AquiGorka Jul 30, 2019
6188400
VoteActions: add styles and content
AquiGorka Jul 30, 2019
1801d5a
Vote: add content to the placeholders
AquiGorka Jul 30, 2019
abb9a68
Votes: remove overflow from bar
AquiGorka Jul 30, 2019
66fa3de
VotingCard: update background on info element
AquiGorka Jul 30, 2019
7fe62ef
Vote: add info element on vote
AquiGorka Jul 30, 2019
62fb909
VotingCardGroup: polish spacing
AquiGorka Jul 30, 2019
5ecf88e
Votes: hide filters for mobile view
AquiGorka Jul 30, 2019
1763423
VotingCard: cleanup unused components
AquiGorka Jul 30, 2019
fd4b093
VotingCardGroup: update styles for mobile
AquiGorka Jul 30, 2019
d2edd16
Utils: add formatDate function
AquiGorka Jul 30, 2019
122e2ae
VoteActions: import formatDate from utils
AquiGorka Jul 30, 2019
abe9e14
Vote: update date and percentage format
AquiGorka Jul 30, 2019
509ad80
Vote: update styles for vote id
AquiGorka Jul 30, 2019
3a28dfd
SummaryBar: add prop to only render positive bars
AquiGorka Jul 30, 2019
c0a7f73
Vote: remove negative bars from aside boxes
AquiGorka Jul 30, 2019
3262976
VoteActions: remove vote action from accounts that did not vote
AquiGorka Jul 31, 2019
43cefb1
Vote: use 2 columns for inner content only on large layouts
AquiGorka Jul 31, 2019
79ea909
Vote hooks: cleanup dependencies
AquiGorka Jul 31, 2019
ea4d125
Vote: cleanup dependencies
AquiGorka Jul 31, 2019
ff8bf34
VotingCardGroup: cleanup dependencies
AquiGorka Jul 31, 2019
a51d69f
VotingCard: cleanup dependencies and code
AquiGorka Jul 31, 2019
6e90623
VoteStatus: cleanup code
AquiGorka Jul 31, 2019
781b9cf
VoteActions: cleanup imports
AquiGorka Jul 31, 2019
ec70a7b
DateRange: remove unused import
AquiGorka Jul 31, 2019
d652e70
App: cleanup imports
AquiGorka Jul 31, 2019
9a17a10
NoVotes: update empty card api
AquiGorka Jul 31, 2019
df0daff
VoteActions: update connected account vote block
AquiGorka Jul 31, 2019
51c1d79
Add no results svg
AquiGorka Jul 31, 2019
aeb7f38
EmptyFilteredVotes: add component
AquiGorka Jul 31, 2019
e3d049e
Votes: add empty results screen
AquiGorka Jul 31, 2019
659ca25
VoteActions: remove unused imports and use external link
AquiGorka Jul 31, 2019
bd543ea
NewVotePanel: update styles
AquiGorka Aug 1, 2019
cbe6dad
App: add new vote panel
AquiGorka Aug 1, 2019
9956e0b
Vote types: add pending enactment type
AquiGorka Aug 1, 2019
b3cc5c2
VoteStatus: add pending enactment option for display
AquiGorka Aug 1, 2019
7a82479
Votes: update filters
AquiGorka Aug 1, 2019
f78c77f
Vote: update title text
AquiGorka Aug 1, 2019
1b0a738
VoteActions: update status considering pending enactment
AquiGorka Aug 1, 2019
f8a323c
VoteStatus: update status considering pending enactment
AquiGorka Aug 1, 2019
83562af
Vote: refactor markup structure for title, description and author
AquiGorka Aug 1, 2019
2a9e079
Votes: update passed filter to include enacted and pending
AquiGorka Aug 2, 2019
f4f6906
VoteActions: update warning when no tokens
AquiGorka Aug 2, 2019
e549902
Votes: add react memo optimizations
AquiGorka Aug 2, 2019
abb5f03
Bump ui version
AquiGorka Aug 2, 2019
9a48ef6
Update Badge for Tag
AquiGorka Aug 2, 2019
10756fb
DateRangeInput: add box shadow
AquiGorka Aug 2, 2019
1ec0ac8
Votes: remove debugging value
AquiGorka Aug 2, 2019
9eee07b
Update to latest aragon ui release
AquiGorka Aug 9, 2019
40a1865
Voting: remove unused components
sohkai Aug 9, 2019
3dffe56
Voting: remove unused util
sohkai Aug 9, 2019
33aefd8
Voting: add name to main App export for debugging
sohkai Aug 9, 2019
7a8e338
Voting: prefer rendering <Main /> first
sohkai Aug 9, 2019
bbffa42
Voting: remove state for handling the selected vote panel
sohkai Aug 9, 2019
4ed6462
Voting: cosmetic reordering
sohkai Aug 9, 2019
d4c6aac
Voting: cosmetic renaming of NoVote's onClick to onNewVote
sohkai Aug 9, 2019
e3f6495
Voting: use gt() and lte() instead of cmp() when comparing BN.js values
sohkai Aug 9, 2019
904d273
Voting: add unselectable to EmptyFilteredVotes
sohkai Aug 9, 2019
127624e
Voting: rename LayoutVotes to Votes
sohkai Aug 9, 2019
dcd592a
Voting: rename Voting* to Vote*
sohkai Aug 9, 2019
aea58a2
Voting: remove unused cardStyle prop
sohkai Aug 9, 2019
38b12cd
Voting: remove unnecessary condition to avoid rendering
sohkai Aug 9, 2019
626fe32
Voting: copy fixes
sohkai Aug 9, 2019
92177b7
Voting: simplify SummaryBar's API
sohkai Aug 9, 2019
96c534f
Voting: simplify layout of VoteActions
sohkai Aug 9, 2019
3a27cd7
Voting: simplify execution check
sohkai Aug 9, 2019
df82c33
Voting: avoid re-rendering all votes on each useNow() tick
sohkai Aug 9, 2019
5886bf3
Votes: refactor check
AquiGorka Aug 9, 2019
9066538
Votes: remove unused param on hook
AquiGorka Aug 9, 2019
1827fad
Votes: remove unneccesary condition on filter check
AquiGorka Aug 9, 2019
68a03d8
App: add onBack handler to Votes
AquiGorka Aug 9, 2019
8b1907a
Votes: use onBack handler from App
AquiGorka Aug 9, 2019
248be1c
Votes: remove brittle override and update return structure
AquiGorka Aug 9, 2019
b5c9c3c
Vote: update div into heading
AquiGorka Aug 9, 2019
bab830f
Voting: update LocalIdentityBadge
sohkai Aug 11, 2019
5b61ef1
Voting: apply GU more consistently
sohkai Aug 11, 2019
5922cf3
Voting: fix new vote action in NoVotes
sohkai Aug 11, 2019
55595ef
Voting: refactor old components to use new theme
sohkai Aug 11, 2019
4553360
Voting: use new theme in VoteCard's voting options
sohkai Aug 11, 2019
214ead4
Voting: update for new DropDown API
sohkai Aug 11, 2019
a68fc09
Voting: move no-results.svg to root assets folder
sohkai Aug 11, 2019
d1f93fb
Voting: mock AppBadge
sohkai Aug 11, 2019
55eead6
Voting: update description rendering for new card and vote detail des…
sohkai Aug 11, 2019
3887422
Voting: update text styling to match designs
sohkai Aug 11, 2019
89e3d6f
Voting: update text styles for VoteActions
sohkai Aug 11, 2019
56cda30
Voting: use headings under a <section> in vote details
sohkai Aug 11, 2019
19720e7
Voting: update vote status to be enacted instead of executed
sohkai Aug 11, 2019
39fd435
Voting: detect pending execution status from getVoteStatus() and refa…
sohkai Aug 11, 2019
f625c92
Voting: code polish for VoteActions
sohkai Aug 11, 2019
8928076
Voting: move components/Vote.js to screens/VoteDetail.js
sohkai Aug 11, 2019
fe92175
Voting: add back button to VoteDetail
sohkai Aug 11, 2019
368feb0
Voting: cosmetic linting and code style
sohkai Aug 11, 2019
21a130b
Voting: coerce each vote's startDate into a Date in the frontend stat…
sohkai Aug 11, 2019
ad6f816
Votes: refactor filter states with constants instead of raw numbers
AquiGorka Aug 12, 2019
12174f9
Votes: update date range check
AquiGorka Aug 12, 2019
e183e75
useFilterVotes: extract to independent file
AquiGorka Aug 12, 2019
0908ae8
App: add vote filters hook
AquiGorka Aug 12, 2019
411b71d
Votes: remove vote filters hook
AquiGorka Aug 12, 2019
a17cdac
VoteActions: use strong element to emphasize
AquiGorka Aug 12, 2019
eecba55
useScrollTop: add hook
AquiGorka Aug 12, 2019
bab720d
App: scroll to top when selected vote changes
AquiGorka Aug 12, 2019
e115dd9
Votes: update Tag to Count
AquiGorka Aug 12, 2019
2199ad4
VoteCardGroup: update Tag to Count
AquiGorka Aug 12, 2019
bb0080e
DateRangeInput: remove shadow and update colors
AquiGorka Aug 13, 2019
5122a17
VoteStatus: update copy
AquiGorka Aug 13, 2019
1f988f6
EmptyFilteredTransfers: udpate copy
AquiGorka Aug 13, 2019
f72c6dc
VoteCardGroup: update styles for header
AquiGorka Aug 13, 2019
8e5ac2a
VoteCard: update vote option styles and add you tag
AquiGorka Aug 13, 2019
89cd094
VoteStatus: update icon stroke width and size
AquiGorka Aug 14, 2019
6b990c3
VoteDetails: update content grid dimensions
AquiGorka Aug 14, 2019
549aea0
SummaryRows: update spacing and display
AquiGorka Aug 14, 2019
f0f00c1
VoteActions: update button text and icon styling
AquiGorka Aug 14, 2019
eda5592
VoteDetail: update spacing on current votes summary bar and row
AquiGorka Aug 14, 2019
de01e49
VoteActions: update copy and position on missing account
AquiGorka Aug 14, 2019
55a70af
VoteDetail: pass connected account vote to vote summary
AquiGorka Aug 14, 2019
0c1986c
SumaryRows: show tag if connected account voted
AquiGorka Aug 14, 2019
933e7fe
Update Count to Tag
AquiGorka Aug 14, 2019
7052ada
VoteActions: update external link to link
AquiGorka Aug 14, 2019
8285e88
useFilterVotes: remove unused dep
AquiGorka Aug 14, 2019
c0ec562
VoteCasted: add independent component
AquiGorka Aug 14, 2019
6f534c3
VoteActions: remove vote casted from options
AquiGorka Aug 14, 2019
74f7161
VoteDetail: add VoteCasted to structure
AquiGorka Aug 14, 2019
6512aa6
VoteCasted: update copy and spacing
AquiGorka Aug 14, 2019
1cd873e
Update to latest Tag count interface
AquiGorka Aug 14, 2019
25b3519
VoteActions: update copy on account with no tokens
AquiGorka Aug 14, 2019
0a88291
VoteDetails: update icon size
AquiGorka Aug 14, 2019
223d2ab
Utils: update date format
AquiGorka Aug 14, 2019
9b352bd
VoteDetails: update date format on vote status box
AquiGorka Aug 14, 2019
8e4eb99
Update Tag api
AquiGorka Aug 16, 2019
2fc036a
Votes: use DateRange from aragonUI
AquiGorka Aug 16, 2019
58594d6
DateRange: remove local component
AquiGorka Aug 16, 2019
6689224
App: remove unnecessary prop
AquiGorka Aug 16, 2019
a4ca988
VoteActions: add emphasize tag to token symbol
AquiGorka Aug 16, 2019
d58e1c2
You: add local component
AquiGorka Aug 16, 2019
c374383
SummaryRows: update to local You component
AquiGorka Aug 16, 2019
ddbea7b
VoteCard: update to local You component
AquiGorka Aug 16, 2019
9e28b48
usePromise: can receive actual promise as param
AquiGorka Aug 16, 2019
e426e97
useTokenContract: use default value if data exists
AquiGorka Aug 16, 2019
686122f
useExtendedVoteData: return memoized promises of data being fetched
AquiGorka Aug 16, 2019
cf5ef9a
VoteActions: add check for data to existe before rendering
AquiGorka Aug 16, 2019
6083b9e
VoteActions: update copy
AquiGorka Aug 16, 2019
8a999e0
Voting: move useScrollTop hook to utils-hooks
sohkai Aug 18, 2019
6c2981d
Voting: remove unnecessary min-width: 320px declaration
sohkai Aug 18, 2019
7bfa630
Voting: add cancellation to async useEffect()
sohkai Aug 18, 2019
34bdcf1
Voting: change 'current votes' copy to just 'votes' when vote is over
sohkai Aug 18, 2019
661f597
Voting: small copy tweaks
sohkai Aug 18, 2019
ad8495f
Voting: update with newstyle's ButtonText
sohkai Aug 18, 2019
c56cf97
Voting: update for newstyle's Field and TextInput components
sohkai Aug 18, 2019
7732b81
Voting: update for newstyle's Link component
sohkai Aug 18, 2019
0ffb2e5
Voting: don't autolink text in cards
sohkai Aug 18, 2019
514e729
Voting: update vote casted design
sohkai Aug 18, 2019
f8d1b1e
Voting: use small Tag size for counts
sohkai Aug 18, 2019
3aff537
Voting: use Tag instead of custom component for voted badge
sohkai Aug 18, 2019
1df2ed9
Voting: update to new Button API
sohkai Aug 18, 2019
4eb8404
Voting: fix you voted badge's icon alignment
sohkai Aug 18, 2019
9e1222e
Voting: reorganize hooks into separate files in hooks/
sohkai Aug 19, 2019
7842779
Voting: simplify dependency structure for useExtendedVoteData()
sohkai Aug 19, 2019
fa8fc51
Voting: upgrade @aragon/ui
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
18 changes: 3 additions & 15 deletions apps/voting/app/src/hooks/useExtendedVoteData.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,19 @@ export default function useExtendedVoteData(vote) {
const tokenContract = useTokenContract()

const canExecutePromise = useMemo(() => getCanExecute(vote, api), [api, vote])
const canExecute = usePromise(
canExecutePromise,
[vote && vote.voteId, api],
sohkai marked this conversation as resolved.
Show resolved Hide resolved
false
)
const canExecute = usePromise(canExecutePromise, [], false)

const canUserVotePromise = useMemo(
() => getCanVote(vote, connectedAccount, api),
[vote, connectedAccount, api]
)
const canUserVote = usePromise(
canUserVotePromise,
[vote && vote.voteId, connectedAccount, api],
false
)
const canUserVote = usePromise(canUserVotePromise, [], false)

const userBalancePromise = useMemo(
() => getUserBalance(vote, connectedAccount, tokenContract, tokenDecimals),
[connectedAccount, tokenContract, tokenDecimals, vote]
)
const userBalance = usePromise(
userBalancePromise,
[vote && vote.voteId, connectedAccount, tokenContract, tokenDecimals],
-1
)
const userBalance = usePromise(userBalancePromise, [], -1)

return {
canExecute,
Expand Down