Comment requirements

This commit is contained in:
Mustafa Buyukcelebi 2019-07-04 16:42:22 +03:00
parent 3339d3450f
commit 5bbb04da34
5 changed files with 31 additions and 17 deletions

View File

@ -202,7 +202,8 @@
"copied": "Copied!", "copied": "Copied!",
"no_internet": "No connection!", "no_internet": "No connection!",
"confirm": "Confirm", "confirm": "Confirm",
"removed": "Removed" "removed": "Removed",
"same_user": "This user already added to list"
}, },
"post": { "post": {
"reblog_alert": "Are you sure you want to reblog?", "reblog_alert": "Are you sure you want to reblog?",

View File

@ -23,7 +23,7 @@ import WithdrawAccountModal from './withdrawAccountModal';
import parseToken from '../../../utils/parseToken'; import parseToken from '../../../utils/parseToken';
import parseDate from '../../../utils/parseDate'; import parseDate from '../../../utils/parseDate';
import { vestsToSp } from '../../../utils/conversions'; import { vestsToSp } from '../../../utils/conversions';
import isEmptyDate from '../../../utils/isEmptyDate'; import { isEmptyDate } from '../../../utils/time';
import styles from './transferStyles'; import styles from './transferStyles';
/* Props /* Props
@ -108,7 +108,7 @@ class PowerDownView extends Component {
return this._renderButton(); return this._renderButton();
} }
return ( return (
<View> <Fragment>
{destinationAccounts.map(item => ( {destinationAccounts.map(item => (
<View style={styles.destinationAccountsLists} key={item.username}> <View style={styles.destinationAccountsLists} key={item.username}>
<Text>{item.username}</Text> <Text>{item.username}</Text>
@ -123,7 +123,7 @@ class PowerDownView extends Component {
</View> </View>
))} ))}
{this._renderButton()} {this._renderButton()}
</View> </Fragment>
); );
}; };
@ -150,13 +150,9 @@ class PowerDownView extends Component {
_renderIncomingFunds = (poweringDownFund, poweringDownVests, nextPowerDown) => ( _renderIncomingFunds = (poweringDownFund, poweringDownVests, nextPowerDown) => (
<Fragment> <Fragment>
<Text style={{ color: 'green', fontSize: 20, marginVertical: 5 }}> <Text style={styles.incomingFundSteem}>{`+ ${poweringDownFund} STEEM`}</Text>
{`+ ${poweringDownFund} STEEM`} <Text style={styles.incomingFundVests}>{`- ${poweringDownVests} VESTS`}</Text>
</Text> <Text style={styles.nextPowerDown}>{nextPowerDown}</Text>
<Text style={{ color: 'red', fontSize: 15, marginVertical: 5 }}>
{`- ${poweringDownVests} VESTS`}
</Text>
<Text style={{ marginVertical: 5 }}>{nextPowerDown}</Text>
</Fragment> </Fragment>
); );
@ -172,7 +168,7 @@ class PowerDownView extends Component {
_handleOnSubmit = (username, percent, autoPowerUp) => { _handleOnSubmit = (username, percent, autoPowerUp) => {
const { destinationAccounts } = this.state; const { destinationAccounts } = this.state;
const { setWithdrawVestingRoute, currentAccountName } = this.props; const { setWithdrawVestingRoute, currentAccountName, intl } = this.props;
if (!destinationAccounts.some(item => item.username === username)) { if (!destinationAccounts.some(item => item.username === username)) {
destinationAccounts.push({ username, percent, autoPowerUp }); destinationAccounts.push({ username, percent, autoPowerUp });
@ -182,7 +178,10 @@ class PowerDownView extends Component {
destinationAccounts, destinationAccounts,
}); });
} else { } else {
Alert.alert('Opps!', 'same username'); Alert.alert(
intl.formatMessage({ id: 'alert.fail' }),
intl.formatMessage({ id: 'alert.same_user' }),
);
} }
}; };
@ -202,11 +201,11 @@ class PowerDownView extends Component {
let poweringDownVests = 0; let poweringDownVests = 0;
let availableVestingShares = 0; let availableVestingShares = 0;
const poweringDown = !isEmptyDate(selectedAccount.next_vesting_withdrawal); const poweringDown = !isEmptyDate(get(selectedAccount, 'next_vesting_withdrawal'));
const nextPowerDown = parseDate(selectedAccount.next_vesting_withdrawal); const nextPowerDown = parseDate(get(selectedAccount, 'next_vesting_withdrawal'));
if (poweringDown) { if (poweringDown) {
poweringDownVests = parseToken(selectedAccount.vesting_withdraw_rate); poweringDownVests = parseToken(get(selectedAccount, 'vesting_withdraw_rate'));
} else { } else {
availableVestingShares = availableVestingShares =
parseToken(get(selectedAccount, 'vesting_shares')) - parseToken(get(selectedAccount, 'vesting_shares')) -

View File

@ -179,4 +179,17 @@ export default EStyleSheet.create({
justifyContent: 'space-around', justifyContent: 'space-around',
margin: 20, margin: 20,
}, },
incomingFundSteem: {
color: 'green',
fontSize: 20,
marginVertical: 5,
},
incomingFundVests: {
color: 'red',
fontSize: 15,
marginVertical: 5,
},
nextPowerDown: {
marginVertical: 5,
},
}); });

View File

@ -1 +0,0 @@
export default s => parseInt(s.split('-')[0], 10) < 1980;

View File

@ -40,3 +40,5 @@ export const isEmptyContentDate = value => {
return parseInt(value.split('-')[0], 10) < 1980; return parseInt(value.split('-')[0], 10) < 1980;
}; };
export const isEmptyDate = s => parseInt(s.split('-')[0], 10) < 1980;