Skip to content

Commit b369f51

Browse files
committed
added action button
1 parent caa1e1e commit b369f51

File tree

5 files changed

+60
-17
lines changed

5 files changed

+60
-17
lines changed

src/app/houses/Components/HouseDetails/HouseDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function HouseDetails({ selectedHouse }) {
5050
</div>
5151
<div className="house--status">
5252
<p>Status</p>
53-
<h4>Occupied</h4>
53+
<h4>{house.occupied ? '🔴 Occupied' : ' 🟢 Vacant'}</h4>
5454
</div>
5555
<div className="house--contract">
5656
<p>Contract</p>

src/app/houses/Components/HouseTable/HouseTable.css

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@
5959
.house--table table thead tr {
6060
height: 2.8rem;
6161
border-radius: 16px;
62-
6362
}
64-
.house--table table thead td{
63+
.house--table table thead td {
6564
background-color: #113d85;
6665
color: #a6a9ad;
6766
font-family: sans-serif;
@@ -90,6 +89,14 @@
9089
color: rgb(83, 83, 209);
9190
}
9291

92+
.delete-btn {
93+
background-color: #dc3545;
94+
color: white;
95+
border: none;
96+
padding: 0.3rem 1rem;
97+
border-radius: 6px;
98+
}
99+
93100
.add-house-bg {
94101
width: 100%;
95102
height: 100dvh;
@@ -111,7 +118,7 @@
111118
background-color: #fefefe;
112119
border-radius: 20px;
113120
padding: 1rem;
114-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen;
121+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen;
115122
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
116123
}
117124

@@ -131,7 +138,8 @@
131138
font-size: 20px;
132139
}
133140

134-
.add-house-form input, .add-house-form select {
141+
.add-house-form input,
142+
.add-house-form select {
135143
width: 100%;
136144
height: 2.4rem;
137145
margin-bottom: 15px;
@@ -144,7 +152,9 @@
144152
}
145153

146154
.add-house-form select {
147-
height: 3rem;
155+
font-size: 15px;
156+
padding: 0.2rem;
157+
color: black;
148158
}
149159

150160
.add-house-dropdown label {
@@ -153,7 +163,7 @@
153163
font-size: 1.1rem;
154164
}
155165

156-
.add-house-form button{
166+
.add-house-form button {
157167
width: 100%;
158168
padding: 14px;
159169
background: #007aff;
@@ -166,7 +176,6 @@
166176
}
167177

168178
@media screen and (max-width: 700px) {
169-
170179
.house--header {
171180
height: 100px;
172181
display: flex;
@@ -179,8 +188,7 @@
179188
width: 100%;
180189
}
181190

182-
183-
.search--input input{
191+
.search--input input {
184192
width: 100%;
185193
height: 2.3rem;
186194
}
@@ -194,6 +202,4 @@
194202
height: 30dvh;
195203
overflow-x: auto;
196204
}
197-
198-
199205
}

src/app/houses/Components/HouseTable/HousesTable.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default function HousesTable({ houses = [], onHouseClick }) {
133133

134134
</div>
135135
<button type='submit' disabled={isSubmitting}>
136-
{isSubmitting ? 'Submitting...' : 'Send it' }
136+
{isSubmitting ? 'Submitting...' : 'Send it'}
137137
</button>
138138
</form>
139139
</div>
@@ -149,6 +149,7 @@ export default function HousesTable({ houses = [], onHouseClick }) {
149149
<td>Block</td>
150150
<td>Partition</td>
151151
<td>Occupied</td>
152+
<td>Action</td>
152153
</tr>
153154
</thead>
154155
<tbody>
@@ -163,14 +164,18 @@ export default function HousesTable({ houses = [], onHouseClick }) {
163164
<td>{items.location}</td>
164165
<td>{items.block}</td>
165166
<td>{items.partition}</td>
166-
<td style={{ color: items.occupied ? '#33ff3c' : '#ef091a' }}>
167-
{items.occupied ? 'Occupied' : 'Vacant'}</td>
167+
<td style={{ color: items.occupied ? '#f8d7da' : '#28a745' }}>
168+
{items.occupied ? '🔴 Occupied' : ' 🟢 Vacant'}
169+
</td>
170+
<td>
171+
<button className='delete-btn'>Delete</button>
172+
</td>
168173
</tr>
169174
);
170175
})
171176
) : (
172177
<tr>
173-
<td colSpan={4} style={{ borderBottom: 'none' }}>
178+
<td colSpan={5} style={{ borderBottom: 'none' }}>
174179
<div style={{ textAlign: 'center', verticalAlign: 'middle', fontSize: '16px' }}>
175180
No Houses Found
176181
</div>

src/app/payments/Components/PayHistory/PayHistory.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@
5353
color: rgb(8, 221, 8);
5454
}
5555

56+
/* action */
57+
.edit-btn {
58+
background-color: #007bff;
59+
color: white;
60+
margin: 0 1rem;
61+
border: none;
62+
padding: .3rem 1rem;
63+
border-radius: 6px;
64+
}
65+
66+
.edit-btn:hover {
67+
background-color: #0056b3;
68+
}
69+
70+
.delete-btn {
71+
background-color: #dc3545;
72+
color: white;
73+
border: none;
74+
padding: .3rem 1rem;
75+
border-radius: 6px;
76+
77+
}
78+
79+
.delete-btn:hover {
80+
background-color: #a71d2a;
81+
}
82+
5683
@media screen and (max-width: 850px) {
5784

5885
.history-table {

src/app/payments/Components/PayHistory/PayHistory.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default function PayHistory () {
3838
<th>Location</th>
3939
<th>Block-Partition</th>
4040
<th>Amount</th>
41+
<th style={{width: '170px'}}>Actions</th>
4142
</tr>
4243
</thead>
4344
<tbody>
@@ -50,12 +51,16 @@ export default function PayHistory () {
5051
<td>{item.location}</td>
5152
<td>{item.block} - {item.partition}</td>
5253
<td>{item.amount}</td>
54+
<td>
55+
<button className='edit-btn' >Edit</button>
56+
<button className='delete-btn'>Delete</button>
57+
</td>
5358
</tr>
5459
)
5560
})
5661
) : (
5762
<tr>
58-
<td>No Payments</td>
63+
<td colSpan={6}>No Payments Found</td>
5964
</tr>
6065
)}
6166
</tbody>

0 commit comments

Comments
 (0)