mirror of
https://github.com/status-im/ens-usernames.git
synced 2025-02-10 17:36:35 +00:00
show complete page on release
This commit is contained in:
parent
da14837b7d
commit
c0af58af16
@ -103,7 +103,7 @@ class RenderAddresses extends PureComponent {
|
|||||||
state = { copied: false, editMenu: false, editAction: false }
|
state = { copied: false, editMenu: false, editAction: false }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { domainName, address, statusAccount, expirationTime, defaultAccount, ownerAddress } = this.props
|
const { domainName, address, statusAccount, expirationTime, defaultAccount, ownerAddress, setStatus } = this.props
|
||||||
const { copied, editMenu, editAction, submitted } = this.state
|
const { copied, editMenu, editAction, submitted } = this.state
|
||||||
const markCopied = (v) => { this.setState({ copied: v }) }
|
const markCopied = (v) => { this.setState({ copied: v }) }
|
||||||
const isCopied = address => address == copied;
|
const isCopied = address => address == copied;
|
||||||
@ -112,13 +112,13 @@ class RenderAddresses extends PureComponent {
|
|||||||
const isOwner = defaultAccount === ownerAddress;
|
const isOwner = defaultAccount === ownerAddress;
|
||||||
const closeReleaseAlert = value => {
|
const closeReleaseAlert = value => {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
this.setState({ submitted: true })
|
||||||
release(
|
release(
|
||||||
soliditySha3(domainName),
|
soliditySha3(domainName),
|
||||||
hash('stateofus.eth'),
|
hash('stateofus.eth'),
|
||||||
)
|
)
|
||||||
.send()
|
.send()
|
||||||
}
|
}
|
||||||
this.setState({ editAction: null })
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
@ -136,10 +136,10 @@ class RenderAddresses extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
</Hidden>
|
</Hidden>
|
||||||
<Hidden mdUp>
|
<Hidden mdUp>
|
||||||
{submitted ? <TransactionComplete type='edit' /> : <MobileAddressDisplay {...this.props} isOwner={isOwner} edit={editAction === 'edit'} onSubmit={() => { this.setState({ submitted: true}) }}/>}
|
{submitted ? <TransactionComplete type={editAction} setStatus={setStatus} /> : <MobileAddressDisplay {...this.props} isOwner={isOwner} edit={editAction === 'edit'} onSubmit={() => { this.setState({ submitted: true}) }}/>}
|
||||||
{isOwner && editAction !== 'edit' && <MobileButton text="Edit" style={{ marginLeft: '35%' }} onClick={() => { this.setState({ editMenu: true }) } }/>}
|
{isOwner && !editAction && <MobileButton text="Edit" style={{ marginLeft: '35%' }} onClick={() => { this.setState({ editMenu: true }) } }/>}
|
||||||
<EditOptions open={editMenu} onClose={onClose} />
|
<EditOptions open={editMenu} onClose={onClose} />
|
||||||
<ReleaseDomainAlert open={editAction === 'release'} handleClose={closeReleaseAlert} />
|
<ReleaseDomainAlert open={editAction === 'release' && !submitted} handleClose={closeReleaseAlert} />
|
||||||
</Hidden>
|
</Hidden>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
@ -174,7 +174,7 @@ const RegisterInfoCard = ({ formattedDomain, domainPrice }) => (
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
|
|
||||||
const TransactionComplete = ({ type }) => (
|
const TransactionComplete = ({ type, setStatus }) => (
|
||||||
<div style={{ textAlign: 'center', margin: '40% 15 10' }}>
|
<div style={{ textAlign: 'center', margin: '40% 15 10' }}>
|
||||||
<Typography variant="title" style={{ marginBottom: '1rem' }}>
|
<Typography variant="title" style={{ marginBottom: '1rem' }}>
|
||||||
{Copy[type]['title']['sub']}<br/>
|
{Copy[type]['title']['sub']}<br/>
|
||||||
@ -183,7 +183,7 @@ const TransactionComplete = ({ type }) => (
|
|||||||
<Typography variant="subheading" style={{ color: '#939BA1' }}>
|
<Typography variant="subheading" style={{ color: '#939BA1' }}>
|
||||||
{Copy[type]['subheading']}
|
{Copy[type]['subheading']}
|
||||||
</Typography>
|
</Typography>
|
||||||
<MobileButton text="Main Page" style={{ marginTop: '12rem' }} />
|
<MobileButton text="Main Page" style={{ marginTop: '12rem' }} onClick={() => { setStatus(null) } } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ class Register extends PureComponent {
|
|||||||
preRegisteredCallback={() => { this.setState({ submitted: true }) }}
|
preRegisteredCallback={() => { this.setState({ submitted: true }) }}
|
||||||
registeredCallbackFn={this.onRegistered} />
|
registeredCallbackFn={this.onRegistered} />
|
||||||
</Fragment> :
|
</Fragment> :
|
||||||
submitted && !registered ? <TransactionComplete type="registered" /> : <RenderAddresses {...this.props} address={registered.address} statusAccount={registered.statusAccount} />}
|
submitted && !registered ? <TransactionComplete type="registered" setStatus={setStatus} /> : <RenderAddresses {...this.props} address={registered.address} statusAccount={registered.statusAccount} />}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user