Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78f2b4f3be | ||
|
|
0fe32e1a36 | ||
|
|
f008d95aa6 | ||
|
|
c4218d9f8b | ||
|
|
e95786b904 | ||
|
|
f02fdd9979 | ||
|
|
563a9135ce | ||
|
|
39eb2b1a96 | ||
|
|
2f0014be08 | ||
|
|
27c0ac7585 | ||
|
|
44856e1ba1 |
No files matched your search
@@ -13,7 +13,6 @@ type Props = {
|
||||
id: string,
|
||||
reward_title: string,
|
||||
reward_amount: number,
|
||||
reward_range?: string,
|
||||
transaction_id: string,
|
||||
created_at: string,
|
||||
reward_description: string,
|
||||
@@ -56,20 +55,6 @@ 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() {
|
||||
const { canClaim, isPending, onClaimPress, reward } = this.props;
|
||||
const claimed = !!reward.transaction_id;
|
||||
@@ -116,7 +101,7 @@ class RewardCard extends React.PureComponent<Props> {
|
||||
)}
|
||||
</View>
|
||||
<View style={rewardStyle.rightCol}>
|
||||
<Text style={rewardStyle.rewardAmount}>{this.getDisplayAmount()}</Text>
|
||||
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
|
||||
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
selectPurchaseUriErrorMessage,
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
doClaimEligiblePurchaseRewards,
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
selectRewardContentClaimIds,
|
||||
@@ -73,7 +72,6 @@ const select = (state, props) => {
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
|
||||
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
|
||||
},
|
||||
|
||||
@@ -478,7 +478,6 @@ class FilePage extends React.PureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
const { claimEligibleRewards } = this.props;
|
||||
const { nout, claim_id: claimId, txid } = claim;
|
||||
const outpoint = `${txid}:${nout}`;
|
||||
const params = {
|
||||
@@ -490,9 +489,7 @@ class FilePage extends React.PureComponent {
|
||||
params.time_to_start = timeToStart;
|
||||
}
|
||||
|
||||
Lbryio.call('file', 'view', params)
|
||||
.then(() => claimEligibleRewards())
|
||||
.catch(() => {});
|
||||
Lbryio.call('file', 'view', params).catch(() => {});
|
||||
this.setState({ fileViewLogged: true });
|
||||
};
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ class PublishPage extends React.PureComponent {
|
||||
state = {
|
||||
canPublish: false,
|
||||
canUseCamera: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
titleFocused: false,
|
||||
descriptionFocused: false,
|
||||
@@ -121,7 +120,6 @@ class PublishPage extends React.PureComponent {
|
||||
otherLicenseDescription: '',
|
||||
name: null,
|
||||
price: 0,
|
||||
currency: 'LBC',
|
||||
uri: null,
|
||||
tags: [],
|
||||
selectedChannel: null,
|
||||
@@ -139,8 +137,6 @@ class PublishPage extends React.PureComponent {
|
||||
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
|
||||
DeviceEventEmitter.addListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
|
||||
DeviceEventEmitter.addListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -149,8 +145,6 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
DeviceEventEmitter.removeListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
|
||||
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
}
|
||||
|
||||
handleGalleryThumbnailChecked = evt => {
|
||||
@@ -242,7 +236,6 @@ class PublishPage extends React.PureComponent {
|
||||
licenseUrl,
|
||||
otherLicenseDescription,
|
||||
name,
|
||||
currency: fee && fee.currency ? fee.currency : 'LBC',
|
||||
price: fee && fee.amount ? fee.amount : 0,
|
||||
priceSet: fee && fee.amount > 0,
|
||||
tags: tags && tags.length > 0 ? tags : [],
|
||||
@@ -298,7 +291,6 @@ class PublishPage extends React.PureComponent {
|
||||
bid,
|
||||
channelName,
|
||||
currentMedia,
|
||||
currency,
|
||||
description,
|
||||
language,
|
||||
license,
|
||||
@@ -342,7 +334,7 @@ class PublishPage extends React.PureComponent {
|
||||
otherLicenseDescription,
|
||||
name: name || undefined,
|
||||
contentIsFree: !priceSet,
|
||||
fee: { currency, amount: price },
|
||||
fee: { currency: 'LBC', amount: price },
|
||||
uri: uri || undefined,
|
||||
channel: CLAIM_VALUES.CHANNEL_ANONYMOUS === channelName ? null : channelName,
|
||||
isStillEditing: false,
|
||||
@@ -414,7 +406,6 @@ class PublishPage extends React.PureComponent {
|
||||
this.setState(
|
||||
{
|
||||
publishStarted: false,
|
||||
documentPickerOpen: false,
|
||||
editMode: false,
|
||||
|
||||
currentMedia: null,
|
||||
@@ -466,36 +457,6 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
handleUploadPressed = () => {
|
||||
if (this.state.documentPickerOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState(
|
||||
{
|
||||
documentPickerOpen: true,
|
||||
},
|
||||
() => {
|
||||
NativeModules.UtilityModule.openDocumentPicker('*/*');
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
onFilePicked = evt => {
|
||||
this.setState({ documentPickerOpen: false }, () => {
|
||||
const currentMedia = {
|
||||
id: -1,
|
||||
filePath: `file://${evt.path}`,
|
||||
duration: 0,
|
||||
};
|
||||
this.setCurrentMedia(currentMedia);
|
||||
});
|
||||
};
|
||||
|
||||
onPickerCanceled = () => {
|
||||
this.setState({ documentPickerOpen: false });
|
||||
};
|
||||
|
||||
handleCloseCameraPressed = () => {
|
||||
this.setState({ showCameraOverlay: false, videoRecordingMode: false });
|
||||
};
|
||||
@@ -694,10 +655,6 @@ class PublishPage extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
handleCurrencyValueChange = currency => {
|
||||
this.setState({ currency });
|
||||
};
|
||||
|
||||
handleDescriptionChange = description => {
|
||||
this.setState({ description });
|
||||
};
|
||||
@@ -770,10 +727,12 @@ class PublishPage extends React.PureComponent {
|
||||
<Icon name="camera" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Take a photo</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
|
||||
<Icon name="file-upload" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Upload a file</Text>
|
||||
</TouchableOpacity>
|
||||
{false && (
|
||||
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
|
||||
<Icon name="file-upload" size={48} color={Colors.White} />
|
||||
<Text style={publishStyle.actionText}>Upload a file</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
@@ -930,16 +889,7 @@ class PublishPage extends React.PureComponent {
|
||||
value={String(this.state.price)}
|
||||
onChangeText={this.handlePriceChange}
|
||||
/>
|
||||
<Picker
|
||||
style={publishStyle.currencyPicker}
|
||||
enabled={this.state.canPublish && !this.state.publishStarted}
|
||||
selectedValue={this.state.currency}
|
||||
itemStyle={publishStyle.pickerItem}
|
||||
onValueChange={this.handleCurrencyValueChange}
|
||||
>
|
||||
<Picker.Item label={'LBC'} value={'LBC'} />
|
||||
<Picker.Item label={'USD'} value={'USD'} />
|
||||
</Picker>
|
||||
<Text style={publishStyle.currency}>LBC</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
@@ -86,7 +86,7 @@ const publishStyle = StyleSheet.create({
|
||||
marginTop: 8,
|
||||
},
|
||||
photo: {
|
||||
height: 120,
|
||||
height: 240,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
@@ -366,9 +366,6 @@ const publishStyle = StyleSheet.create({
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
currencyPicker: {
|
||||
width: 100,
|
||||
},
|
||||
fullCentered: {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
|
||||
Reference in new issue
Block a user