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

Improved Button Responsiveness and Layout Adjustments #9161

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

gurramkarthiknetha
Copy link

@gurramkarthiknetha gurramkarthiknetha commented Nov 19, 2024

Proposed Changes

  • Fixes fix the responsive ness #9156
    image
    here i changed the hap between the red button and green oulined button
  • Change 2
    -image
    here i changed the responsive-ness wrap
  • Change 3
  • image
  • here i improved the responsive ness of the buttons by align to center
  • Change 4
  • image
  • here i changed it level
  • Change 5
  • image
  • here i changed it level
    @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

fixed responsiveness of the website with small changes
@gurramkarthiknetha gurramkarthiknetha requested a review from a team as a code owner November 19, 2024 14:43
Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

Walkthrough

The changes in this pull request focus on modifying the layout and styling of various UI components across multiple files. Key updates include enhancements to margin and spacing for buttons and containers, adjustments to the rendering logic of tooltips, and refinements in the handling of state variables related to user interactions. Additionally, the control flow for managing patient consent records has been improved to ensure better user experience and data integrity.

Changes

File Path Change Summary
src/CAREUI/interactive/FiltersSlideover.tsx Updated className of AdvancedFilterButton to include mt-2 for margin-top styling.
src/components/Common/ButtonV2.tsx Added mt-2 class to button styles; refined tooltip rendering logic.
src/components/Common/Menu.tsx Added mt-2 class to MenuButton for improved spacing.
src/components/Facility/FacilityCard.tsx Changed class name for facility details layout to include gap-2; updated notification button layout.
src/components/Kanban/Board.tsx Enhanced responsiveness with new CSS classes for KanbanBoard and KanbanSection; clarified data handling.
src/components/Patient/ManagePatients.tsx Updated button layout for filtering/exporting; improved onTabChange logic based on user roles.
src/components/Patient/PatientConsentRecords.tsx Introduced showPCSChangeModal state; modified upload logic to check for existing consent records.

Possibly related PRs

Suggested labels

needs review, needs testing

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

🐇 In the code, I hop and play,
With buttons styled in a new way.
Margins added, gaps so neat,
A joyful UI, oh what a treat!
With consent records, we now glide,
In a world where changes abide! 🌼

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint (1.23.1)

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/Common/ButtonV2.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.json': Cannot find module '@typescript-eslint/parser'
Require stack:

  • /.eslintrc.json
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 88e5236 and 1ab58f5.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/components/Common/ButtonV2.tsx (1 hunks)
  • src/components/Kanban/Board.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/Common/ButtonV2.tsx
  • src/components/Kanban/Board.tsx

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

netlify bot commented Nov 19, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 1ab58f5
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6740d01a07faae0008df707b
😎 Deploy Preview https://deploy-preview-9161--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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: 2

🧹 Outside diff range and nitpick comments (9)
src/components/Kanban/Board.tsx (3)

61-61: Improve class naming convention

While the addition of flex-wrap styling for responsive design is good, the class name containerss appears to have a typo and doesn't follow clear naming conventions.

Consider renaming to something more semantic like:

-<div className="flex items-stretch px-0 pb-2 containerss">
+<div className="flex items-stretch px-0 pb-2 kanban-sections-container">

149-149: Improve CSS class organization and naming

The className string is becoming long and mixes utility classes with custom classes. The bshadow class name is not descriptive enough.

Consider:

  1. Using a more descriptive name like kanban-section-shadow
  2. Organizing classes using a CSS-in-JS solution or CSS modules
  3. Creating a dedicated class that encapsulates all these styles
-"relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200 bshadow"
+"kanban-section relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200"

Then define the styles in your CSS:

.kanban-section {
  box-shadow: /* your shadow values */;
}

Line range hint 108-117: Consider performance and type safety improvements

The scroll event handler could benefit from debouncing, and the response type could be more strictly typed.

Consider these improvements:

  1. Debounce the scroll event handler:
import { debounce } from 'lodash';

const debouncedOnBoardReachEnd = debounce(async () => {
  // existing logic
}, 150);

useEffect(() => {
  props.boardRef.current?.addEventListener("scroll", debouncedOnBoardReachEnd);
  return () => {
    props.boardRef.current?.removeEventListener("scroll", debouncedOnBoardReachEnd);
    debouncedOnBoardReachEnd.cancel();
  };
}, [props.boardRef, fetchingNextPage, hasMore]);
  1. Add proper typing for the API response:
interface PaginatedResponse<T> {
  results: T[];
  next: string | null;
  count: number;
}
src/components/Common/ButtonV2.tsx (1)

104-104: Reconsider adding global margin to base button styles

Adding mt-2 to the base button styles will affect all instances of ButtonV2 across the application. This could potentially break existing layouts and violates the principle of separation of concerns, as spacing should typically be controlled by the parent component.

Consider these alternatives:

  1. Add the margin where specifically needed using the className prop
  2. Create a new variant or prop for buttons that need this spacing
  3. Handle the spacing in the parent component's layout

Example of better approaches:

// Option 1: Add margin only where needed
<ButtonV2 className="mt-2" />

// Option 2: Add a prop for spacing
type ButtonProps = {
  // ... existing props
  spacing?: 'none' | 'compact' | 'normal' | 'loose';
}

// Option 3: Handle in parent (preferred)
<div className="space-y-2">
  <ButtonV2 />
  <ButtonV2 />
</div>
src/components/Patient/PatientConsentRecords.tsx (1)

235-235: LGTM! Consider using CSS modules for better maintainability.

The addition of mt-2 class improves vertical spacing consistency. However, consider using CSS modules or styled-components to better manage these utility classes and improve maintainability.

-    "button-size-default button-shape-square button-primary-default inline-flex mt-2 h-min w-full cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out"
+    styles.uploadButton // Define in a separate CSS module
src/components/Facility/FacilityCard.tsx (1)

Line range hint 1-276: Consider these architectural improvements for better maintainability.

While the current changes improve the layout, here are some suggestions to enhance the component's maintainability:

  1. Consider extracting the notification modal into a separate component to reduce complexity
  2. The responsive layout logic could be simplified by using Tailwind's @screen directives in a separate CSS file
  3. Common class combinations could be extracted into reusable Tailwind components

Example of extracting the notification modal:

// NotificationModal.tsx
interface NotificationModalProps {
  facilityId: string;
  facilityName: string;
  isOpen: boolean;
  onClose: () => void;
  onSubmit: (message: string) => void;
}

const NotificationModal: React.FC<NotificationModalProps> = ({
  facilityId,
  facilityName,
  isOpen,
  onClose,
  onSubmit
}) => {
  const [message, setMessage] = useState("");
  const [error, setError] = useState("");
  
  // ... rest of the modal logic
};
src/style/index.css (2)

1319-1323: Consider using a more conventional class name

The class name containerss with double 's' appears to be a typo or non-conventional naming. Consider renaming it to something more semantic like responsive-container or simply container.

-    .containerss{
+    .responsive-container {
         flex-wrap: wrap;
         gap: 5px;
         margin-bottom: 5px;
     }

1324-1327: Remove commented code and use a more descriptive class name

  1. The commented-out box-shadow property should either be implemented or removed.
  2. Consider using a more descriptive class name than bshadow to better convey its purpose.
-    .bshadow{
-        border:solid rgb(168, 168, 168);
-        /* box-shadow: 3px solid rgb(0, 0, 0) !important; */
-    }
+    .bordered-container {
+        border: solid rgb(168, 168, 168);
+    }
src/components/Patient/ManagePatients.tsx (1)

844-844: LGTM! Consider extracting the className into a constant.

The addition of flex-wrap improves the layout handling of filter controls, especially on smaller screens. However, for better maintainability, consider extracting the long className string into a constant or using a CSS module.

+ const filterControlsClassName = "flex w-full flex-col items-center justify-end flex-wrap gap-2 lg:ml-3 lg:w-fit lg:flex-row lg:gap-3";
- <div className="flex w-full flex-col items-center justify-end flex-wrap gap-2 lg:ml-3 lg:w-fit lg:flex-row lg:gap-3">
+ <div className={filterControlsClassName}>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ea713df and 645a562.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • src/CAREUI/interactive/FiltersSlideover.tsx (1 hunks)
  • src/components/Common/ButtonV2.tsx (1 hunks)
  • src/components/Common/Menu.tsx (1 hunks)
  • src/components/Facility/FacilityCard.tsx (2 hunks)
  • src/components/Kanban/Board.tsx (2 hunks)
  • src/components/Patient/ManagePatients.tsx (1 hunks)
  • src/components/Patient/PatientConsentRecords.tsx (1 hunks)
  • src/style/index.css (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/CAREUI/interactive/FiltersSlideover.tsx
  • src/components/Common/Menu.tsx
🧰 Additional context used
🪛 Biome
src/style/index.css

[error] 1328-1328: expected } but instead the file ends

the file ends here

(parse)

🔇 Additional comments (2)
src/components/Facility/FacilityCard.tsx (2)

91-91: LGTM! Improved spacing between flex items.

The addition of gap-2 creates consistent spacing between items in the facility name section, improving the visual layout.


223-223: LGTM! Enhanced button alignment.

The addition of justify-center improves the visual alignment of the action buttons, particularly on smaller screens where the container might wrap.

@@ -101,7 +101,7 @@ export const buttonStyles = ({
shadow = !ghost,
}: ButtonStyleProps) => {
return classNames(
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre mt-2 font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 19, 2024

Choose a reason for hiding this comment

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

💡 Codebase verification

Adding default margin-top could cause layout inconsistencies

The mt-2 class has been added to the base button styles which could cause unexpected spacing in existing implementations. Based on the evidence:

  1. The ButtonV2 component is widely used across 100+ files in the codebase
  2. Current implementations use explicit className props for spacing when needed (e.g., m-2, py-[11px])
  3. The default margin-top in the base styles could interfere with existing layouts where buttons are precisely positioned

Recommendation:

  • Remove the mt-2 from the base button styles
  • Let consuming components control their own spacing through className props as they currently do
🔗 Analysis chain

Verify the impact on existing button instances

Let's assess how this change affects existing button implementations across the codebase.


The previous search showed widespread usage of ButtonV2 across the codebase. Now we need to examine actual usage patterns and the component definition to understand if the new margin will conflict with existing implementations.


The previous results show some ButtonV2 usages with custom classes, but we need to see the full component implementation and check specifically for margin-top conflicts to make a proper assessment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ButtonV2 usage patterns that might conflict with the new margin
echo "Checking for ButtonV2 instances with existing margin classes..."
rg -l "ButtonV2.*className.*mt-" 

echo "Checking for all ButtonV2 usages to understand the scope of impact..."
rg -l "ButtonV2"

echo "Checking for potential negative margin overrides that might be compensating for spacing..."
rg -l "ButtonV2.*className.*-mt-"

Length of output: 6867


Script:

#!/bin/bash
# Let's check for actual ButtonV2 usage patterns with className to understand margin conflicts
echo "Checking ButtonV2 usages with className prop..."
rg "ButtonV2.*className.*" -A 1

# Let's also check the ButtonV2 component definition to understand its composition
echo "Checking ButtonV2 component definition..."
rg "const ButtonV2" -A 10 src/components/Common/ButtonV2.tsx

Length of output: 1040


Script:

#!/bin/bash
# Let's check the full ButtonV2 component implementation to understand the className composition
echo "Checking full ButtonV2 implementation..."
cat src/components/Common/ButtonV2.tsx

# Let's also check for any existing margin-top classes in ButtonV2 usages
echo "Checking for existing margin-top classes in ButtonV2 usages..."
rg "ButtonV2.*className.*mt-[0-9]" -B 1 -A 1

Length of output: 7373

Copy link
Contributor

Choose a reason for hiding this comment

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

ButtonV2 is widely used - make sure this doesn't cause any issues elsewhere. Instead of modifying it here, modify wherever the specific issue is occurring.

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood, @Jacobjeevan. To prevent potential issues elsewhere, I've removed the mt-2 class from the ButtonV2 component. Instead, we can add the mt-2 class to the specific instances where the margin is needed.

For example, in src/CAREUI/interactive/FiltersSlideover.tsx, update the AdvancedFilterButton:

<ButtonV2 className="w-full bg-white md:w-auto mt-2" onClick={toggleSlideover}>
  <CareIcon className="care-l-filter text-lg" />
  <span>Advanced Filters</span>
</ButtonV2>

This ensures that the margin is applied only where necessary without impacting other components.


✏️ Learnings added
Learnt from: Jacobjeevan
PR: ohcnetwork/care_fe#9161
File: src/components/Common/ButtonV2.tsx:104-104
Timestamp: 2024-11-20T05:14:50.931Z
Learning: When adjusting styling for widely used components like `ButtonV2`, avoid modifying the base styles to prevent unintended effects across the application. Instead, apply style changes directly in the specific instances where needed.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment on lines 1318 to 1328
@media screen and (max-width:915px){
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
.bshadow{
border:solid rgb(168, 168, 168);
/* box-shadow: 3px solid rgb(0, 0, 0) !important; */
}
}
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 19, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix syntax error: Add missing closing curly brace

The media query block is missing a closing curly brace at the end of the file.

 @media screen and (max-width:915px){
     .containerss{
         flex-wrap: wrap;
         gap: 5px;
         margin-bottom: 5px;
     }
     .bshadow{
         border:solid rgb(168, 168, 168);
         /* box-shadow: 3px solid rgb(0, 0, 0) !important; */
     }
+}

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome

[error] 1328-1328: expected } but instead the file ends

the file ends here

(parse)

Copy link
Contributor

Choose a reason for hiding this comment

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

☝️ Address both the comments @gurramkarthiknetha

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@@ -101,7 +101,7 @@ export const buttonStyles = ({
shadow = !ghost,
}: ButtonStyleProps) => {
return classNames(
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre mt-2 font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
Copy link
Contributor

Choose a reason for hiding this comment

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

ButtonV2 is widely used - make sure this doesn't cause any issues elsewhere. Instead of modifying it here, modify wherever the specific issue is occurring.

Comment on lines 1318 to 1328
@media screen and (max-width:915px){
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
.bshadow{
border:solid rgb(168, 168, 168);
/* box-shadow: 3px solid rgb(0, 0, 0) !important; */
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

☝️ Address both the comments @gurramkarthiknetha

@Jacobjeevan
Copy link
Contributor

Jacobjeevan commented Nov 20, 2024

Also follow the PR format what we have (refer to other PRs). Edit the title to be readable as well.

fixed the responsiveness and some file changes
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: 0

🧹 Outside diff range and nitpick comments (2)
src/style/index.css (2)

1319-1323: Consider renaming the class for better maintainability

The class name containerss appears to have a typo (extra 's'). Consider renaming it to container or a more semantic name that describes its purpose.

-    .containerss{
+    .container{
         flex-wrap: wrap;
         gap: 5px;
         margin-bottom: 5px;
     }

1324-1326: Improve border specification

The border property is missing width specification. Consider using a more explicit border declaration for better consistency.

     .bshadow{
-        border:solid rgb(168, 168, 168);
+        border: 1px solid rgb(168, 168, 168);
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 645a562 and 4465945.

📒 Files selected for processing (2)
  • src/components/Common/ButtonV2.tsx (1 hunks)
  • src/style/index.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Common/ButtonV2.tsx
🧰 Additional context used
🪛 Biome
src/style/index.css

[error] 1330-1330: expected } but instead the file ends

the file ends here

(parse)

🔇 Additional comments (1)
src/style/index.css (1)

1318-1330: LGTM! The media query implementation looks good

The responsive adjustments for smaller screens are well-structured and the use of rem units in .mtrequired is good for accessibility.

🧰 Tools
🪛 Biome

[error] 1330-1330: expected } but instead the file ends

the file ends here

(parse)

@@ -101,7 +101,7 @@ export const buttonStyles = ({
shadow = !ghost,
}: ButtonStyleProps) => {
return classNames(
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 mtrequired",
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned in the previous comment, let's not change anything in ButtonV2, but adjust where the issue occurs.

@@ -36,7 +36,7 @@ export default function DropdownMenu({
<Menu as="div" className="relative inline-block w-full text-left">
<MenuButton
disabled={props.disabled}
className={`button-size-${size} button-${variant}-default button-shape-square flex w-full cursor-pointer items-center justify-center gap-2 font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 lg:justify-between ${props.className}`}
className={`button-size-${size} button-${variant}-default button-shape-square flex w-full cursor-pointer items-center justify-center gap-2 font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 mt-2 lg:justify-between ${props.className}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure it isn't causing any issues elsewhere as Menu is used throughout.

@@ -58,7 +58,7 @@ export default function KanbanBoard<T extends { id: string }>(
</div>
<DragDropContext onDragEnd={props.onDragEnd}>
<div className="h-full overflow-scroll" ref={board}>
<div className="flex items-stretch px-0 pb-2">
<div className="flex items-stretch px-0 pb-2 containerss">
Copy link
Contributor

Choose a reason for hiding this comment

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

Tailwind allows for custom breakpoints for one-off cases, let's use that instead of creating a new class.

https://tailwindcss.com/docs/responsive-design#using-custom-breakpoints Check the very last section.

@@ -146,7 +146,7 @@ export function KanbanSection<T extends { id: string }>(
<div
ref={provided.innerRef}
className={
"relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200"
"relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200 bshadow"
Copy link
Contributor

@Jacobjeevan Jacobjeevan Nov 20, 2024

Choose a reason for hiding this comment

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

🤔

(1) Check the other examples of border in FE; use tailwind border instead of creating a custom class.
(2) Also, make sure to use names that make sense - why refer to this as shadow when it's a border?

@Jacobjeevan
Copy link
Contributor

Also follow the PR format what we have (refer to other PRs). Edit the title to be readable as well.

Also this ☝️ @gurramkarthiknetha

@gurramkarthiknetha
Copy link
Author

Now i kept from the same branch .
Did i need to change any more

@@ -101,7 +101,7 @@ export const buttonStyles = ({
shadow = !ghost,
}: ButtonStyleProps) => {
return classNames(
"inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
"inline-flex h-min cursor-pointer mt-2 items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500 mtrequired",
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you have added mt-2 to the SlideOver page, let's get this (and the mtrequired) removed 👍 @gurramkarthiknetha

Other than that, it's fine.

"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
Copy link
Contributor

Choose a reason for hiding this comment

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

Leave out package-lock from the commit please.

@@ -146,7 +146,7 @@ export function KanbanSection<T extends { id: string }>(
<div
ref={provided.innerRef}
className={
"relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200"
"relative mr-2 w-[300px] shrink-0 rounded-xl bg-secondary-200 max-[915px]:border max-[915px]:border-solid max-[915px]:border-[rgb(168,168,168)]"
Copy link
Member

Choose a reason for hiding this comment

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

pick a color from the gray shade instead of using an arbitrary color. let's stick to the design system.

@@ -58,7 +58,7 @@ export default function KanbanBoard<T extends { id: string }>(
</div>
<DragDropContext onDragEnd={props.onDragEnd}>
<div className="h-full overflow-scroll" ref={board}>
<div className="flex items-stretch px-0 pb-2">
<div className="flex items-stretch px-0 pb-2 max-[915px]:flex-wrap max-[915px]:gap-5 max-[915px]:mb-5">
Copy link
Member

Choose a reason for hiding this comment

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

use standard width modifiers such as md: / lg: / xl: / 2xl:

@rithviknishad
Copy link
Member

@gurramkarthiknetha It's required to follow the original PR template and link the issue in it. Also keep a proper readable title that conveys what has changed in the PR.

final change
@gurramkarthiknetha gurramkarthiknetha changed the title issue #9156 fixed Improved Button Responsiveness and Layout Adjustments Nov 22, 2024
@gurramkarthiknetha
Copy link
Author

now is this ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix the responsive ness
3 participants