Skip to content

Commit

Permalink
Update labels
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Jun 19, 2024
1 parent 6f880ca commit b9ee183
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion apps/charterafrica/src/components/Tool/Contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Contributors = React.forwardRef(function Contributors(props, ref) {
return (
<Box ref={ref} sx={sx}>
<Box sx={{ p: 2 }}>
<RichTypography color="neutral.dark" variant="h4Small">
<RichTypography color="neutral.dark" variant="p3SemiBold">
{title}
</RichTypography>
<AvatarGroup sx={{ justifyContent: { xs: "center", sm: "right" } }}>
Expand Down
15 changes: 8 additions & 7 deletions apps/charterafrica/src/components/Tool/DescriptionAndShare.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import PropTypes from "prop-types";
import React from "react";

import ShareThisPage from "@/charterafrica/components/ShareThisPage";
import formatDateTime from "@/charterafrica/utils/formatDate";

const DescriptionAndShare = React.forwardRef(
function DescriptionAndShare(props, ref) {
const { sx, description, lastActive } = props;
const { sx, description, lastActive, activeText } = props;
return (
<Box sx={sx} ref={ref}>
<RichTypography
Expand All @@ -22,12 +21,14 @@ const DescriptionAndShare = React.forwardRef(
<RichTypography
textAlign="left"
color="neutral.dark"
sx={{ mt: 3.75, textAlign: { xs: "center", sm: "left" } }}
variant="p1"
sx={{
mt: 3.75,
textTransform: "none",
textAlign: { xs: "center", sm: "left" },
}}
variant="captionCap"
>
{formatDateTime(lastActive, {
includeTime: true,
})}
{activeText} {lastActive}
</RichTypography>
<Box
display="flex"
Expand Down
7 changes: 1 addition & 6 deletions apps/charterafrica/src/components/Tool/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import CommitIcon from "@/charterafrica/assets/icons/Type=commit, Size=24, Color
import ForksIcon from "@/charterafrica/assets/icons/Type=forks, Size=24, Color=CurrentColor.svg";
import StarsIcon from "@/charterafrica/assets/icons/Type=stars, Size=24, Color=CurrentColor.svg";
import ViewsIcon from "@/charterafrica/assets/icons/Type=views, Size=24, Color=CurrentColor.svg";
import formatDateTime from "@/charterafrica/utils/formatDate";

const Metrics = React.forwardRef(function Metrics(props, ref) {
const {
Expand Down Expand Up @@ -56,11 +55,7 @@ const Metrics = React.forwardRef(function Metrics(props, ref) {
/>
<Box sx={{ ml: 1 }}>
<RichTypography color="neutral.dark">
{lastCommit.committedDate
? formatDateTime(lastCommit.committedDate, {
includeTime: false,
})
: "-"}
{lastCommit.committedDate || "-"}
</RichTypography>
<RichTypography color="neutral.dark">{commitText}</RichTypography>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/charterafrica/src/components/Tool/Partners.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Partners = React.forwardRef(function Partners(props, ref) {
return (
<Box sx={sx} ref={ref}>
<Box sx={{ p: 2 }}>
<RichTypography color="neutral.dark" variant="h4Small">
<RichTypography color="neutral.dark" variant="p3SemiBold">
{title}
</RichTypography>
<Box
Expand Down
2 changes: 1 addition & 1 deletion apps/charterafrica/src/components/Tool/TechSkills.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TechSkills = React.forwardRef(function TechSkills(props, ref) {
}
return (
<Box sx={sx} ref={ref}>
<RichTypography variant="p3" color="neutral.dark">
<RichTypography variant="p3SemiBold" color="neutral.dark">
{title}
</RichTypography>
<br />
Expand Down
11 changes: 7 additions & 4 deletions apps/charterafrica/src/components/Tool/Tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Tool = React.forwardRef(function Tool(props, ref) {
theme,
operatingCountries,
description,
lastCommit,
lastActive,
goToRepo,
techSkills,
contributors,
Expand All @@ -36,6 +36,8 @@ const Tool = React.forwardRef(function Tool(props, ref) {
toolsTitle,
externalLink,
classification,
activeText,
collectionText,
} = props;
return (
<Box bgcolor="common.white" ref={ref}>
Expand Down Expand Up @@ -97,7 +99,8 @@ const Tool = React.forwardRef(function Tool(props, ref) {
/>
<DescriptionAndShare
description={description}
lastActive={lastCommit?.committedDate}
lastActive={lastActive}
activeText={activeText}
sx={{ mb: 6.75 }}
/>
</Grid>
Expand Down Expand Up @@ -150,8 +153,8 @@ const Tool = React.forwardRef(function Tool(props, ref) {
sx={{ mt: 3.75 }}
/>
<Box sx={{ mt: 3.75 }}>
<RichTypography variant="p3" color="neutral.dark">
Collection
<RichTypography variant="p3SemiBold" color="neutral.dark">
{collectionText}
</RichTypography>
<RichTypography sx={{ mt: 1 }} variant="p3">
{classification}
Expand Down
12 changes: 10 additions & 2 deletions apps/charterafrica/src/lib/data/common/processPageTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ async function processPageSingleTool(page, api, context) {
toolsTitle: filterLabels.tools,
donorsTitle: filterLabels.donors,
contributorsTitle: filterLabels.contributors,
lastActive: tool.lastActive
? formatDateTime(tool.lastActive, {})
lastActive: tool.lastCommit?.committedDate
? formatDateTime(tool.lastCommit.committedDate, { locale })
: null,
organisationName: tool.organisation?.name ?? null,
twitter: tool.organisation?.twitter ?? null,
Expand All @@ -108,10 +108,18 @@ async function processPageSingleTool(page, api, context) {
commitText: filterLabels.lastCommit,
forksText: filterLabels.forks,
starsText: filterLabels.stars,
collectionText: filterLabels.collection,
activeText: filterLabels.activeText,
collection: tool.classification,
externalLink: {
href: tool.docLink ?? null,
},
lastCommit: {
...tool.lastCommit,
committedDate: tool.lastCommit?.committedDate
? formatDateTime(tool.lastCommit.committedDate, { locale })
: null,
},
},
],
};
Expand Down
3 changes: 3 additions & 0 deletions apps/charterafrica/src/utils/translationConstants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const labelsPerLocale = {
en: {
activeText: "Last Active",
topic: "Topic A-Z",
"-topic": "Topic Z-A",
views: "Views Ascending",
Expand Down Expand Up @@ -34,6 +35,7 @@ const labelsPerLocale = {
classification: "Classification",
},
fr: {
activeText: "Dernier actif",
topic: "Sujet A-Z",
"-topic": "Sujet Z-A",
views: "Vues ascendantes",
Expand Down Expand Up @@ -68,6 +70,7 @@ const labelsPerLocale = {
classification: "Classification",
},
pt: {
activeText: "ativo pela última vez",
topic: "Tópico A-Z",
"-topic": "Tópico Z-A",
views: "Visualizações ascendentes",
Expand Down

0 comments on commit b9ee183

Please sign in to comment.