-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
238 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { Link, Stack, SvgIcon } from "@mui/material"; | ||
import { SxProps, Theme } from "@mui/material/styles"; | ||
import Image, { ImageProps } from "next/image"; | ||
import React from "react"; | ||
|
||
import PreviousIcon from "@/engineeringblog/assets/icons/Type=chevron-left, Size=24, Color=CurrentColor.svg"; | ||
|
||
export interface LogoProps extends ImageProps { | ||
href?: string; | ||
sx?: SxProps<Theme>; | ||
title?: string; | ||
} | ||
|
||
const Logo = React.forwardRef(function Logo( | ||
props: LogoProps, | ||
ref: React.ForwardedRef<HTMLDivElement>, | ||
) { | ||
const { | ||
alt, | ||
href: hrefProp, | ||
src, | ||
sx, | ||
title, | ||
...other // All next/image supported props | ||
} = props; | ||
const logoHref = title?.length ? "https://codeforafrica.org" : "/"; | ||
|
||
return ( | ||
<Stack | ||
direction="row" | ||
spacing={1} | ||
sx={{ | ||
color: "inherit", | ||
alignItems: "center", | ||
position: "relative", | ||
...sx, | ||
}} | ||
ref={ref} | ||
> | ||
<Link | ||
color="inherit" | ||
href={logoHref} | ||
sx={(theme) => ({ | ||
"&>svg,&>img": { | ||
transition: theme.transitions.create(["opacity", "transform"]), | ||
}, | ||
"&:hover": { | ||
"&>svg,&>img": { | ||
opacity: 0.65, | ||
}, | ||
"&>svg": { | ||
transform: "translateX(-5px)", | ||
}, | ||
}, | ||
})} | ||
> | ||
{title?.length ? ( | ||
<SvgIcon | ||
sx={(theme) => ({ | ||
fill: { xs: "none" }, | ||
fontSize: 32, | ||
left: -24, | ||
opacity: 0, | ||
position: "absolute", | ||
right: 0, | ||
})} | ||
> | ||
<PreviousIcon /> | ||
</SvgIcon> | ||
) : null} | ||
<Image | ||
{...other} | ||
alt={alt} | ||
priority | ||
src={src} | ||
style={{ | ||
height: 32, | ||
width: "auto", | ||
}} | ||
/> | ||
</Link> | ||
{title?.length ? ( | ||
<Link | ||
color="text.primary" | ||
href="/" | ||
textTransform="uppercase" | ||
typography="h4" | ||
underline="none" | ||
sx={({ transitions, typography }) => ({ | ||
display: "flex", | ||
fontFamily: typography.fontFamilyMono, | ||
transition: transitions.create(["opacity", "transform"]), | ||
"&:hover": { | ||
opacity: 0.65, | ||
}, | ||
})} | ||
> | ||
Technology | ||
</Link> | ||
) : null} | ||
</Stack> | ||
); | ||
}); | ||
|
||
export default Logo; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { LogoProps } from "./Logo"; | ||
import Logo from "./Logo"; | ||
|
||
export type { LogoProps }; | ||
export default Logo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.