-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
163 additions
and
40 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/components/ManaCalculator/components/DelegatorSettings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { Details } from '@docusaurus/theme-common/Details'; | ||
import { useManaState } from '../hooks'; | ||
import { fromMicro, toMicro, roundMax } from '../utils'; | ||
|
||
export function DelegatorSettings() { | ||
const { | ||
state, | ||
handleOwnPFChange, | ||
handleOwnFCChange, | ||
handleOwnStakeChange, | ||
handleAttractedNewDelegatedStakeChange, | ||
} = useManaState(); | ||
return ( | ||
<Details | ||
summary='Delegator Settings' | ||
className='mana_calculator__card mana_calculator_inner__card' | ||
> | ||
<label className='inlined-long-label'>Delegated amount ({state.network})</label> | ||
<input | ||
className='mana_calculator__compact inlined' | ||
value={fromMicro(state.stakedOrDelegatedTokens)} | ||
onChange={(e) => | ||
handleOwnStakeChange(toMicro(Number(e.target.value))) | ||
} | ||
></input> | ||
<br /> | ||
</Details> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export enum UserType { | ||
DELEGATOR, | ||
VALIDATOR, | ||
HOLDER, | ||
} | ||
|
||
export enum NetworkType { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters