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

Issue 509/splitting messages inbox outbox #551

Merged
merged 9 commits into from
Dec 2, 2023

Conversation

leekahung
Copy link
Contributor

@leekahung leekahung commented Nov 30, 2023

This PR:

Partially addresses #509 similar to PR #514. This PR is for splitting up the message pages into separate sub-routes, while retaining previous functionalities. Have updated unit tests accordingly and created separate tests for Inbox and Outbox.

Screenshots (if applicable):

Screen.Recording.2023-11-29.at.18.40.52.mov

Future Steps/PRs Needed to Finish This Work (optional):

Issues needing discussion/feedback (optional):

1. Issue #509

@leekahung leekahung added the enhancement Enhancement of existing features label Nov 30, 2023
@leekahung leekahung self-assigned this Nov 30, 2023
@@ -43,7 +45,23 @@ const AppRoutes = () => {
<Route index element={<Contacts />} />
<Route path=":webId" element={<Profile />} />
</Route>
<Route path="/messages" element={<Messages />} />
<Route path="/messages">
{MESSAGE_PAGES_LIST.map((messagePagesProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would this read nicer as messagePage? Then we would get messagePage.path and messagePage.element

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, definitely a nicer read. I'll have this switched up.

Comment on lines 30 to 33
const path = pathLabel.toLowerCase();

setBoxType(path);
navigate(`/messages/${path}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

To decouple the label and the path (thinking about the future, maybe internationalization, etc.), should we add a path property to the routesArray? e.g.

const routesArray = [
  {
    label: 'Inbox',
    path: 'inbox',
  },
  {
    label: 'Outbox',
    path: 'outbox',
  }
];

Copy link
Contributor

Choose a reason for hiding this comment

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

Then below could send handleNavigate(item) and destructure

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand preoptimization is the death of all code, so take this as you will 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, there's definitely room for improvement. I can switch this up too.

@leekahung leekahung merged commit a13f324 into Development Dec 2, 2023
3 checks passed
@leekahung leekahung deleted the issue-509/splitting-messages-inbox-outbox branch December 2, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] - Migrate Message utility functions to custom hook with React Query
2 participants