claim search options tweaks

add image, bodel, binary
fix duration reset/disable
This commit is contained in:
jessop 2020-02-29 12:24:13 -05:00
parent 7a572f0c08
commit 5e1ba4aaf5
3 changed files with 58 additions and 37 deletions

View file

@ -989,6 +989,20 @@
"Share usage data with LBRY inc.": "Share usage data with LBRY inc.",
"Required": "Required",
"Email %help_link% or join our %chat_link% if you encounter any trouble verifying.": "Email %help_link% or join our %chat_link% if you encounter any trouble verifying.",
"Show reposts": "Show reposts",
"Show reposts from the creators you follow.": "Show reposts from the creators you follow."
"Only apply a few tags that are relevant to your content, and use the Mature tag as appropriate. Tag abuse will not be tolerated.": "Only apply a few tags that are relevant to your content, and use the Mature tag as appropriate. Tag abuse will not be tolerated.",
"Add relevant tags...": "Add relevant tags...",
"try again in a few seconds.": "try again in a few seconds.",
"Any": "Any",
"Video": "Video",
"Document": "Document",
"Duration": "Duration",
"Long": "Long",
"Short": "Short",
"How Fresh": "How Fresh",
"This Default": "This Default",
"Sorry, your request returned no results or timed out. Modify your options or %again%": "Sorry, your request returned no results or timed out. Modify your options or %again%",
"Image": "Image",
"Model": "Model",
"Binary": "Binary",
"Other": "Other"
}

View file

@ -236,7 +236,7 @@ function ClaimListDiscover(props: Props) {
),
}}
>
Sorry, your request timed out. Modify your options or %again%
Sorry, your request returned no results or timed out. Modify your options or %again%
</I18nMessage>
</p>
<p>
@ -412,6 +412,9 @@ function ClaimListDiscover(props: Props) {
{type === CS.CLAIM_REPOST && __('Repost')}
{type === CS.FILE_VIDEO && __('Video')}
{type === CS.FILE_AUDIO && __('Audio')}
{type === CS.FILE_IMAGE && __('Image')}
{type === CS.FILE_MODEL && __('Model')}
{type === CS.FILE_BINARY && __('Other')}
{type === CS.FILE_DOCUMENT && __('Document')}
{type === CS.CONTENT_ALL && __('Any')}
</option>
@ -420,39 +423,40 @@ function ClaimListDiscover(props: Props) {
})}
</FormField>
</div>
{options.claim_type !== CS.CLAIM_CHANNEL &&
options.claim_type !== CS.CLAIM_REPOST &&
JSON.stringify(options.stream_types) !== JSON.stringify([CS.FILE_DOCUMENT]) && (
<>
{/* DURATIONS FIELD */}
<div className={'claim-search__input-container'}>
<FormField
className={classnames('claim-search__dropdown', {
'claim-search__dropdown--selected': durationParam,
})}
label={__('Duration')}
type="select"
name="duration"
value={durationParam || CS.DURATION_ALL}
onChange={e =>
handleChange({
key: CS.DURATION_KEY,
value: e.target.value,
})
}
>
{CS.DURATION_TYPES.map(dur => (
<option key={dur} value={dur}>
{/* i18fixme */}
{dur === CS.DURATION_SHORT && __('Short')}
{dur === CS.DURATION_LONG && __('Long')}
{dur === CS.DURATION_ALL && __('Any')}
</option>
))}
</FormField>
</div>
</>
)}
{/* DURATIONS FIELD */}
<div className={'claim-search__input-container'}>
<FormField
className={classnames('claim-search__dropdown', {
'claim-search__dropdown--selected': durationParam,
})}
label={__('Duration')}
type="select"
name="duration"
disabled={
!(
contentTypeParam === null ||
streamTypeParam === CS.FILE_AUDIO ||
streamTypeParam === CS.FILE_VIDEO
)
}
value={durationParam || CS.DURATION_ALL}
onChange={e =>
handleChange({
key: CS.DURATION_KEY,
value: e.target.value,
})
}
>
{CS.DURATION_TYPES.map(dur => (
<option key={dur} value={dur}>
{/* i18fixme */}
{dur === CS.DURATION_SHORT && __('Short')}
{dur === CS.DURATION_LONG && __('Long')}
{dur === CS.DURATION_ALL && __('Any')}
</option>
))}
</FormField>
</div>
</div>
</>
)}

View file

@ -30,7 +30,10 @@ export const DURATION_TYPES = [DURATION_ALL, DURATION_LONG, DURATION_SHORT];
export const FILE_VIDEO = 'video';
export const FILE_AUDIO = 'audio';
export const FILE_DOCUMENT = 'document';
export const FILE_TYPES = [FILE_VIDEO, FILE_AUDIO, FILE_DOCUMENT];
export const FILE_BINARY = 'binary';
export const FILE_IMAGE = 'image';
export const FILE_MODEL = 'model';
export const FILE_TYPES = [FILE_VIDEO, FILE_AUDIO, FILE_DOCUMENT, FILE_IMAGE, FILE_MODEL, FILE_BINARY];
export const CLAIM_CHANNEL = 'channel';
export const CLAIM_STREAM = 'stream';