Created
September 11, 2019 18:48
-
-
Save chadoh/c19666d5435a553cd1cefd324c6b8df3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/dot-voting/app/App.js b/apps/dot-voting/app/App.js | |
index b5176932..609e588f 100644 | |
--- a/apps/dot-voting/app/App.js | |
+++ b/apps/dot-voting/app/App.js | |
@@ -9,10 +9,41 @@ import { IdentityProvider } from '../../../shared/identity' | |
import Decisions from './Decisions' | |
import emptyStatePng from './assets/voting-empty-state.png' | |
+import { ETHER_TOKEN_FAKE_ADDRESS } from './utils/token-utils' | |
+const appState = { | |
+ token: ETHER_TOKEN_FAKE_ADDRESS, | |
+ voteTime: 60000, | |
+ PCT_BASE: 50, | |
+ globalCandidateSupportPct: 50, | |
+ globalMinQuorum: 50e16, | |
+ votes: [{ | |
+ voteId: 1, | |
+ data: { | |
+ balance: 0, | |
+ creator: '0xb4124cEB3451635DAcedd11767f004d8a28c6eE7', | |
+ metadata: 'Which do you prefer?', | |
+ minAcceptQuorum: 0, | |
+ options: [{ | |
+ label: '0xcaaacaaacaaacaaacaaacaaacaaacaaacaaacaaa', | |
+ value: 0, | |
+ }, { | |
+ label: '0xdaaadaaadaaadaaadaaadaaadaaadaaadaaadaaa', | |
+ value: 0, | |
+ }], | |
+ participationPct: 0, | |
+ snapshotBlock: -1, | |
+ startDate: new Date().getTime(), | |
+ tokenSymbol: 'ETH', | |
+ totalVoters: 0, | |
+ type: 'allocation', | |
+ } | |
+ }], | |
+} | |
+ | |
const illustration = <img src={emptyStatePng} alt="" height="160" /> | |
const useVoteCloseWatcher = () => { | |
- const { votes = [], voteTime = 0 } = useAragonApi().appState | |
+ const { votes = [], voteTime = 0 } = appState | |
const [ now, setNow ] = useState(new Date().getTime()) | |
useEffect(() => { | |
@@ -72,7 +103,7 @@ const Empty = () => ( | |
const App = () => { | |
useVoteCloseWatcher() | |
- const { api, appState = {} } = useAragonApi() | |
+ const { api } = useAragonApi() | |
const handleResolveLocalIdentity = useCallback(address => { | |
return api.resolveAddressIdentity(address).toPromise() | |
diff --git a/apps/dot-voting/app/Decisions.js b/apps/dot-voting/app/Decisions.js | |
index b8f6f329..05a5b97f 100644 | |
--- a/apps/dot-voting/app/Decisions.js | |
+++ b/apps/dot-voting/app/Decisions.js | |
@@ -102,8 +102,39 @@ const useFilterVotes = (votes, voteTime) => { | |
} | |
} | |
+import { ETHER_TOKEN_FAKE_ADDRESS } from './utils/token-utils' | |
+const appState = { | |
+ token: ETHER_TOKEN_FAKE_ADDRESS, | |
+ voteTime: 60000, | |
+ PCT_BASE: 50, | |
+ globalCandidateSupportPct: 50, | |
+ globalMinQuorum: 50e16, | |
+ votes: [{ | |
+ voteId: 1, | |
+ data: { | |
+ balance: 0, | |
+ creator: '0xb4124cEB3451635DAcedd11767f004d8a28c6eE7', | |
+ metadata: 'Which do you prefer?', | |
+ minAcceptQuorum: 0, | |
+ options: [{ | |
+ label: '0xcaaacaaacaaacaaacaaacaaacaaacaaacaaacaaa', | |
+ value: 0, | |
+ }, { | |
+ label: '0xdaaadaaadaaadaaadaaadaaadaaadaaadaaadaaa', | |
+ value: 0, | |
+ }], | |
+ participationPct: 0, | |
+ snapshotBlock: -1, | |
+ startDate: new Date().getTime(), | |
+ tokenSymbol: 'ETH', | |
+ totalVoters: 0, | |
+ type: 'allocation', | |
+ } | |
+ }], | |
+} | |
+ | |
const Decisions = ({ decorateVote }) => { | |
- const { api: app, appState, connectedAccount } = useAragonApi() | |
+ const { api: app, connectedAccount } = useAragonApi() | |
const { votes, voteTime } = appState | |
const { layoutName } = useLayout() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment