-
Notifications
You must be signed in to change notification settings - Fork 184
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
fix: public squads integration #3118
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments from my side :)
extends Pick<UseFeedOptionalParams<T>, 'options'>, | ||
extends Pick< | ||
UseFeedOptionalParams<T>, | ||
'options' | 'showPublicSquadsEligibility' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be one of the options better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that at first, but it was a type from useQuery
itself. options?: UseInfiniteQueryOptions<FeedData>
Thought it would be simpler just to add it.
@@ -34,5 +73,29 @@ export const usePublicSquadRequests = (): UsePublicSquadRequestsResult => { | |||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we maybe memoize some of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Most of the values here are stable. I think we can memoize the status so we won't have to instantiate and calculate days all the time.
Would love to hear you guys think 👀 cc @rebelchris @nensidosari |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor questions, think we can almost wrap this up :)
packages/shared/src/components/squads/PublicSquadEligibilityCard.tsx
Outdated
Show resolved
Hide resolved
packages/shared/src/components/squads/PublicSquadEligibilityCard.tsx
Outdated
Show resolved
Hide resolved
const fourteenDaysAgo = subDays(new Date(), 14); | ||
const requestDate = new Date(latestRequest.createdAt); | ||
return fourteenDaysAgo < requestDate | ||
? SquadStatus.Rejected | ||
: SquadStatus.InProgress; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what was discussed on RFC, but why do we do this logic on the frontend, feels like this should be handled on API side?
CC: @capJavert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to be used for validation but something we need to display some alert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool no blockers code wise from my side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good from my side as well! 🚀
Changes
Events
Did you introduce any new tracking events?
Don't forget to update the Analytics Taxonomy sheet
Log the new/changed events below:
Please make sure existing components are not breaking/affected by this PR
Manual Testing
On those affected packages:
Did you test the modified components media queries?
Did you test on actual mobile devices?
MI-336 #done
MI-344 #done
Preview domain
https://mi-336.preview.app.daily.dev