Skip to content

Commit

Permalink
making adjustments to use RB 1 Container on list, adjust classes on e…
Browse files Browse the repository at this point in the history
…dit buttons for styling, list item classes for responsiveness
  • Loading branch information
bbland1 committed Oct 18, 2024
1 parent 1a8a0e8 commit 7bd9fea
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
9 changes: 4 additions & 5 deletions src/components/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,13 @@ export function ListItemCheckBox({ item, listPath }: Props) {
};

return (

<div className="d-flex flex-column justify-content-center mt-5">
<span
className={`UrgencyStatus text-nowrap ms-5 px-5 ${urgencyStatus.replace(/\s/g, "-")}`}
>
{urgencyStatus}
</span>
<section className="ListItemBox custom-borders d-flex p-2 m-1">
<section className="ListItemBox custom-borders d-flex p-2 m-1 align-items-center">
<section className="d-flex flex-grow-1 PurchaseItem">
<Form.Check
className="me-3"
Expand All @@ -142,14 +141,14 @@ export function ListItemCheckBox({ item, listPath }: Props) {
aria-checked={isChecked}
disabled={isChecked}
/>
<h4 className="text-nowrap me-1 mb-0"> {item.name} </h4>
<Form.Label className="">{item.name}</Form.Label>
</section>

<section className="EditItem d-flex gap-sm-4 align-items-end">
<section className="EditItem d-flex gap-2 align-items-end">
<ItemQuantityForm saveItemQuantity={editItemQuantity} item={item} />

<Button
className="DeleteButton mt-auto w-auto ms-2 "
className="DeleteButton w-auto"
variant="danger"
onClick={() => deleteItemHandler()}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/NavBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
color: $secondary-blue;
}
}
}

.navbar .navbar-toggler {
background-color: $primary-beige;
}
.navbar .navbar-toggler {
background-color: $primary-beige;
}

.navbar button {
Expand Down
13 changes: 6 additions & 7 deletions src/components/forms/ItemQuantityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ export function ItemQuantityForm({
<div>
{edit ? (
<>
<Button className="custom-button" onClick={updateItemQuantity}>
<span className="d-none d-md-inline"> Save </span>
<Button variant="dark" onClick={updateItemQuantity}>
<span className="d-none d-md-inline text-primary">Save</span>
<IoMdCheckmark className="d-block d-md-none" />
</Button>{" "}
<Button className="custom-button" onClick={toggleEdit}>
<span className="d-none d-md-inline">Cancel</span>
<Button variant="dark" onClick={toggleEdit}>
<span className="d-none d-md-inline text-primary">Cancel</span>
<GiCancel className="d-block d-md-none" />
</Button>
</>
) : (
<Button className="custom-button" onClick={toggleEdit}>
<span className="d-none d-md-inline">Edit</span>
<Button variant="dark" onClick={toggleEdit}>
<span className="d-none d-md-inline text-primary">Edit</span>
<FaEdit className="d-block d-md-none" />
</Button>
)}
</div>
</div>

);
}
4 changes: 2 additions & 2 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ $theme-colors: (
"secondary": $primary-blue,
"info": $tertiary-blue,
"dark": $secondary-blue,
"danger": #dc3545,
);

$font-size-root: null;
Expand All @@ -26,14 +27,13 @@ body {
text-align: center;
border: none;
padding: 0.5rem;
width: 11rem;

&:hover {
background-color: $secondary-blue;
color: $primary-beige;
}
}

a svg {
svg {
fill: $primary-beige;
}
9 changes: 6 additions & 3 deletions src/views/authenticated/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState, useMemo, useRef } from "react";
import { ListItemCheckBox } from "../../components/ListItem";
import { FilterListInput } from "../../components/FilterListInput";
import { ListItem, comparePurchaseUrgency } from "../../api";
import { Container } from "react-bootstrap";
import Container from "react-bootstrap/Container";
import Button from "react-bootstrap/Button";
import ShareListForm from "../../components/forms/ShareListForm";
import { AddItemForm } from "../../components/forms/AddItemForm";
Expand Down Expand Up @@ -75,7 +75,7 @@ export function List({ data: unfilteredListItems, listPath }: Props) {

// Main content when list is not empty
return (
<Container className="ListPageContainer ">
<Container>
<div className="ListItemSection">
<header>
<h2 className="ListName p-1 m-2 mt-2">{listName}</h2>
Expand Down Expand Up @@ -104,7 +104,10 @@ export function List({ data: unfilteredListItems, listPath }: Props) {
</div>

<ShareListForm listPath={listPath} />
<Button className="d-md-none mt-3" onClick={scrollToViewList}>
<Button
className="d-md-none mt-3 custom-button align-self-center"
onClick={scrollToViewList}
>
{"View List"}
</Button>
</Container>
Expand Down

0 comments on commit 7bd9fea

Please sign in to comment.