Support channel definitions from /file/list_homepage #1267

Merged
daovist merged 1 commit from explore-channels into master 2018-05-24 22:15:04 +02:00
daovist commented 2018-04-03 20:16:03 +02:00 (Migrated from github.com)

This PR for issue #1049

Is ready to be reviewed by @liamcardenas

Uses existing reducers, actions, selectors

Moves component/common/category-list.jsx to its own top level component at component/categoryList because it needs props to fetchChannel and select claimsByChannel and claimsById

Fetches channels in componentDidMount when the category is a channel

Returns false in isCardVisible when !section -- this fixed the error I was getting; I'm not sure exactly how the code for the UI works

Adds const channel to the CategoryList render function, which is an empty array until the data comes in, and once the data comes in is an array of proper uris made with 'buildURIfromcategory` selector data

Maps the channel array to <FileCard> components when appropriate

Displays a ' for a channel (categoryLink, names=[]) when featuredUris[category].lengthis false inDiscoverPage`

Imports CategoryList from new location in Discover and Subscriptions pages

Fixes various linting errors I found along the way

Includes fake data for demo/testing purposes to be removed after review/updates

This PR for issue #1049 Is ready to be reviewed by @liamcardenas Uses existing reducers, actions, selectors Moves `component/common/category-list.jsx` to its own top level component at `component/categoryList` because it needs props to `fetchChannel` and select `claimsByChannel` and `claimsById` Fetches channels in `componentDidMount` when the category is a channel Returns false in `isCardVisible` when `!section` -- this fixed the error I was getting; I'm not sure exactly how the code for the UI works Adds const `channel` to the `CategoryList` `render` function, which is an empty array until the data comes in, and once the data comes in is an array of proper uris made with 'buildURI` from `category` selector data Maps the `channel` array to `<FileCard>` components when appropriate Displays a '<CategoryList>` for a channel (`categoryLink`, `names=[]`) when `featuredUris[category].length` is false in `DiscoverPage` Imports `CategoryList` from new location in Discover and Subscriptions pages Fixes various linting errors I found along the way Includes fake data for demo/testing purposes to be removed after review/updates
neb-b (Migrated from github.com) requested changes 2018-05-11 04:06:24 +02:00
neb-b (Migrated from github.com) left a comment

This is really close. I think some of the logic can be removed since we already have code that handles this. It just uses the same data that page 1 of the channel page uses.

This is really close. I think some of the logic can be removed since we already have code that handles this. It just uses the same data that page 1 of the channel page uses.
neb-b (Migrated from github.com) commented 2018-05-11 04:04:45 +02:00

You can use the Caim type that I recently created.

You can use the `Caim` type that I recently created.
@ -0,0 +31,4 @@
super();
this.state = {
canScrollPrevious: false,
neb-b (Migrated from github.com) commented 2018-05-11 04:04:26 +02:00

Use makeSelectFetchingChannelClaims to make sure we aren't already fetching for this channel.

Use `makeSelectFetchingChannelClaims` to make sure we aren't already fetching for this channel.
@ -0,0 +158,4 @@
}
}
}
neb-b (Migrated from github.com) commented 2018-05-11 04:03:36 +02:00

👍

👍
@ -0,0 +196,4 @@
scrollTarget = cards[0].offsetLeft;
}
scrollTarget -= firstCardOffsetLeft; // to play nice with the margins
neb-b (Migrated from github.com) commented 2018-05-11 03:58:43 +02:00

A better name for this is probably channelURIs

A better name for this is probably `channelURIs`
neb-b (Migrated from github.com) commented 2018-05-11 04:03:21 +02:00

you should also be able to use makeSelectClaimsInChannelForCurrentPage, which is what the channel page uses. Just get the first page of content and you won't have to worry about this logic.

you should also be able to use `makeSelectClaimsInChannelForCurrentPage`, which is what the channel page uses. Just get the first page of content and you won't have to worry about this logic.
neb-b (Migrated from github.com) commented 2018-05-11 03:57:30 +02:00

This prop should just have a default value of []

This prop should just have a default value of `[]`
neb-b (Migrated from github.com) commented 2018-05-11 03:57:55 +02:00

These changes aren't needed anymore since subscriptions page isn't using this component

These changes aren't needed anymore since subscriptions page isn't using this component
daovist (Migrated from github.com) reviewed 2018-05-22 16:38:11 +02:00
@ -0,0 +196,4 @@
scrollTarget = cards[0].offsetLeft;
}
scrollTarget -= firstCardOffsetLeft; // to play nice with the margins
daovist (Migrated from github.com) commented 2018-05-22 16:38:11 +02:00

I have tried using in the makeSelectClaimsInChannelForCurrentPage selector in place of the other two and the logic that goes with them, and I keep running into problems. I'm passing props.categoryLink as the uri, which I think should be fine based on console logging props. I have tried various forms of the makeSelect pattern I found in the RewardLink container-component to no avail, including rewriting the selectors, but there are so many not-working version I'm not sure what to push/show you.

I have tried using in the [makeSelectClaimsInChannelForCurrentPage](https://github.com/lbryio/lbry-redux/blob/master/src/redux/selectors/claims.js#L73) selector in place of the other two and the logic that goes with them, and I keep running into problems. I'm passing `props.categoryLink` as the `uri`, which I think should be fine based on console logging props. I have tried various forms of the makeSelect pattern I found in the [RewardLink container-component](https://github.com/lbryio/lbry-app/blob/master/src/renderer/component/rewardLink/index.js#L11) to no avail, including rewriting the selectors, but there are so many not-working version I'm not sure what to push/show you.
daovist (Migrated from github.com) reviewed 2018-05-22 16:49:46 +02:00
@ -0,0 +196,4 @@
scrollTarget = cards[0].offsetLeft;
}
scrollTarget -= firstCardOffsetLeft; // to play nice with the margins
daovist (Migrated from github.com) commented 2018-05-22 16:49:46 +02:00

@skhameneh

@skhameneh
daovist commented 2018-05-22 19:30:49 +02:00 (Migrated from github.com)

This PR still contains sample data to demonstrate the functionality. I will remove it and clean up commit history following approval.

This PR still contains sample data to demonstrate the functionality. I will remove it and clean up commit history following approval.
neb-b commented 2018-05-24 05:43:45 +02:00 (Migrated from github.com)

Lets merge this. @daovist once you remove the mock data I'll merge

Lets merge this. @daovist once you remove the mock data I'll merge
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#1267
No description provided.