add funding profiles table
This commit is contained in:
parent
c46add12ed
commit
63df7614e3
|
@ -56,8 +56,8 @@ const AddFunder = () => (
|
|||
<TextField
|
||||
id="funderName"
|
||||
name="funderName"
|
||||
label="Funder Name"
|
||||
placeholder="Funder Name"
|
||||
label="Funding Name"
|
||||
placeholder="Funding Name"
|
||||
margin="normal"
|
||||
variant="outlined"
|
||||
onChange={handleChange}
|
||||
|
@ -67,8 +67,8 @@ const AddFunder = () => (
|
|||
<TextField
|
||||
id="funderDescription"
|
||||
name="funderDescription"
|
||||
label="Funder Description (URL or IPFS Hash)"
|
||||
placeholder="Funder Description (URL or IPFS Hash)"
|
||||
label="Description (URL or IPFS Hash)"
|
||||
placeholder="Description (URL or IPFS Hash)"
|
||||
margin="normal"
|
||||
variant="outlined"
|
||||
onChange={handleChange}
|
||||
|
@ -88,7 +88,7 @@ const AddFunder = () => (
|
|||
value={values.commitTime || ''}
|
||||
/>
|
||||
<Button variant="contained" color="primary" type="submit">
|
||||
ADD FUNDER PROFILE
|
||||
ADD FUNDING PROFILE
|
||||
</Button>
|
||||
{status && <Snackbar
|
||||
anchorOrigin={{
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
import React, { Fragment, memo } from 'react'
|
||||
import MaterialTable from 'material-table'
|
||||
|
||||
const convertToHours = seconds => seconds / 60 / 60
|
||||
const cancelText = canceled => canceled ? 'Yes' : 'No'
|
||||
const formatField = field => ({
|
||||
...field,
|
||||
commitTime: convertToHours(field.commitTime),
|
||||
canceled: cancelText(field.canceled)
|
||||
})
|
||||
const FunderProfilesTable = ({ data }) => (
|
||||
<Fragment>
|
||||
<MaterialTable
|
||||
columns={[
|
||||
{ title: 'Profile Id', field: 'idGiver', type: 'numeric' },
|
||||
{ title: 'Name', field: 'name' },
|
||||
{ title: 'Url', field: 'url' },
|
||||
{ title: 'Commit Time', field: 'commitTime', type: 'numeric' },
|
||||
{ title: 'cancel', field: 'canceled' }
|
||||
]}
|
||||
data={data.map(formatField)}
|
||||
title="Funding Profiles"
|
||||
/>
|
||||
</Fragment>
|
||||
)
|
||||
|
||||
export default memo(FunderProfilesTable)
|
|
@ -7,6 +7,7 @@ import Divider from '@material-ui/core/Divider';
|
|||
import Button from '@material-ui/core/Button';
|
||||
import AddFunder from './components/AddFunder';
|
||||
import CreateFunding from './components/CreateFunding';
|
||||
import FunderProfilesTable from './components/FunderProfilesTable.jsx'
|
||||
import { initVaultAndLP, vaultPledgingNeedsInit, standardTokenApproval, getLpAllowance } from './utils/initialize'
|
||||
import { getUserFundProfiles } from './utils/events';
|
||||
|
||||
|
@ -37,9 +38,10 @@ class App extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { needsInit, lpAllowance } = this.state;
|
||||
const { needsInit, lpAllowance, fundProfiles } = this.state;
|
||||
return (
|
||||
<div>
|
||||
{fundProfiles && <FunderProfilesTable data={fundProfiles} />}
|
||||
<AddFunder />
|
||||
<Divider variant="middle" />
|
||||
<CreateFunding />
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<head>
|
||||
<title>Status.im Liquid Funding</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
</head>
|
||||
<body class="container">
|
||||
<div id="app">
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
"eslint": "^5.9.0",
|
||||
"eth-contract-class": "^0.0.12",
|
||||
"formik": "^1.3.2",
|
||||
"material-table": "^1.3.0",
|
||||
"react": "^16.6.3",
|
||||
"react-dom": "^16.6.3"
|
||||
}
|
||||
|
|
50
yarn.lock
50
yarn.lock
|
@ -1416,7 +1416,7 @@ class-utils@^0.3.5:
|
|||
isobject "^3.0.0"
|
||||
static-extend "^0.1.1"
|
||||
|
||||
classnames@^2.2.5:
|
||||
classnames@^2.2.5, classnames@^2.2.6:
|
||||
version "2.2.6"
|
||||
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
|
||||
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
|
||||
|
@ -1881,6 +1881,11 @@ dashdash@^1.12.0:
|
|||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
date-fns@2.0.0-alpha.16:
|
||||
version "2.0.0-alpha.16"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.16.tgz#d249a6c9b799252652fb9e3f25460eaf9de86ac7"
|
||||
integrity sha1-0kmmybeZJSZS+54/JUYOr53oasc=
|
||||
|
||||
dateformat@^3.0.0:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
|
||||
|
@ -2938,6 +2943,11 @@ file-type@^6.1.0:
|
|||
version "6.2.0"
|
||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
|
||||
|
||||
filefy@^0.1.2:
|
||||
version "0.1.6"
|
||||
resolved "https://registry.yarnpkg.com/filefy/-/filefy-0.1.6.tgz#ff7f11a6532bfc3bd2982e6617a89105dd4f241d"
|
||||
integrity sha512-dEZnOTsZjA2WuPO3SbntxYBrWqECIN4f8p2GzKTNR/xndBfkvsxRVU/4Q7HRqAQlKp46tf/VAUhtA3tWOFYrlQ==
|
||||
|
||||
filename-regex@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
|
||||
|
@ -4174,7 +4184,7 @@ keccakjs@^0.2.0, keccakjs@^0.2.1:
|
|||
browserify-sha3 "^0.0.1"
|
||||
sha3 "^1.1.0"
|
||||
|
||||
keycode@^2.1.9:
|
||||
keycode@^2.1.9, keycode@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04"
|
||||
integrity sha1-PQr1bce4uOXLqNCpfxByBO7CKwQ=
|
||||
|
@ -4554,6 +4564,29 @@ map-visit@^1.0.0:
|
|||
dependencies:
|
||||
object-visit "^1.0.0"
|
||||
|
||||
material-table@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/material-table/-/material-table-1.3.0.tgz#8a3a5589d737b41cf56f02c5523a20c35715daf4"
|
||||
integrity sha512-CzmwJKVLdqRQp3mfHRpqr9+kl5KICK9REX0M2BCMFUwqWMjxlSZFAlVbG2J7CjfCO5bUnXBBCohrmEiIbZKZiw==
|
||||
dependencies:
|
||||
classnames "^2.2.6"
|
||||
date-fns "2.0.0-alpha.16"
|
||||
filefy "^0.1.2"
|
||||
material-ui-pickers "1.0.1"
|
||||
prop-types "^15.6.2"
|
||||
|
||||
material-ui-pickers@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/material-ui-pickers/-/material-ui-pickers-1.0.1.tgz#396f90fff2f2dbb7c477bce2b9a62101eb3bd26d"
|
||||
integrity sha512-FRJwgeFUQdQxzNAybZvf11204KFBxqKS6sg4JvAO0cWmHULXJhrc9kuEDT8F7Pomwnv6+AyfxygsoMgIRcBMNg==
|
||||
dependencies:
|
||||
classnames "^2.2.6"
|
||||
keycode "^2.2.0"
|
||||
react-event-listener "^0.6.4"
|
||||
react-text-mask "=5.4.1"
|
||||
react-transition-group "^2.5.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
math-random@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac"
|
||||
|
@ -5372,7 +5405,7 @@ promise@^7.1.1:
|
|||
dependencies:
|
||||
asap "~2.0.3"
|
||||
|
||||
prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
|
||||
prop-types@^15.5.6, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
|
||||
version "15.6.2"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
|
||||
dependencies:
|
||||
|
@ -5539,7 +5572,7 @@ react-dom@^16.6.3:
|
|||
prop-types "^15.6.2"
|
||||
scheduler "^0.11.2"
|
||||
|
||||
react-event-listener@^0.6.2:
|
||||
react-event-listener@^0.6.2, react-event-listener@^0.6.4:
|
||||
version "0.6.4"
|
||||
resolved "https://registry.yarnpkg.com/react-event-listener/-/react-event-listener-0.6.4.tgz#d0ea5ed897da1a796616c44b5a8758898140f203"
|
||||
integrity sha512-t7VSjIuUFmN+GeyKb+wm025YLeojVB85kJL6sSs0wEBJddfmKBEQz+CNBZ2zBLKVWkPy/fZXM6U5yvojjYBVYQ==
|
||||
|
@ -5563,7 +5596,14 @@ react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4:
|
|||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
|
||||
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
|
||||
|
||||
react-transition-group@^2.2.1:
|
||||
react-text-mask@=5.4.1:
|
||||
version "5.4.1"
|
||||
resolved "https://registry.yarnpkg.com/react-text-mask/-/react-text-mask-5.4.1.tgz#c3dd3e550e31d38b7c9da0178a2725960770e443"
|
||||
integrity sha512-mGx1n0x0skktwsKcpgAGnrgExFlXDflbWEHh8PC1UaQP8+EdHkW7JYczTghsBo2rnVwU9/4A9x/2bVt3HY46/w==
|
||||
dependencies:
|
||||
prop-types "^15.5.6"
|
||||
|
||||
react-transition-group@^2.2.1, react-transition-group@^2.5.0:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.5.0.tgz#70bca0e3546102c4dc5cf3f5f57f73447cce6874"
|
||||
integrity sha512-qYB3JBF+9Y4sE4/Mg/9O6WFpdoYjeeYqx0AFb64PTazVy8RPMiE3A47CG9QmM4WJ/mzDiZYslV+Uly6O1Erlgw==
|
||||
|
|
Loading…
Reference in New Issue