Skip to content

Commit d0a4684

Browse files
committed
style: updated urgency status to reflect urgency with color codes
1 parent e1ce2a0 commit d0a4684

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

src/components/FilterListInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function FilterListInput({
2626

2727
return (
2828
<Form className="w-100 w-lg-auto" onSubmit={handleSubmit}>
29-
<InputGroup className="d-flex align-items-center">
29+
<InputGroup className="d-flex align-items-center mt-1">
3030
<Form.Label htmlFor="filterList" className="me-2 mb-0">
3131
{" "}
3232
Filter List:

src/components/ListItem.scss

+25
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@
2121
border-radius: 4px;
2222
}
2323

24+
.UrgencyStatus {
25+
// Default styles for urgency status
26+
font-weight: bold;
27+
28+
&.inactive {
29+
color: gray;
30+
}
31+
32+
&.overdue {
33+
color: red;
34+
}
35+
36+
&.soon {
37+
color: orange;
38+
}
39+
40+
&.kind-of-soon {
41+
color: yellow;
42+
}
43+
44+
&.not-soon {
45+
color: green;
46+
}
47+
}
48+
2449
.DeleteButton {
2550
width: fit-content;
2651
}

src/components/ListItem.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export function ListItemCheckBox({ item, listPath }: Props) {
6464
return "kind of soon";
6565
};
6666

67+
const urgencyStatus = getUrgencyStatus(item);
68+
6769
const handleCheckChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
6870
const newCheckedState = e.target.checked;
6971

@@ -120,9 +122,11 @@ export function ListItemCheckBox({ item, listPath }: Props) {
120122
};
121123

122124
return (
123-
<div className="d-flex flex-column justify-content-center mt-4">
124-
<span className="UrgencyStatus text-nowrap ms-5 px-5">
125-
{getUrgencyStatus(item)}
125+
<div className="d-flex flex-column justify-content-center mt-5">
126+
<span
127+
className={`UrgencyStatus text-nowrap ms-5 px-5 ${urgencyStatus.replace(/\s/g, "-")}`}
128+
>
129+
{urgencyStatus}
126130
</span>
127131
<section className="ListItemBox custom-borders d-flex p-2 m-1">
128132
<section className="d-flex flex-grow-1 PurchaseItem">

src/components/forms/AddItemForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function AddItemForm({ listPath, data: unfilteredListItems }: Props) {
9494
};
9595

9696
return (
97-
<section className="custom-borders d-flex flex-column align-items-center">
97+
<section className="custom-borders d-flex flex-column align-items-center ">
9898
<Form onSubmit={(e) => handleSubmit(e, listPath)}>
9999
<h3 className="text-center">Add Item</h3>
100100

src/views/authenticated/List.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323
.Share-ListForm {
24-
flex-basis: 80%;
24+
flex-basis: 50%;
2525
}
2626

2727
.Add-ItemForm {

src/views/authenticated/List.tsx

+8-13
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ export function List({ data: unfilteredListItems, listPath }: Props) {
3030

3131
const Header = () => {
3232
return (
33-
<p className="Header text-center">
34-
Your list items are organized based on when you need to buy them. Items
35-
that need to be purchased soonest are at the top. If two or more items
36-
are due at the same time, they will be sorted alphabetically. If an
33+
<p className="Header text-center h4">
34+
Your list items are organized based on when you need to buy them. If an
3735
items purchase date has passed, it will be marked as overdue and placed
38-
at the top of the list. Additionally, items that have not been used
39-
recently will be labeled as inactive and moved to the bottom of your
40-
list.
36+
at the top of the list.
4137
</p>
4238
);
4339
};
@@ -52,8 +48,7 @@ export function List({ data: unfilteredListItems, listPath }: Props) {
5248
<Container>
5349
<h2 className="ListName">{listName}</h2>
5450
<section className="d-flex flex-column justify-content-center text-center align-items-center">
55-
<Header />
56-
<h3>
51+
<h3 className="mt-5">
5752
You haven’t added any items yet.
5853
<br />
5954
Let’s get started by adding your first item!
@@ -90,11 +85,11 @@ export function List({ data: unfilteredListItems, listPath }: Props) {
9085
// Main content when list is not empty
9186
return (
9287
<Container className="ListPageContainer">
93-
<header>
94-
<h2 className="ListName p-1 m-2 mt-2">{listName}</h2>
95-
<Header />
96-
</header>
9788
<div className="ListItemSection">
89+
<header>
90+
<h2 className="ListName p-1 m-2 mt-2">{listName}</h2>
91+
</header>
92+
9893
<section className="d-flex sticky-top flex-nowrap align-items-center justify-content-center">
9994
{unfilteredListItems.length > 0 && (
10095
<FilterListInput

0 commit comments

Comments
 (0)