Discovery UI #2477
|
@ -24,7 +24,7 @@ type Props = {
|
|||
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
![]() Not really a fan of Sort isn't really a good name. Not really a fan of `sort`. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)
Sort isn't really a good name.
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
|
||||
|
||||
export default function FileList(props: Props) {
|
||||
const { uris, header, headerAltControls, injectedItem, loading, persistedStorageKey, noHeader, slim, empty } = props;
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey || 'file-list-global-sort', SORT_NEW);
|
||||
![]() Not really a fan of Sort isn't really a good name. Not really a fan of `sort`. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)
Sort isn't really a good name.
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
![]() Not really a fan of Sort isn't really a good name. Not really a fan of `sort`. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)
Sort isn't really a good name.
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
|
||||
const sortedUris = uris && currentSort === SORT_OLD ? uris.reverse() : uris;
|
||||
const hasUris = uris && !!uris.length;
|
||||
|
||||
|
|
|||
![]() Not really a fan of Sort isn't really a good name. Not really a fan of `sort`. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)
Sort isn't really a good name.
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
![]() Not really a fan of Sort isn't really a good name. Not really a fan of `sort`. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)
Sort isn't really a good name.
![]() I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes. Also, are passing I think using this as a flag to both trigger default behavior and as the string key for storing state is mixing purposes.
Also, are passing `header` and `defaultHeader` mutually exclusive? If so, maybe omitting `header` can trigger default behavior and we can be explicit about the key being for state storage.
![]() Probably should just be named Probably should just be named `file_sort`.
![]() I agree it was pretty messy. I added I added a key for every component right now. I agree it was pretty messy. I added `persistedStorageKey` and use the default header if no `header` is passed in. If no `peristedStorageKey` is passed in, it will share state with other instances of the component that don't pass it in.
I added a key for every component right now.
![]() so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed so if I pass nothing or false, it still persists in a global namespace? IMO make all persisting here explicit and do not persist if a value isn't passed
![]()
`headerAltControls`? `headerSecondaryControls`? or same names without the word header?
|
|
@ -1,10 +1,10 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectIsFetchingClaimListMine, selectMyClaimsWithoutChannels } from 'lbry-redux';
|
||||
import { selectIsFetchingClaimListMine, selectMyClaimUrisWithoutChannels } from 'lbry-redux';
|
||||
import { doCheckPendingPublishes } from 'redux/actions/publish';
|
||||
import FileListPublished from './view';
|
||||
|
||||
const select = state => ({
|
||||
claims: selectMyClaimsWithoutChannels(state),
|
||||
uris: selectMyClaimUrisWithoutChannels(state),
|
||||
fetching: selectIsFetchingClaimListMine(state),
|
||||
});
|
||||
|
||||
|
|
|
@ -5,27 +5,23 @@ import FileList from 'component/fileList';
|
|||
import Page from 'component/page';
|
||||
|
||||
type Props = {
|
||||
claims: Array<StreamClaim>,
|
||||
uris: Array<string>,
|
||||
checkPendingPublishes: () => void,
|
||||
fetching: boolean,
|
||||
};
|
||||
|
||||
function FileListPublished(props: Props) {
|
||||
const { checkPendingPublishes, fetching, claims } = props;
|
||||
const { checkPendingPublishes, fetching, uris } = props;
|
||||
|
||||
useEffect(() => {
|
||||
checkPendingPublishes();
|
||||
}, [checkPendingPublishes]);
|
||||
|
||||
return (
|
||||
<Page notContained loading={fetching}>
|
||||
{claims && claims.length ? (
|
||||
<Page notContained>
|
||||
{uris && uris.length ? (
|
||||
<div className="card">
|
||||
<FileList
|
||||
persistedStorageKey="file-list-published"
|
||||
// TODO: adjust selector to only return uris
|
||||
uris={claims.map(info => `lbry://${info.name}#${info.claim_id}`)}
|
||||
/>
|
||||
<FileList loading={fetching} persistedStorageKey="file-list-published" uris={uris} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="main--empty">
|
||||
|
|
Not really a fan of
sort
. This is the item on the right side of the header. Currently the two pages that use this are the homepage (trending/best/new) and search feedback (satisfied with results?)Sort isn't really a good name.