Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GAL-5440] add Suggested Profiles in curated Feed web #2429

Merged
merged 12 commits into from
Apr 19, 2024

Conversation

Rohan-cp
Copy link
Collaborator

@Rohan-cp Rohan-cp commented Apr 17, 2024

Summary of Changes

adds a new item (the Suggested Profiles section) in the Curated Feed after the 8th feed list item.

Demo or Before/After Pics

  • If this is a new feature, include screenshots or recordings of the feature in action.
  • If this PR makes visual changes, include before and after screenshots.
Design Demo with changes
Screenshot 2024-04-17 at 12 07 17 Screenshot 2024-04-17 at 12 07 29

Edge Cases

Moweb:
Screenshot 2024-04-17 at 13 06 36

Testing Steps

Provide steps on how the reviewer can test the changes.

Checklist

Please make sure to review and check all of the following:

  • I've tested the changes and all tests pass.
  • (if web) I've tested the changes on various desktop screen sizes to ensure responsiveness.
  • (if mobile) I've tested the changes on both light and dark modes.

Copy link

vercel bot commented Apr 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 0:30am

@github-actions github-actions bot added the web label Apr 17, 2024
Copy link

github-actions bot commented Apr 17, 2024

Bundle Sizes

Compared against b120793

Route Size (gzipped) Diff
/[username]/posts 801 KB +9.45 KB
/community/[chain]/[contractAddress] 796.82 KB +9.38 KB
/community/artblocks/[contractAddress]/[projectId] 796.85 KB +9.38 KB
/community/prohibition/[contractAddress]/[projectId] 796.85 KB +9.38 KB
/following 771.64 KB +9.41 KB
/home 773.26 KB +9.47 KB
/latest 771.11 KB +9.45 KB
Dynamic import Size (gzipped) Diff
../src/contexts/relay/network.ts -> persisted_queries.json 103.49 KB +1.93 KB

@@ -89,6 +89,7 @@ export default function CuratedFeed({ queryRef }: Props) {
loadNextPage={loadNextPage}
hasNext={hasPrevious}
feedMode={'WORLDWIDE'}
showSuggestedProfiles={true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can just pass in showSuggestedProfiles without setting to true

  feedMode={'WORLDWIDE'}
  showSuggestedProfiles
  ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the change!

Comment on lines 68 to 71
const suggestedProfileSectionHeight = useMemo(
() => (isMobileOrMobileLargeWindowWidth ? 320 : 360),
[isMobileOrMobileLargeWindowWidth]
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: don't need to memoize primitive types; memoization mostly meant for complex types like computed values, arrays, objects.

can just do:

const suggestedProfileSectionHeight = isMobileOrMobileLargeWindowWidth ? 320 : 360

if (showSuggestedProfiles && feedData?.length >= suggestedProfileSectionIdx) {
const suggestedProfileSectionData = {
__typename: 'SuggestedProfileSection',
dbid: '12345',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use uuid(), we use it in a couple other places in the repo

const rowCount = hasNext ? feedData.length + 1 : feedData.length;
const rowCount = hasNext ? finalFeedData.length + 1 : finalFeedData.length;

const rowHeight = useCallback(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work figuring this out!

Comment on lines 59 to 66
const path = {
pathname: '/[username]',
query: { username: username },
} as Route;

if (!path) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we need the check on L64-66 if path is clearly defined on L59?

queryRef
);
return (
<ReportingErrorBoundary fallback={<></>}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have skeleton states?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right I was just following the structure for the other feed items and they didn't have a ReportingErrorBoundary or Suspense fallback (attached sc of one). So do you think we should add the skeleton state here for this section?

Screenshot 2024-04-17 at 14 49 22

@Robinnnnn Robinnnnn merged commit f6f05ef into main Apr 19, 2024
7 checks passed
@Robinnnnn Robinnnnn deleted the rohan/feed-suggested-web branch April 19, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants