Skip to content
Merged
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
329 changes: 184 additions & 145 deletions packages/polymath-issuer/src/pages/compliance/CompliancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
NotFoundPage,
Page,
Grid,
Remark,
FormItem,
} from '@polymathnetwork/ui';
import { BigNumber } from 'bignumber.js';
import {
Expand All @@ -23,7 +25,10 @@ import {
OverflowMenuItem,
TextInput,
Toggle,
Tabs,
Tab,
} from 'carbon-components-react';
import { Heading, CardFeatureState, icons } from '@polymathnetwork/new-ui';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { reset } from 'redux-form';
Expand Down Expand Up @@ -593,69 +598,56 @@ class CompliancePage extends Component<Props, State> {
return (
<Page title="Compliance – Polymath">
<Progress />
<Grid>
<Grid.Row gridGap="0px">
<Grid.Col gridSpan={9}>
<h1 className="pui-h1">Token Compliance</h1>
<h3 className="pui-h3">
Manage compliance requirements of your tokens. You can import
and export your whitelist, manage ownership percentages, add 3rd
party whitelist managers, and manage approval of token transfers
between wallets.
</h3>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center' }}>
<Button
icon="upload"
onClick={this.handleImportModalOpen}
className="import-whitelist-btn"
>
Import Whitelist
</Button>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center' }}>
<ImportWhitelistModal
isOpen={this.state.isImportModalOpen}
onSubmit={this.handleImport}
onClose={this.handleImportModalClose}
/>
{/* <WhitelistModal
isOpen={this.state.isWhitelistModalOpen}
handleOpen={this.}
/> */}

<Button
icon="download"
kind="secondary"
onClick={this.handleExport}
className="import-whitelist-btn"
>
Export Whitelist
</Button>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center', justifySelf: 'left' }}>
<OverflowMenu floatingMenu flipped style={{ float: 'right' }}>
<OverflowMenuItem
itemText={
this.props.isTokenFrozen
? 'Resume All Transfers'
: 'Pause All Transfers'
}
onClick={
this.props.isTokenFrozen
? this.handleUnFreezeModalOpen
: this.handleFreezeModalOpen
}
/>
</OverflowMenu>
</Grid.Col>
</Grid.Row>
<Grid.Row>
<Grid.Col gridSpan={[12, 12, 6, 6]}>
<div id="compliance">
<br />
<div className="pui-page-box compliance-form">
{/* <OverflowMenu floatingMenu flipped style={{ float: 'right' }}>
<h1 className="pui-h1">Token Compliance</h1>
<h3 className="pui-h3">
Manage compliance requirements of your tokens. You can import and
export your whitelist, manage ownership percentages and add 3rd party
whitelist managers.
</h3>
<Tabs>
<Tab label="Whitelist">
<Grid>
<Grid.Row>
<Grid.Col gridSpan={9}>
<h1 className="pui-h1">Whitelist</h1>
<h3 className="pui-h3">
Your whitelist is the list of wallet addresses of approved
or exempted to buy and sell your security token.
</h3>
<Remark title="Note">
Security token buy/sell operations may be subject to
additional restrictions.
</Remark>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center' }}>
<Button
style={{ width: 185 }}
icon="upload"
onClick={this.handleImportModalOpen}
className="import-whitelist-btn"
>
Import Whitelist
</Button>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center' }}>
<ImportWhitelistModal
isOpen={this.state.isImportModalOpen}
onSubmit={this.handleImport}
onClose={this.handleImportModalClose}
/>

<Button
style={{ width: 185 }}
icon="download"
kind="secondary"
onClick={this.handleExport}
className="import-whitelist-btn"
>
Export Whitelist
</Button>
</Grid.Col>
<Grid.Col style={{ alignSelf: 'center', justifySelf: 'left' }}>
<OverflowMenu floatingMenu flipped style={{ float: 'right' }}>
<OverflowMenuItem
itemText={
this.props.isTokenFrozen
Expand All @@ -668,98 +660,145 @@ class CompliancePage extends Component<Props, State> {
: this.handleFreezeModalOpen
}
/>
</OverflowMenu> */}
</OverflowMenu>
</Grid.Col>
</Grid.Row>
<Grid.Row>
<Grid.Col gridSpan={[12, 12, 6, 6]}>
<div id="compliance">
<br />
<div className="pui-page-box compliance-form">
<h1 className="pui-h1">3rd Party Whitelist Management</h1>
<div className="whitelist-settings">
<div className="bx--form-item">
<label
htmlFor="whitelistToggle"
className="bx--label"
>
Enable Third-Party Whitelist Management
</label>
<Toggle
onToggle={this.handleToggleWhitelist}
toggled={this.props.isWhitelistToggled}
id="whitelistToggle"
/>
</div>
<div
className="bx--form-item"
style={
this.props.isWhitelistToggled
? {}
: { display: 'none' }
}
>
<WhitelistTable />
</div>
</div>
<div className="pui-clearfix" />
</div>
</div>
</Grid.Col>
</Grid.Row>
</Grid>
</Tab>
<Tab label="Ownership Restrictions">
<Grid>
<Grid.Row>
<Grid.Col gridSpan={9}>
<h1 className="pui-h1">Ownership Restrictions</h1>
<div className="compliance-settings">
<div className="bx--form-item">
<label htmlFor="percentageToggle" className="bx--label">
Enable Ownership Restrictions
</label>
<h3 className="pui-h3">
Manage ownership of your security token by setting limits
like capping the percentage of available tokens a single
investor can hold.{' '}
</h3>
<Remark title="Note">
This percentage relates to the holdings of a single wallet
address and may not support investor holdings held in a
custodial omnibus wallet.
</Remark>
<br />
<div
className="bx--form-item"
style={
!isPercentagePaused ||
(!isPercentageEnabled && this.state.isPercentageToggled)
? {}
: {
display: 'none',
}
}
>
<label htmlFor="percentage" className="bx--label">
Percentage of outstanding tokens individual investors can
own:
</label>
<div
style={{
display: 'flex',
flexDirection: 'row',
}}
>
<TextInput
style={{ width: 100 }}
labelText=""
id="percentage"
value={this.state.percentage}
placeholder="%"
onChange={this.handlePercentageChange}
/>
<Button
style={{ marginTop: 0 }}
kind="secondary"
className="apply-percentage-btn"
onClick={this.handleApplyPercentage}
disabled={
this.isPercentageValid() ||
typeof this.state.percentage === 'undefined' ||
this.state.percentage === ''
}
>
Apply
</Button>
</div>
</div>
</Grid.Col>
<Grid.Col
gridSpan={3}
style={{
alignSelf: 'center',
boxShadow: '0 8px 24px 0 rgba(0,0,0,0.1)',
}}
>
<CardFeatureState
status={
isPercentageEnabled
? !isPercentagePaused
: this.state.isPercentageToggled
? 'idle'
: 'inactive'
}
IconAsset={icons.SvgRestriction}
>
<Heading color="primary" mt={2}>
Enable Ownership Restrictions
</Heading>
<div style={{ marginLeft: 70 }}>
<Toggle
onToggle={this.handleTogglePercentage}
toggled={
isPercentageEnabled
? !isPercentagePaused
: this.state.isPercentageToggled
}
id="percentageToggle"
/>
</div>

<div
className="bx--form-item"
style={
!isPercentagePaused ||
(!isPercentageEnabled && this.state.isPercentageToggled)
? {}
: {
display: 'none',
}
}
>
<label htmlFor="percentage" className="bx--label">
Each Individual Investor Can
<br />
Own Up To of Outstanding Tokens
</label>
<div>
<TextInput
labelText=""
id="percentage"
value={this.state.percentage}
placeholder="–"
onChange={this.handlePercentageChange}
/>
<Button
className="apply-percentage-btn"
onClick={this.handleApplyPercentage}
disabled={
this.isPercentageValid() ||
typeof this.state.percentage === 'undefined' ||
this.state.percentage === ''
}
>
Apply
</Button>
</div>
</div>
</div>
<div className="pui-clearfix" />
</div>
</div>
</Grid.Col>
<Grid.Col gridSpan={[12, 12, 6, 6]}>
<div id="compliance">
<br />
<div className="pui-page-box compliance-form">
<h1 className="pui-h1">Whitelist Management</h1>
<div className="whitelist-settings">
<div className="bx--form-item">
<label htmlFor="whitelistToggle" className="bx--label">
Enable Third-Party Whitelist Management
</label>
<Toggle
onToggle={this.handleToggleWhitelist}
toggled={this.props.isWhitelistToggled}
id="whitelistToggle"
id="volumeRestrictionToggle"
/>
</div>

<div
className="bx--form-item"
style={
this.props.isWhitelistToggled ? {} : { display: 'none' }
}
>
<WhitelistTable />
</div>
</div>
<div className="pui-clearfix" />
</div>
</div>
</Grid.Col>
</Grid.Row>
</Grid>
</CardFeatureState>
</Grid.Col>
</Grid.Row>
</Grid>
</Tab>
</Tabs>
</Page>
);
}
Expand Down
10 changes: 1 addition & 9 deletions packages/polymath-issuer/src/pages/compliance/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@
}
}

&:after {
content: '%';
position: absolute;
top: 13px;
left: 55px;
color: #8c9ba5;
font-size: 14px;
}
}

button {
Expand Down Expand Up @@ -141,7 +133,7 @@
.import-whitelist-btn {
float: left;
margin-top: 6px;
margin-right: 26px;
// margin-right: px;
}

.permanent-checkbox-container {
Expand Down
Loading