Skip to content

Commit

Permalink
Update Tool page fix fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Jun 19, 2024
1 parent cf59a81 commit cd0af96
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 34 deletions.
7 changes: 5 additions & 2 deletions apps/charterafrica/src/components/Tool/DescriptionAndShare.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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) {
Expand All @@ -21,10 +22,12 @@ const DescriptionAndShare = React.forwardRef(
<RichTypography
textAlign="left"
color="neutral.dark"
sx={{ mt: 3.75 }}
sx={{ mt: 3.75, textAlign: { xs: "center", sm: "left" } }}
variant="p1"
>
{lastActive}
{formatDateTime(lastActive, {
includeTime: true,
})}
</RichTypography>
<Box
display="flex"
Expand Down
2 changes: 1 addition & 1 deletion apps/charterafrica/src/components/Tool/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Metrics = React.forwardRef(function Metrics(props, ref) {
} = props;
return (
<Box display="flex" sx={sx} ref={ref} flexWrap="wrap" alignItems="center">
<Box display="flex" alignItems="center" sx={{ mb: 2, ml: 2 }}>
<Box display="flex" alignItems="center" sx={{ mb: 2, mr: 2 }}>
<SvgIcon
inheritViewBox
component={ViewsIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,70 @@ const OrgThemeAndOperatingCountries = React.forwardRef(
}
return (
<Box sx={sx} ref={ref}>
<Figure
ImageProps={{
alt: organisation.name,
src: organisation.avatarUrl,
<Box
display="flex"
sx={{
justifyContent: {
xs: "center",
sm: "left",
display: "flex",
},
}}
>
<Figure
ImageProps={{
alt: organisation.name,
src: organisation.avatarUrl,
}}
sx={{
height: 50,
width: 150,
}}
/>
</Box>
<Box
display="flex"
sx={{
height: 50,
width: "auto",
justifyContent: {
xs: "center",
sm: "left",
display: "flex",
},
}}
/>
<Link
href={organisation?.link?.href || "#"}
textAlign="left"
color="neutral.dark"
sx={{ textDecoration: "none" }}
variant="h3Small"
>
{organisation.name}
</Link>
{theme ? (
<Button
variant="contained"
component="div"
sx={{ backgroundColor: "success.main", color: "neutral.dark" }}
<Link
href={organisation?.link?.href || "#"}
textAlign="left"
color="neutral.dark"
sx={{ textDecoration: "none", fontWeight: 400 }}
variant="h4"
>
{theme}
</Button>
) : null}
{organisation.name}
</Link>
</Box>
<Box
sx={{
justifyContent: {
xs: "center",
sm: "left",
display: "flex",
},
}}
>
{theme ? (
<Button
variant="contained"
component="div"
sx={{
backgroundColor: "success.main",
color: "neutral.dark",
mt: 3.75,
}}
>
{theme}
</Button>
) : null}
</Box>
<RichTypography color="neutral.dark" variant="p3" sx={{ mt: 3.75 }}>
{countries}
</RichTypography>
Expand Down
24 changes: 16 additions & 8 deletions apps/charterafrica/src/components/Tool/Tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from "react";

import ExternalLink from "@/charterafrica/assets/icons/Type=external-link, Size=24, Color=CurrentColor.svg";
import GithubIcon from "@/charterafrica/assets/icons/Type=github, Size=24, Color=CurrentColor.svg";
import LineClampedRichTypography from "@/charterafrica/components/LineClampedRichTypography";
import Contributors from "@/charterafrica/components/Tool/Contributors";
import DescriptionAndShare from "@/charterafrica/components/Tool/DescriptionAndShare";
import Metrics from "@/charterafrica/components/Tool/Metrics";
Expand Down Expand Up @@ -40,7 +41,7 @@ const Tool = React.forwardRef(function Tool(props, ref) {
<Box bgcolor="common.white" ref={ref}>
<Section sx={{ pb: { xs: 10 } }}>
<Grid sx={{ py: { sm: 10 } }} container ref={ref}>
<Grid container item sm={6} sx={{ pr: { sm: 6.25 } }}>
<Grid container item sm={7} sx={{ pr: { sm: 6.25 } }}>
<Grid item>
<CardMedia
component="img"
Expand All @@ -52,17 +53,21 @@ const Tool = React.forwardRef(function Tool(props, ref) {
}}
/>
</Grid>
<Grid xs={12} item>
<Grid sx={{ px: { xs: 2, sm: 0 } }} xs={12} item>
<Box
sx={{ width: "100%", mt: 3.75 }}
display="flex"
justifyContent="space-between"
alignItems="center"
flex={1}
>
<RichTypography color="neutral.dark" variant="h2SemiBold">
<LineClampedRichTypography
lineClamp={1}
color="neutral.dark"
variant="h2SemiBold"
>
{name}
</RichTypography>
</LineClampedRichTypography>
{externalLink?.href ? (
<Link href={externalLink.href}>
<SvgIcon
Expand All @@ -79,7 +84,7 @@ const Tool = React.forwardRef(function Tool(props, ref) {
) : null}
</Box>
</Grid>
<Grid item>
<Grid sx={{ px: { xs: 2, sm: 0 } }} item>
<OrgThemeAndOperatingCountries
sx={{ mt: 3.75, textAlign: "left" }}
organisation={organisation}
Expand All @@ -100,16 +105,19 @@ const Tool = React.forwardRef(function Tool(props, ref) {
<Grid
item
xs={12}
sm={6}
sm={5}
sx={() => ({
borderLeft: `1px solid rgba(0, 0, 0, 0.1)`,
textAlign: { sm: "right", xs: "center" },
pl: { sm: 6.25 },
px: { sm: 6.25, xs: 2 },
})}
>
<Box
ref={ref}
sx={{ width: { xs: "100%", sm: "fit-content" }, ml: "auto" }}
sx={{
width: { xs: "100%", sm: "fit-content" },
ml: "auto",
}}
>
<Button
component={goToRepo?.href ? Link : undefined}
Expand Down

0 comments on commit cd0af96

Please sign in to comment.