Skip to content

Commit

Permalink
Merge branch 'feature/cfa-projects-list' into feature/single-project-…
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
koechkevin committed Sep 28, 2023
2 parents be7a361 + 39e7f3e commit 7830c9b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const ProjectActionArea = styled(CardActionArea, {

const ProjectCard = React.forwardRef(function ProjectCard(props, ref) {
const {
externalLink,
link: { href },
icon,
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ProjectTitle = styled(RichTypography, {
const ProjectPageHeader = React.forwardRef(
function ProjectPageHeader(props, ref) {
const {
externalLink,
externalLink: { href },
icon,
name,
subtitle,
Expand Down Expand Up @@ -133,8 +133,8 @@ const ProjectPageHeader = React.forwardRef(
</CardContent>
<CardActions sx={{ mt: 2, p: 0 }}>
<Button
href={externalLink}
component={externalLink ? Link : undefined}
href={href}
component={href ? Link : undefined}
endIcon={
<SvgIcon
component={ExternalLinkIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ exports[`<ProjectPageHeader /> renders unchanged 1`] = `
<div
class="MuiCardActions-root MuiCardActions-spacing css-1jzc3k6-MuiCardActions-root"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-12dqrmj-MuiButtonBase-root-MuiButton-root"
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium active css-15w6lcd-MuiTypography-root-MuiLink-root-MuiButtonBase-root-MuiButton-root"
href="https://codeforafrica.org"
rel="noreferrer noopener"
tabindex="0"
type="button"
target="_blank"
>
Launch Project
<span
Expand All @@ -127,7 +129,7 @@ exports[`<ProjectPageHeader /> renders unchanged 1`] = `
viewbox="0 0 24 24"
/>
</span>
</button>
</a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const render = createRender({ theme });
const defaultProps = {
href: "/projects/test-project",
tag: "Iniatives",
externalLink: { href: "https://codeforafrica.org" },
};

describe("<ProjectPageHeader />", () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/codeforafrica/src/payload/collections/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Projects = {
{
name: "tagLine",
label: {
en: "Tag Line",
en: "Tagline",
},
type: "text",
},
Expand All @@ -52,7 +52,7 @@ const Projects = {
position: "sidebar",
},
}),
linkGroup({ overrides: { name: "externalLink", label: "External Link" } }),
linkGroup({ overrides: { name: "externalLink", label: "Link" } }),
image({
overrides: {
label: {
Expand Down

0 comments on commit 7830c9b

Please sign in to comment.