File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ const Card = (props) => {
88 < h2 > { title } </ h2 >
99 < img src = { image } alt = { title } />
1010
11- < a href = { url } > { title } </ a >
12-
13-
11+ < a href = { url } className = "cardhref " >
12+ { " " }
13+ { title }
14+ </ a >
1415 </ div >
1516 ) ;
1617} ;
Original file line number Diff line number Diff line change 11.card {
2- display : grid ;
3- grid-template :
4- " image image image" 1fr
5- " . title ." auto / var (--space--gap ) 1fr var (--space--gap );
6- border : var (--border );
7- border-color : var (--color--accent );
2+ display : flex ;
3+ flex-direction : column ;
4+ }
85
9- & __title {
10- grid-area : title;
11- }
12- & __image {
13- grid-area : image ;
14- mix-blend-mode : overlay ;
15- }
6+ h2 {
7+ text-align : center ;
8+ font-size : 2em ;
9+ }
10+ h2 :hover {
11+ background-color : rgb (26 , 3 , 26 );
12+ color : white ;
13+ }
14+ .cardhref {
15+ font-size : 2em ;
16+ font-weight : bold ;
17+ color : rgb (255 , 255 , 255 );
18+ text-decoration : none ;
19+ position : relative ;
20+ top : -40% ;
21+ text-align : center ;
22+ }
23+ .cardhref :hover {
24+ background-color : skyblue ;
25+ opacity : 0.7 ;
26+ color : black ;
1627}
Original file line number Diff line number Diff line change 33 display : flex ;
44 gap : var (--space--gap );
55 align-items : stretch ;
6+ margin-bottom : 15px ;
67 }
78 & __label {
89 align-self : center ;
Original file line number Diff line number Diff line change 1+ .button {
2+ margin-bottom : 10px ;
3+ }
Original file line number Diff line number Diff line change 44}
55
66thead {
7- background-color : #f2f2f2 ;
7+ background-color : rgb (31 , 11 , 31 );
8+ color : white ;
89}
910
1011th ,
1718th {
1819 font-weight : bold ;
1920}
21+ .table-row {
22+ cursor : pointer ;
23+ }
24+ .selected {
25+ background-color : skyblue ;
26+ }
Original file line number Diff line number Diff line change 1- // import FakeBookings from "@/data/fakeBookings.json";
2-
1+ import FakeBookings from "@/data/fakeBookings.json" ;
2+ import React from "react" ;
3+ import { useState } from "react" ;
34function TableBody ( props ) {
5+ const [ selectedRow , setSelectedRow ] = useState ( "unselect" ) ;
6+ function handleSelect ( ) {
7+ setSelectedRow ( selectedRow === "unselect" ? "selected" : "unselect" ) ;
8+ }
49 let {
510 id,
611 title,
@@ -15,7 +20,11 @@ function TableBody(props) {
1520 } = props ;
1621 return (
1722 < >
18- < tr key = { id } >
23+ < tr
24+ key = { id }
25+ onClick = { handleSelect }
26+ className = { `table-row ${ selectedRow } ` }
27+ >
1928 < td > { id } </ td >
2029 < td > { title } </ td >
2130 < td > { firstName } </ td >
You can’t perform that action at this time.
0 commit comments