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

fixed responsiveness #9166

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/CAREUI/interactive/FiltersSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const AdvancedFilterButton = ({ onClick }: { onClick: () => void }) => {
<ButtonV2
ghost
border
className="w-full bg-white md:w-auto"
className="w-full bg-white md:w-auto mt-2"
onClick={onClick}
id="advanced-filter"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/ButtonV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

⚠️ Potential issue

Reconsider the global application of 'mtrequired' class

The addition of 'mtrequired' class raises several concerns:

  1. The class name appears to have a typo (should it be 'mt-required'?)
  2. Adding this class globally to all buttons might affect existing layouts
  3. If margin-top is needed, consider making it configurable via props instead

Consider this alternative approach:

- "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",
+ "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",

And add a new prop to ButtonStyleProps:

export type ButtonStyleProps = {
  // ... existing props
  marginTop?: boolean; // Add margin-top when needed
};

`button-size-${size}`,
`button-shape-${circle ? "circle" : "square"}`,
ghost ? `button-${variant}-ghost` : `button-${variant}-default`,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`}
>
<div
className={classNames(
Expand Down
4 changes: 2 additions & 2 deletions src/components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const FacilityCard = (props: {
</div>
)}
<div
className="flex flex-wrap items-center justify-between"
className="flex flex-wrap items-center gap-2 justify-between"
id="facility-name-card"
>
<div>
Expand Down Expand Up @@ -220,7 +220,7 @@ export const FacilityCard = (props: {
</form>
</DialogModal>
</div>
<div className="flex flex-wrap gap-2">
<div className="flex flex-wrap gap-2 justify-center">
{["DistrictAdmin", "StateAdmin"].includes(userType) && (
<ButtonV2
id="facility-notify"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Kanban/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
{props.sections.map((section, i) => (
<KanbanSection<T>
key={i}
Expand Down Expand Up @@ -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"
}
>
<div className="sticky top-0 rounded-xl bg-secondary-200 pt-2">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ export const PatientManager = () => {
</p>
</ButtonV2>
</div>
<div className="flex w-full flex-col items-center justify-end 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">
<Tabs
tabs={[
{ text: t("live"), value: 0 },
Expand Down
2 changes: 1 addition & 1 deletion src/components/Patient/PatientConsentRecords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default function PatientConsentRecords(props: {
<>
<label
className={
"button-size-default button-shape-square button-primary-default inline-flex 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"
"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"
}
>
<CareIcon icon={"l-file-upload-alt"} className="text-lg" />
Expand Down
13 changes: 13 additions & 0 deletions src/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1315,3 +1315,16 @@ input[type="number"] {
--radius: 0.5rem;
}
}
@media screen and (max-width:915px){
.containerss{
flex-wrap: wrap;
gap: 5px;
margin-bottom: 5px;
}
Comment on lines +1319 to +1323
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Rename class to follow naming conventions

The class name 'containerss' appears to have a typo (double 's'). Consider renaming it to 'container' or 'containers' for better maintainability.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

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

.bshadow{
border:solid rgb(168, 168, 168);
}
.mtrequired{
margin-top: 0.5rem;
}
}
Comment on lines +1318 to +1330
Copy link
Contributor

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: Missing closing curly brace

The file is missing a closing curly brace at the end, which could cause CSS parsing issues.

@media screen and (max-width:915px){
    .containerss{
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 5px;
    }
    .bshadow{
        border:solid rgb(168, 168, 168);
    }
    .mtrequired{
        margin-top: 0.5rem;
    }
}
+ }

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

🧰 Tools
🪛 Biome

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

the file ends here

(parse)