Skip to content

Commit

Permalink
DBC22-1677 Fixing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbird committed Feb 1, 2024
1 parent 54f0db3 commit 9ee9b9e
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 64 deletions.
59 changes: 0 additions & 59 deletions src/frontend/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,65 +152,6 @@ body {
}
}

&--camera {
.popup__description {
p {
@media (max-width: 575px) {
order: 2;
}
}
.camera-image {
@media (max-width: 575px) {
order: 1;
}

img {
@media (max-width: 575px) {
width: 100%;
}
}

.timestamp {
background-color: $Black;
padding: 0 10px;
display: flex;
color: $White;
font-size: 0.714rem;

p {
color: $White;
margin-bottom: 0;
}

.driveBC {
font-family: serif;
span {
color: $BC-Yellow;
}
margin-right: 10px;
}

.friendly-time, .formatted-date {
margin-left: auto;
}
}

&.camera-unavailable {
background-color: $Surface-status-red;
border-left: 3px solid;
border-color: $Type-status-red;
padding: 1rem;
min-height: 225px;
font-size: 1rem;
p, .card-img-box {
color: $Type-status-red;
font-weight: 700;
}
}
}
}
}

&--ferry {

.popup__title {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/Components/FriendlyTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function FriendlyTime( {date} ) {
event.stopPropagation();
setShowTooltip(!showTooltip)}
}>
<p className={"friendly-time-text" }>
<p className="friendly-time-text">
<ReactTimeAgo date={date} locale="en-US"/>
</p>
<span className={"friendly-time__tooltip" + (showTooltip ? " showTooltip" : "")}>{dateFormatted}</span>
Expand Down
18 changes: 14 additions & 4 deletions src/frontend/src/Components/map/camPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faVideoSlash } from '@fortawesome/free-solid-svg-icons';

import colocatedCamIcon from '../../images/colocated-camera.svg';
import './camPopup.scss';

export default function CamPopup(props) {
// Props
Expand Down Expand Up @@ -94,11 +95,20 @@ export default function CamPopup(props) {
<FriendlyTime date={camera.last_update_modified} />
</div>
</div> :
<div className='camera-image camera-unavailable'>
<div className="card-img-box unavailable">
<FontAwesomeIcon icon={faVideoSlash} />
<div className='camera-image'>
<div className='camera-unavailable'>
<div className="card-pill">
<p>Unavailable</p>
</div>
<div className="card-img-box unavailable">
<FontAwesomeIcon icon={faVideoSlash} />
</div>
<p>This camera image is temporarily unavailable. Please check again later.</p>
</div>
<div className="timestamp">
<p className="driveBC">Drive<span>BC</span></p>
<FriendlyTime date={camera.last_update_modified} />
</div>
<p>This camera image is currently unavailable due to technical difficulties.</p>
</div>
}
</div>
Expand Down
86 changes: 86 additions & 0 deletions src/frontend/src/Components/map/camPopup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@import "../../styles/variables";

.popup--camera {
.popup__description {
p {
@media (max-width: 575px) {
order: 2;
}
}
.camera-image {
@media (max-width: 575px) {
order: 1;
}

img {
@media (max-width: 575px) {
width: 100%;
}
}

.timestamp {
background-color: $Black;
padding: 0 10px;
display: flex;
color: $White;
font-size: 0.714rem;
align-items: baseline;

p {
color: $White;
margin-bottom: 0;
}

.driveBC {
font-family: serif;
span {
color: $BC-Yellow;
}
margin-right: 10px;
}

.friendly-time, .formatted-date {
margin-left: auto;
}

.formatted-date {
font-size: 0.75rem;
}
}

.camera-unavailable {
background-color: $Surface-status-red;
padding: 1rem;
min-height: 225px;
font-size: 1rem;
p, .card-img-box {
color: $Type-status-red;
clear: right;
}

svg {
font-size: 1rem;
}

.card-pill {
background-color: $Error;
border-radius: 12px;
height: 24px;
float: right;
display: flex;
justify-content: center;
align-items: center;
padding: 4px 6px;

p {
color: $White;
font-weight: 700;
margin-bottom: 0;
font-size: 0.625rem;
}
}
}
}
}
}

0 comments on commit 9ee9b9e

Please sign in to comment.