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

452 UI improvements #453

Merged
merged 7 commits into from
Jan 3, 2025
Merged

452 UI improvements #453

merged 7 commits into from
Jan 3, 2025

Conversation

MandeepPaul
Copy link

@MandeepPaul MandeepPaul commented Jan 2, 2025

Describe your changes

UI improvements

Issue number

#452

Please ensure all items are checked off before requesting a review:

  • I deployed the code locally.
  • I have performed a self-review of my code.
  • I have included the issue # in the PR.
  • I have labelled the PR correctly.
  • The issue I am working on is assigned to me.
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme.
  • My PR is granular and targeted to one specific feature.
  • I took a screenshot or a video and attached to this PR if there is a UI change.

MUI design popup fix

Screenshot 2025-01-02 084206

GuildeMainPageTemplate layout fix - Hint, Tour, Banner, Popup, Link

Screenshot 2025-01-02 084145
Screenshot 2025-01-02 084154

Settings page layout fix

Screenshot 2025-01-02 084049

@MandeepPaul MandeepPaul requested review from gorkem-bwl and removed request for gorkem-bwl January 2, 2025 14:49
Copy link
Contributor

coderabbitai bot commented Jan 2, 2025

Walkthrough

The pull request introduces modifications to several frontend components and stylesheets, focusing on enhancing component flexibility and styling. Key changes include adding a className prop to the CustomTextField component, updating the ProfileTab styling by replacing inline styles with CSS classes, refactoring the ConfirmationPopup component to integrate a custom button and apply new dialog styles, and making minor adjustments to the GuideMainPageTemplate CSS to ensure full-width layout for the product page container.

Changes

File Change Summary
frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx Added className prop for enhanced styling flexibility and updated propTypes
frontend/src/scenes/settings/ProfileTab/ProfileTab.jsx Replaced inline styles with CSS module classes for three CustomTextField instances
frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css Updated form layout, added new classes, adjusted spacing and text styling
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopup.jsx Integrated custom Button component, applied dialog styling with sx props
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js Added dialogStyles constant for dialog component styling
frontend/src/templates/GuideMainPageTemplate/GuideMainPageTemplate.css Added full width to .product-page-container

Possibly related PRs

  • Changed Bluewave Onboarding to GuideFox #442: The changes in ProfileTab.jsx involve modifying the CustomTextField component to use a className prop, which aligns with the updates made in the CustomTextField component in the main PR.

Suggested reviewers

  • gorkem-bwl
  • swoopertr

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (6)
frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx (2)

41-41: Consider using clsx for className handling

For better className management and to avoid potential undefined issues, consider using clsx or classnames library.

Example implementation:

+ import clsx from 'clsx';

// In the render
- <div className={className} style={{ ...style, ...(computedFullWidth && { width: '100%' })}}>
+ <div className={clsx(className, 'custom-text-field')} style={{ ...style, ...(computedFullWidth && { width: '100%' })}}>
🧰 Tools
🪛 Biome (1.9.4)

[error] 41-41: Expected an expression but instead found '...'.

Expected an expression here.

(parse)


Line range hint 1-134: Let's level up this component with MUI theme integration!

Since this PR focuses on UI improvements, consider these architectural enhancements:

  1. Use MUI's styled API for consistent theming
  2. Document className usage in JSDoc

Example implementation:

/**
 * CustomTextField component
 * @param {Object} props
 * @param {string} [props.className] - Additional CSS class for custom styling
 * ...other props documentation
 */

Also, consider creating a styled component:

import { styled } from '@mui/material/styles';

const StyledTextField = styled(TextField)(({ theme }) => ({
  marginTop: theme.spacing(1),
  // ... other theme-based styles
}));
frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (4)

3-3: Yo dawg, that magic number's making me nervous!

That 864px width is looking like a magic number, and we don't want none of that spaghetti code. Consider using a design system variable or at least documenting why this specific width was chosen.

-    width: 864px;
+    width: var(--profile-form-width, 864px);

25-32: Caught a duplicate margin like catching mom's spaghetti!

Props for using those sweet design system variables! But yo, you've got margin defined twice (lines 26 and 32). Let's clean that up.

.supportText {
-    margin: 0;
    min-width: 400px;
    color: var(--second-text-color);
    font-size: var(--font-regular);
    font-weight: 400;
    line-height: 20px;
-    margin-top: 6px;
+    margin: 6px 0 0 0;
}

52-52: Let's keep these widths in sync like a rap beat!

I see that 400px min-width matches the .supportText class. Let's make it a variable to keep things consistent.

+ :root {
+   --profile-label-width: 400px;
+ }

.label {
-    min-width: 400px;
+    min-width: var(--profile-label-width);
}

.supportText {
-    min-width: 400px;
+    min-width: var(--profile-label-width);
}

60-64: Clean styling like fresh Tupperware for leftover spaghetti!

The textField class looks good, but there's some extra whitespace at line 64 that we can clean up.

.textField {
    flex-grow: 1; 
    text-align: right;
}
-  
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 407e5db and 246bcb2.

📒 Files selected for processing (6)
  • frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx (2 hunks)
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.jsx (3 hunks)
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (3 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopup.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageTemplate.css (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageTemplate.css
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.jsx
🧰 Additional context used
🪛 Biome (1.9.4)
frontend/src/components/TextFieldComponents/CustomTextField/CustomTextField.jsx

[error] 41-41: Expected an expression but instead found '...'.

Expected an expression here.

(parse)

🔇 Additional comments (5)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopup.jsx (5)

3-3: Smooth move bringing in the custom Button, eh?

Looks like you've replaced the Material-UI Button with your own from "../../../../components/Button/Button". This is in line with unifying your design system. Keep up the good work and ensure your custom Button behaves as expected in varied contexts and theming scenarios.


4-4: Nice to see the external styling approach.

Pulling in dialogStyles from a separate module is cleaner and helps you maintain consistent styling across components. Just make sure these styles remain flexible enough if future layout changes become necessary.


15-16: Dialling up the style with PaperProps, eh?

Using PaperProps to add custom padding is a welcomed approach. It aligns with MUI's recommended best practices for styling and maintains a tidy component structure. No spaghetti code detected here—nice and coherent.


21-22: Solid styling with sx props.

Applying sx to both DialogTitle and DialogContent keeps the design consistent. It's definitely less messy than inline styling—your code is as fresh as day-old poutine!


27-39: Robust button configuration—content and variant synergy.

Using your custom Button with different text, buttonType, and variant values is a slick way to maintain consistent styling and logic. “Cancel” as variant="text" and “Confirm” as variant="contained" is a clean approach, giving each button a distinct look while preserving design harmony. Great job trusting your custom Button to handle these props.

@MandeepPaul MandeepPaul requested a review from gorkem-bwl January 2, 2025 16:10
@gorkem-bwl
Copy link
Contributor

Looks good @MandeepPaul - thanks.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (1)

37-37: ⚠️ Potential issue

Still got those fixed widths dropping like mom's spaghetti!

Previous reviewers already flagged these fixed width issues. Let's not forget their advice about using flexbox properties instead.

.photoOptions {
-    min-width: 350px;
+    flex: 1;
+    min-width: 0;
}

.label {
-    min-width: 400px;
+    flex: 0 0 auto;
+    margin-right: 1rem;
}

Also applies to: 54-54

🧹 Nitpick comments (3)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js (1)

1-18: Yo, the structure's clean but let's make it theme-friendly!

The organization is solid, breaking down styles by component. However, we should consider using MUI's theme variables for better maintainability.

Here's how we can level up this code:

+import { useTheme } from '@mui/material/styles';
+
-export const dialogStyles = {
+export const useDialogStyles = () => {
+  const theme = useTheme();
+  return {
   paper: {
-    padding: "16px",
+    padding: theme.spacing(2),
   },
   title: {
     padding: 0,
   },
   content: {
     paddingLeft: 0,
   },
   contentText: {
-    fontSize: "13px",
+    fontSize: theme.typography.pxToRem(13),
   },
   actions: {
     paddingBottom: 0,
     paddingRight: 0,
   },
+ };
};
frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (2)

17-17: These layout changes are straight fire, but let's make 'em responsive!

The column layout and spacing look clean, but we should make it adapt to different screen sizes.

.photoAlign {
    display: flex;
    justify-content: space-between;
    align-items: center;
+    gap: 2rem;
+    @media (max-width: 768px) {
+        flex-direction: column;
+        align-items: flex-start;
+    }
}

Also applies to: 23-23, 25-25


62-64: Text field styling's looking fresh!

The flexbox usage is on point, but let's make it more mobile-friendly.

.textField {
    flex-grow: 1;
    text-align: right;
+    @media (max-width: 768px) {
+        text-align: left;
+        width: 100%;
+    }
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d55839 and 636b79c.

📒 Files selected for processing (4)
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.jsx (3 hunks)
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (3 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopup.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/scenes/settings/ProfileTab/ProfileTab.jsx
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopup.jsx
🔇 Additional comments (3)
frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/ConfirmationPopup/ConfirmationPopupStyles.js (2)

8-10: Heads up! The padding's looking kinda sus!

The asymmetric padding (left: 0, others: inherited) might cause alignment issues. Consider whether this is intentional or if we should normalize the padding.

Would you like me to verify the visual impact of this asymmetric padding in the UI?


11-13: Font size check - we're on point! 🎯

The 13px font size aligns with the previous discussion between @erenfn and @gorkem-bwl.

frontend/src/scenes/settings/ProfileTab/ProfileTab.module.css (1)

27-33: Clean styling with those design tokens, fam!

Nice work using CSS variables for colors and font sizes - that's the way to keep it consistent!

@MandeepPaul
Copy link
Author

Preview

image
image

@MandeepPaul MandeepPaul requested a review from erenfn January 3, 2025 17:31
@erenfn erenfn merged commit ddc73a1 into develop Jan 3, 2025
2 checks passed
@MandeepPaul MandeepPaul deleted the 452-ui-improvements branch January 4, 2025 06:59
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