Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
HYP 167 Cert Issued Timestamp (#89)
Browse files Browse the repository at this point in the history
* Added green text style for timestamp
* Added formatDate
* Bump ver
* Removed the small font condition for resize / small screens
  • Loading branch information
dc-andysign authored Mar 18, 2024
1 parent 8e54231 commit 9d44182
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digicatapult/sqnc-hyproof-client",
"version": "0.3.14",
"version": "0.3.15",
"description": "User interface for HyProof",
"homepage": "https://github.com/digicatapult/sqnc-hyproof-client",
"main": "src/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/pages/CertificateViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default function CertificateViewer() {
energy={data?.energy_consumed_wh}
eco2={data?.embodied_co2}
posting={posting}
timestamp={data?.updated_at}
/>
</Grid.Panel>
</Grid>
Expand Down
26 changes: 25 additions & 1 deletion src/pages/components/CertificateViewDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Grid } from '@digicatapult/ui-component-library'

import CertificateTimeInterval from './CertificateTimeInterval'

import { formatDate } from '../../utils/helpers'

import BgIconDateSVG from '../../assets/images/icon-date.svg'
import BgIconTimeSVG from '../../assets/images/icon-time.svg'

Expand All @@ -23,10 +25,17 @@ export default function CertificateViewDetails({
energy,
eco2,
posting,
timestamp,
}) {
return (
<PaddedWrapperDiv>
<ContainerFlexWrapDiv>
{hasEco2(eco2) && (
<FullWidthDiv>
<GreenText>Timestamp of Certificate Issuance</GreenText>
<GreenBoldText>{formatDate(timestamp)}</GreenBoldText>
</FullWidthDiv>
)}
{hasDate(start) && hasDate(end) && (
<FlexDiv>
<Grid
Expand Down Expand Up @@ -141,6 +150,11 @@ const PaddedWrapperDiv = styled.div`
text-align: left;
`

const FullWidthDiv = styled.div`
margin: 8px 8px 20px 8px;
width: 100%;
`

const ContainerFlexWrapDiv = styled.div`
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -276,9 +290,19 @@ const IconTime = styled.span`
background: transparent url(${BgIconTimeSVG}) no-repeat;
`

const GreenText = styled.div`
color: #27847a;
font: normal 400 18.4px/0 Roboto;
`

const GreenBoldText = styled.div`
color: #27847a;
font: normal 700 18.4px/0 Roboto;
margin: 26px 0 8px 0;
`

const Text = styled.div`
display: flex;
width: 100%;
height: 26px;
min-width: 90px;
font: 500 18px/26px Roboto;
Expand Down

0 comments on commit 9d44182

Please sign in to comment.