Skip to content

Commit dc41476

Browse files
Enhance customer card and delete button styles for improved UX and responsiveness
1 parent a1532b1 commit dc41476

File tree

2 files changed

+57
-15
lines changed

2 files changed

+57
-15
lines changed

client/src/components/CustomerList.css

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,27 @@
5858
display: flex;
5959
justify-content: space-between;
6060
align-items: center;
61-
transition: box-shadow 0.2s;
61+
transition: all 0.2s ease;
62+
gap: 1rem;
6263
}
6364

6465
.customer-card:hover {
65-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
66+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
67+
border-color: #bbb;
68+
}
69+
70+
/* Mobile responsiveness for better delete button visibility */
71+
@media (max-width: 768px) {
72+
.customer-card {
73+
padding: 1.2rem;
74+
gap: 0.8rem;
75+
}
76+
77+
.delete-btn {
78+
min-width: 3.5rem;
79+
height: 3.5rem;
80+
font-size: 1.2rem;
81+
}
6682
}
6783

6884
.customer-info h3 {
@@ -78,23 +94,48 @@
7894
}
7995

8096
.delete-btn {
81-
background: #ff4444;
97+
background: #dc3545;
8298
color: white;
83-
border: none;
84-
padding: 0.5rem;
85-
border-radius: 4px;
99+
border: 2px solid #dc3545;
100+
padding: 0.6rem;
101+
border-radius: 6px;
86102
cursor: pointer;
87-
font-size: 1rem;
88-
transition: background-color 0.2s;
89-
min-width: 2.5rem;
90-
height: 2.5rem;
103+
font-size: 1.1rem;
104+
transition: all 0.2s ease;
105+
min-width: 3rem;
106+
height: 3rem;
107+
display: flex;
108+
align-items: center;
109+
justify-content: center;
110+
box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
91111
}
92112

93113
.delete-btn:hover:not(:disabled) {
94-
background: #cc0000;
114+
background: #c82333;
115+
border-color: #c82333;
116+
transform: translateY(-1px);
117+
box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
118+
}
119+
120+
.delete-btn:active:not(:disabled) {
121+
transform: translateY(0);
122+
box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
95123
}
96124

97125
.delete-btn:disabled {
98-
background: #ccc;
126+
background: #6c757d;
127+
border-color: #6c757d;
99128
cursor: not-allowed;
100-
}
129+
transform: none;
130+
box-shadow: none;
131+
opacity: 0.6;
132+
}
133+
134+
.delete-icon {
135+
color: #ffffff;
136+
font-size: 0.8rem;
137+
font-weight: bold;
138+
line-height: 1;
139+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
140+
letter-spacing: 0.5px;
141+
}

client/src/components/CustomerList.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ const CustomerList = ({ customers, onCustomerDeleted, onRefresh }: CustomerListP
5252
onClick={() => handleDelete(customer.id)}
5353
className="delete-btn"
5454
disabled={loading}
55-
title="Delete customer"
55+
title={`Delete ${customer.firstName} ${customer.lastName}`}
56+
aria-label={`Delete customer ${customer.firstName} ${customer.lastName}`}
5657
>
57-
🗑️
58+
<span className="delete-icon">DEL</span>
5859
</button>
5960
</div>
6061
))}

0 commit comments

Comments
 (0)