Skip to content

Commit

Permalink
DBC22-1806: applied skeleton to headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed Feb 27, 2024
1 parent 9aeb7ef commit 2e80f5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/frontend/src/Components/events/EventCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ export default function EventCard(props) {

<div className="event-card__details">
<div className="type">
<div className="header">Type</div>
<div className="header">{ showLoader ? <Skeleton /> : 'Type' }</div>
<div className="content">
{ showLoader ? <Skeleton width={75} /> : <div>{icon} {event.severity.toLowerCase()}</div> }
</div>
</div>

<div className="description">
<div className="header">Description</div>
<div className="header">{ showLoader ? <Skeleton /> : 'Description' }</div>
<div className="content">{ showLoader ? <Skeleton count={7} /> : event.description }</div>
</div>

<div className="last-update">
<div className="header">Last Update</div>
<div className="header">{ showLoader ? <Skeleton /> : 'Last Update' }</div>
<div className="content">
{ showLoader ? <Skeleton width={'90%'} /> : <FriendlyTime date={event.last_updated} /> }
</div>
</div>

<div className="map">
<div className="header">Map</div>
<div className="header">{ showLoader ? <Skeleton /> : 'Map' }</div>
<div className="content">
{ showLoader ? <Skeleton width={30} /> : <FontAwesomeIcon icon={faMapLocation} /> }
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/src/Components/events/EventsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default function EventsTable(props) {
{headerGroup.headers.map((header) => {
return (
<th className={header.id} key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder ? null : (
{!header.isPlaceholder && !showLoader && (
<span
{...{
className: header.column.getCanSort() ?
Expand All @@ -169,6 +169,10 @@ export default function EventsTable(props) {
}[header.column.getIsSorted()] ?? null}
</span>
)}

{showLoader &&
<Skeleton />
}
</th>
);
})}
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/Components/events/EventsTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

table {
font-size: 0.875rem;
width: 100%;

thead {
background-color: $BC-Blue-Light;
Expand Down

0 comments on commit 2e80f5a

Please sign in to comment.