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

This PR adds Project creation functionality #2

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# ABI files
/src/contracts

# dependencies
/node_modules
/.pnp
Expand All @@ -23,3 +26,5 @@ yarn-debug.log*
debug.log*
yarn-error.log*
package-lock.json


26 changes: 14 additions & 12 deletions contracts/truffle-config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
const path = require("path");
/* eslint-disable */
const path = require('path')

module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "../src/contracts"),
contracts_build_directory: path.join(__dirname, '../src/contracts'),
networks: {
development: {
host: '127.0.0.1',
port: 8545,
gas: 6721975, // <-- Use this high gas value
gasPrice: 1000000000,
network_id: '*' // Match any network id
}
network_id: '*', // Match any network id
},
},
// Configure your compilers
compilers: {
solc: {
version: "0.6.6", // Fetch exact version from solc-bin (default: truffle's version)
version: '0.6.6', // Fetch exact version from solc-bin (default: truffle's version)
docker: false, // Use "0.5.1" you've installed locally with docker (default: false)
settings: { // See the solidity docs for advice about optimization and evmVersion
settings: {
// See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 200
runs: 200,
},
evmVersion: 'constantinople'
}
}
}
};
evmVersion: 'constantinople',
},
},
},
}
30 changes: 30 additions & 0 deletions debug.log
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,33 @@
[0527/213826.031:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0528/151733.993:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0528/151734.019:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0529/140617.768:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0529/140617.771:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0601/221346.435:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0601/221346.456:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/164611.913:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/164611.915:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/190943.213:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/190943.215:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/192715.867:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0602/192715.870:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0603/212048.026:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0603/212048.028:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0604/185505.121:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0604/185505.138:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/101632.670:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/101632.672:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/105518.019:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/105518.043:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/114652.318:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0605/114652.321:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0608/071321.652:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0608/071321.678:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0608/185726.898:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0608/185726.920:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0609/092800.632:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0609/092800.634:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0609/094719.262:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0609/094719.264:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0610/122246.990:ERROR:crash_report_database_win.cc(469)] failed to stat report
[0610/122247.014:ERROR:crash_report_database_win.cc(469)] failed to stat report
29 changes: 15 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ import theme from './theme-court'
import MainView from './components/MainView'
import ErrorPage from './ErrorPage'

import Dashboard from './components/Dashboard/Dashboard'
import Profile from './components/Profile/Profile'
/* eslint-disable prettier/prettier */

import Tasks from './components/Tasks/Tasks'
import Sample from './components/Sample/Sample'
import Disputes from './components/Disputes/Disputes'
import Disputes from './components/Dashboard/Dashboard'
import { WalletProvider } from './providers/Wallet'
import { ActivityProvider } from './components/Activity/ActivityProvider'
// import { TokenContext } from './components/Profile/APIcall'

function App() {
return (
<WalletProvider>
<BrowserRouter>
<ActivityProvider>
<Main layout={false} theme={theme}>
<MainView>
{/* <Redirect from='/' to='/dashboard' /> */}
<Switch>
<Route exact path='/profile' component={Dashboard} />
<Route exact path='/leaderboard' component={Tasks} />
<Route exact path='/dashboard' component={Disputes} />
<Route exact path='/sample' component={Sample} />
<Route component={ErrorPage} />
</Switch>
</MainView>
</Main>
<Main layout={false} theme={theme}>
<MainView>
{/* <Redirect from='/' to='/dashboard' /> */}
<Switch>
<Route exact path='/profile' component={Profile} />
<Route exact path='/leaderboard' component={Tasks} />
<Route exact path='/dashboard' component={Disputes} />
<Route exact path='/sample' component={Sample} />
<Route component={ErrorPage} />
</Switch>
</MainView>
</Main>
</ActivityProvider>
</BrowserRouter>
</WalletProvider>
Expand Down
10 changes: 10 additions & 0 deletions src/components/Activity/activity-types.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import iconAnj from './assets/activity-icon-anj.svg'
import execute from './assets/activity-icon-execute-ruling.svg'

Expand All @@ -22,6 +23,15 @@ const ACTIVITY_TYPES = new Map(
`,
}
},

newProject({ name, budget }) {
return {
icon: execute,
title: 'Added Project',
description: ` Created Project ${name} , ${budget}
`,
}
},
transaction({ transactionHash }) {
return {
title: 'Transaction',
Expand Down
77 changes: 0 additions & 77 deletions src/components/Dashboard/APIcall.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/components/Dashboard/Connect.js

This file was deleted.

44 changes: 37 additions & 7 deletions src/components/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
/* eslint-disable prettier/prettier */
import React from 'react'
import { Header, Split } from '@aragon/ui'
import ProfileHeader from './ProfileHeader'
import DashboardStats from './DashboardStats'
import React, { useCallback, useMemo, useState } from 'react'
import { Header } from '@aragon/ui'

import DisputeDetail from './DisputeDetail'
import DisputeList from './DisputeList'

import { disputes } from '../../mock-data'

import Import from './Import'

function Dashboard() {
const [selectedDispute, selectDispute] = useSelectedDispute(disputes)

const handleBack = useCallback(() => {
selectDispute(-1)
}, [selectDispute])

return (
<React.Fragment>
<Header primary='Profile' />
<ProfileHeader active />
<Split secondary={<DashboardStats />} />
<Header primary='Dashboard' />
<Import />
<br />
<br />
{selectedDispute ? (
<DisputeDetail dispute={selectedDispute} onBack={handleBack} />
) : (
<DisputeList disputes={disputes} selectDispute={selectDispute} />
)}
</React.Fragment>
)
}

const useSelectedDispute = (disputes) => {
const [selectedDisputeId, setSelectedDisputeId] = useState(-1)

const selectDispute = (disputeId) => setSelectedDisputeId(disputeId)

const selectedDispute = useMemo(
() => disputes.find((dispute) => dispute.id === selectedDisputeId) || null,
[disputes, selectedDisputeId]
)

return [selectedDispute, selectDispute]
}

export default Dashboard
Loading