-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: redirect to first conversation in list #1036
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Small comment
…z/lenster into auto-select-first-conversation
Can you please resolve the conflicts 🙏🏼 |
…o-select-first-conversation Conflicts: src/components/Messages/Message.tsx
@bigint resolved conflicts |
} | ||
|
||
// Borrowed from https://usehooks.com/useWindowSize/ | ||
const useWindowSize = (): Size => { |
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.
We can use tailwind's classes instead of this hook right?
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.
For styling, absolutely. But this is used to change behavior
What does this PR do?
/messages
as a distinct route to show the conversation list)/messages
routeI think this feature is going to get picked up in a planned refactor to merge the
Message.tsx
andindex.tsx
pages into a single route. Right now, the necessary information to execute this redirect is lower in the React tree than is ideal.I also had to add a new React hook to track the window width to avoid this behaviour on mobile, which is unfortunate. Open to other solutions that don't rely on
window.innerWidth
.The PR also changes the send button to only icon in the mobile view and makes the mobile view flow start from 1024px
Fixes # (issue)
CleanShot.2022-10-31.at.10.47.47.mp4
Type of change
How should this be tested?
/messages
page on the desktop. The first conversation should be automatically selected once loading is complete/messages
page on mobile. The conversation list should appear, and it should be possible to navigate to the individual conversation and back.