Publish UX #44
5 changed files with 25 additions and 14 deletions
|
@ -12,7 +12,7 @@
|
||||||
"base-64": "^0.1.0",
|
"base-64": "^0.1.0",
|
||||||
"@expo/vector-icons": "^8.1.0",
|
"@expo/vector-icons": "^8.1.0",
|
||||||
"gfycat-style-urls": "^1.0.3",
|
"gfycat-style-urls": "^1.0.3",
|
||||||
"lbry-redux": "lbryio/lbry-redux#3133ea60b0302c162f7b6f67cc858997f1d2ab52",
|
"lbry-redux": "lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55",
|
||||||
"lbryinc": "lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
|
"lbryinc": "lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
|
||||||
"lodash": ">=4.17.11",
|
"lodash": ">=4.17.11",
|
||||||
"merge": ">=1.2.1",
|
"merge": ">=1.2.1",
|
||||||
|
|
|
@ -30,11 +30,14 @@ export default class ChannelSelector extends React.PureComponent {
|
||||||
if (!channels.length && !fetchingChannels) {
|
if (!channels.length && !fetchingChannels) {
|
||||||
fetchChannelListMine();
|
fetchChannelListMine();
|
||||||
}
|
}
|
||||||
|
this.setState({ currentSelectedValue: channelName });
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { channelName } = this.props;
|
const { channels: prevChannels = [], channelName } = this.props;
|
||||||
if (this.state.currentSelectedValue !== channelName) {
|
const { channels = [] } = nextProps;
|
||||||
|
|
||||||
|
if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
|
||||||
this.setState({ currentSelectedValue: channelName });
|
this.setState({ currentSelectedValue: channelName });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ type Props = {
|
||||||
id: string,
|
id: string,
|
||||||
reward_title: string,
|
reward_title: string,
|
||||||
reward_amount: number,
|
reward_amount: number,
|
||||||
|
reward_range?: string,
|
||||||
transaction_id: string,
|
transaction_id: string,
|
||||||
created_at: string,
|
created_at: string,
|
||||||
reward_description: string,
|
reward_description: string,
|
||||||
|
@ -55,6 +56,20 @@ class RewardCard extends React.PureComponent<Props> {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getDisplayAmount = () => {
|
||||||
|
const { reward } = this.props;
|
||||||
|
if (reward) {
|
||||||
|
if (reward.reward_range && reward.reward_range.includes('-')) {
|
||||||
|
return reward.reward_range.split('-')[0] + '+'; // ex: 5+
|
||||||
|
} else if (reward.reward_amount > 0) {
|
||||||
|
return reward.reward_amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unknown amount which normally shouldn't happen
|
||||||
|
return '?';
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { canClaim, isPending, onClaimPress, reward } = this.props;
|
const { canClaim, isPending, onClaimPress, reward } = this.props;
|
||||||
const claimed = !!reward.transaction_id;
|
const claimed = !!reward.transaction_id;
|
||||||
|
@ -101,7 +116,7 @@ class RewardCard extends React.PureComponent<Props> {
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View style={rewardStyle.rightCol}>
|
<View style={rewardStyle.rightCol}>
|
||||||
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
|
<Text style={rewardStyle.rewardAmount}>{this.getDisplayAmount()}</Text>
|
||||||
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
|
@ -390,7 +390,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (email.trim().length > 0 && (email.indexOf('@') === -1 || email.indexOf('.') === -1)) {
|
if (email && email.trim().length > 0 && (email.indexOf('@') === -1 || email.indexOf('.') === -1)) {
|
||||||
notify({ message: 'Please provide a valid email address.' });
|
notify({ message: 'Please provide a valid email address.' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1096,17 +1096,10 @@ class PublishPage extends React.PureComponent {
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={publishStyle.warning}>
|
|
||||||
<Text style={publishStyle.warningText}>
|
|
||||||
Please ensure that you have filled everything correctly as you cannot edit published content in this
|
|
||||||
release. This feature will be available in a future release.
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<View style={publishStyle.actionButtons}>
|
<View style={publishStyle.actionButtons}>
|
||||||
{(this.state.publishStarted || publishFormValues.publishing) && (
|
{(this.state.publishStarted || publishFormValues.publishing) && (
|
||||||
<View style={publishStyle.progress}>
|
<View style={publishStyle.progress}>
|
||||||
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
|
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue