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

Adjusted FAQ page code to improve page efficiency and code conventions. #364

Merged
merged 2 commits into from
May 5, 2024

Conversation

kea-roy
Copy link
Member

@kea-roy kea-roy commented May 3, 2024

Summary

Adjusted FAQ page code to improve page efficiency and code conventions.

  1. Changed name of constant "dark-red" to "red-7"
  2. Moved useStyles constant outside of collapsiblequestion component and adjusted code to support mobile styling based on className instead of boolean variable.
  3. Moved useStyles constant outside of faq page component and adjusted code to support mobile styling based on className instead of boolean variable.

@dti-github-bot
Copy link
Member

dti-github-bot commented May 3, 2024

[diff-counting] Significant lines: 283.

Copy link
Contributor

@ggsawatyanon ggsawatyanon left a comment

Choose a reason for hiding this comment

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

Good job on changing the color name. For the isMobile conditional styling, using a ternary operator and the style prop would help reduce repetitiveness in code. Here is an example from ReviewModal:
image
image

@kea-roy
Copy link
Member Author

kea-roy commented May 4, 2024

Commit Changes

  1. Undid all changes in the previous commit
  2. Changed name of constant "dark-red" to "red-7"
  3. Moved useStyles constant outside of collapsiblequestion component and adjusted code to support mobile styling based on className instead of boolean variable by storing desktop styling in useStyles and mobile styling in the component's style using ternary operators.
  4. Moved useStyles constant outside of faq page component and adjusted code to support mobile styling based on className instead of boolean variable by storing desktop styling in useStyles and mobile styling in the component's style using ternary operators.

@kea-roy kea-roy requested a review from ggsawatyanon May 4, 2024 03:49
@kea-roy kea-roy dismissed ggsawatyanon’s stale review May 4, 2024 05:33

Resolved requested changes

Copy link
Contributor

@ggsawatyanon ggsawatyanon left a comment

Choose a reason for hiding this comment

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

Thanks again for changing everything as requested, this looks great and demonstrates good coding practice.

@ggsawatyanon ggsawatyanon merged commit 5b54763 into main May 5, 2024
5 checks passed
@ggsawatyanon ggsawatyanon deleted the faq-page-adjustments branch May 5, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants