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

feat(dac): add DAC voting app #180

Closed
wants to merge 14 commits into from
Closed
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
6 changes: 6 additions & 0 deletions src/constants/apps-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export const APPS_CONSTS = [
url: '/explorer',
private: false,
},
{
name: 'DAC',
subText: 'Decentralized Autonomous Consortium',
url: '/dac',
private: false,
},
{
name: 'Settings',
subText: 'Manage your wallet settings.',
Expand Down
2 changes: 2 additions & 0 deletions src/layout/RenderApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import React from 'react'
import { RootState } from '../redux/store'
import Wallet from './WalletApp'
import { useAppSelector } from '../hooks/reduxHooks'
import VoteApp from '../views/vote/VoteApp'

const RenderApp = () => {
const activeApp = useAppSelector((state: RootState) => state.appConfig.activeApp)
if (activeApp === 'Explorer') return <ExplorerApp />
else if (activeApp === 'Wallet') return <Wallet />
else if (activeApp === 'DAC') return <VoteApp />
return <div>Not Yet Implemented</div>
}

Expand Down
4 changes: 4 additions & 0 deletions src/layout/RoutesSuite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Legal from '../views/legal/Legal'
import LoginPage from '../views/login/LoginPage'
import MountAccessComponent from '../views/access/MountAccessComponent'
import MultisigWallet from '../views/settings/MultisigWallet'
import VoteApp from '../views/vote/VoteApp'
import Partners from '../views/partners'
import Protected from './Protected'
import Settings from '../views/settings/index'
Expand Down Expand Up @@ -70,6 +71,9 @@ export default function RoutesSuite() {
path="/explorer"
element={<Navigate to={`/explorer/${networkAliasToUrl}`} />}
/>

<Route path={`/dac/*`} element={<VoteApp />} />
<Route path={`/dac`} element={<Navigate to="/dac/active" />} />
</>
) : null}
<Route element={<Protected />}>
Expand Down
14 changes: 14 additions & 0 deletions src/views/vote/VoteApp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import useNetwork from '../../hooks/useNetwork'
const Vote = React.lazy(() => import('DAC/dac'))

const VoteApp = () => {
const { activeNetwork } = useNetwork()
return (
<React.Suspense fallback={<div>Loading...</div>}>
<Vote network={activeNetwork} />
</React.Suspense>
)
}

export default VoteApp
1 change: 1 addition & 0 deletions webpack.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = merge(common, {
remotes: {
Explorer: 'Explorer@http://localhost:5002/remoteEntry.js',
wallet: 'wallet@http://localhost:5003/remoteEntry.js',
DAC: 'dac@http://localhost:5005/remoteEntry.js',
},
exposes: {},
shared: {
Expand Down
Loading