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

appearance settings changes #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

appearance settings changes #189

wants to merge 1 commit into from

Conversation

oleeh-shd
Copy link
Collaborator

@oleeh-shd oleeh-shd commented Aug 16, 2023

Summary by CodeRabbit

Refactor:

  • Updated JSX code in ChapterPage, Settings, Commentary, Translation, Verse components for better user experience.
  • Modified font sizes in the useMyStyles hook to improve readability.
  • Adjusted default spacing in settings from "large" to "medium" for a more balanced layout.

🎉 Here's to the changes, oh so fine, 🎉

In our code, they intertwine. 🧵

With each tweak and each adjust, 🛠️

We make an app that earns your trust. 💖

@vercel
Copy link

vercel bot commented Aug 16, 2023

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

Name Status Preview Comments Updated (UTC)
bg-frontend ❌ Failed (Inspect) Aug 16, 2023 9:45am
bhagavad-gita ✅ Ready (Inspect) Visit Preview Aug 16, 2023 9:45am

@github-actions
Copy link
Contributor

github-actions bot commented Aug 16, 2023

Image description CodeRabbit

Walkthrough

The changes primarily focus on the visual aspects of the application, adjusting font sizes, spacing, and other appearance settings across various components. The modifications are made in JSX code, a custom hook for styles, and Redux reducer for settings.

Changes

Files Summary
app/chapter/[chapterNumber]/(chapter)/chapter-page.tsx, components/Shared/Settings.tsx, components/Verse/Commentary.tsx, components/Verse/Translation.tsx, components/Verse/Verse.tsx Adjustments to the JSX code have been made to modify the appearance settings of these components. New CSS classes and styles have been added or modified based on dynamic values such as styles.backgroundColor, appearenceSettings?.fontSize, and styles.lineHeight.
hooks/useMyStyles.ts Changes in the useMyStyles hook include modifications to the font sizes. The subHeading2 font size is changed in two places, and the para font size is also adjusted.
redux/reducers/settings.ts The spacing property of the initialState object in the settings reducer has been changed from "large" to "medium", which may affect the appearance settings related to spacing.

@vercel vercel bot temporarily deployed to Preview – bg-frontend August 16, 2023 09:45 Inactive
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 95bf334 and 5d2a5c3 commits.
Files selected (7)
  • app/chapter/[chapterNumber]/(chapter)/chapter-page.tsx (1)
  • components/Shared/Settings.tsx (1)
  • components/Verse/Commentary.tsx (2)
  • components/Verse/Translation.tsx (2)
  • components/Verse/Verse.tsx (4)
  • hooks/useMyStyles.ts (2)
  • redux/reducers/settings.ts (1)
Files skipped from review due to trivial changes (2)
  • components/Shared/Settings.tsx
  • components/Verse/Verse.tsx
Review comments generated (8)
  • Review: 7
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +45 to +50
<div
className={classNames(
"font-inter dark:bg-dark-bg",
`bg-${styles.backgroundColor}`
)}
>
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

The dynamic class name bg-${styles.backgroundColor} might not work as expected if the value of styles.backgroundColor is not a valid Tailwind CSS color. If styles.backgroundColor can be an arbitrary color, consider using inline styles instead.

-        `bg-${styles.backgroundColor}`
+        style={{ backgroundColor: styles.backgroundColor }}

@@ -24,7 +24,7 @@ function useMyStyles() {
fontSize: {
heading: "text-4xl",
subHeading1: "text-intro",
subHeading2: "text-paragraph",
subHeading2: "text-xl",
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

The change from "text-paragraph" to "text-xl" for subHeading2 might cause inconsistency in the appearance of subheadings across the application. Ensure that this change aligns with the overall design system and doesn't create visual discrepancies.

- subHeading2: "text-xl",
+ subHeading2: "text-paragraph",

Comment on lines +40 to +41
subHeading2: "text-paragraph",
para: "text-base",
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

The changes in font sizes for subHeading2 and para could potentially impact readability. Make sure these changes are tested thoroughly for different screen sizes and devices to ensure a consistent user experience.

- subHeading2: "text-paragraph",
- para: "text-base",
+ subHeading2: "text-xl",
+ para: "text-md",

Comment on lines +17 to +18
styles.fontSize.heading,
styles.lineHeight
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

The addition of styles.lineHeight to the className is a good move for better control over the appearance. However, it's important to ensure that styles.lineHeight is always defined and has a valid CSS class value to prevent potential styling issues.

       <h1
         className={classNames(
           "font-extrabold dark:text-gray-50",
+          styles.fontSize.heading,
+          styles.lineHeight
         )}
       >
         Translation

Comment on lines +27 to +28
styles.fontSize.para,
styles.lineHeight
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

Similar to the previous comment, the addition of styles.lineHeight is a good move for better control over the appearance. Again, make sure that styles.lineHeight is always defined and has a valid CSS class value to prevent potential styling issues.

         <p
           className={classNames(
             "mt-6 mx-auto text-justify dark:text-gray-50 ",
+            styles.fontSize.para,
+            styles.lineHeight
           )}
         >
           {translationData[0].description}

Comment on lines +20 to +21
styles.fontSize.heading,
styles.lineHeight
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

The addition of styles.lineHeight to the className of the h1 tag is a good change as it allows for dynamic control over the line height. However, please ensure that styles.lineHeight always has a valid value and does not break the layout if undefined or null.

       <h1
         className={classNames(
           "font-extrabold dark:text-gray-50",
+          styles.fontSize.heading,
+          styles.lineHeight
         )}
       >
         Commentary

Comment on lines +32 to +33
styles.fontSize.para,
styles.lineHeight
Copy link
Contributor

Choose a reason for hiding this comment

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

Image description CodeRabbit

Similar to the previous comment, the addition of styles.lineHeight to the className of the paragraph tag is a good change as it allows for dynamic control over the line height. Again, please ensure that styles.lineHeight always has a valid value and does not break the layout if undefined or null.

             key={paragraph}
             className={classNames(
               "mt-6 mx-auto text-justify dark:text-gray-50 whitespace-pre-wrap",
+              styles.fontSize.para,
+              styles.lineHeight
             )}
           >
             {paragraph}

@samanyougarg
Copy link
Member

  • At the moment, only when we click "Apply settings" then the changes are saved and visible. Can we instead show the changes in real time and only when the user clicks Apply, then the changes should be persisted else if user clicks Cancel, we don't save the changes.

@samanyougarg
Copy link
Member

  • For font size, can we add few more options from very small to very large?

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.

2 participants