Skip to content

Commit 2b0119c

Browse files
authored
Merge pull request #14 from code-star/fix/fix_avatars
Fix/fix avatars
2 parents 4648b02 + 2835f73 commit 2b0119c

13 files changed

+66
-36
lines changed

.github/workflows/prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [16.x]
18+
node-version: [20.x]
1919

2020
steps:
2121
- name: Checkout 🛎️

.github/workflows/test.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [16.x]
15+
node-version: [20.x]
1616

1717
steps:
1818
- name: Checkout 🛎️
@@ -36,10 +36,19 @@ jobs:
3636
npx next build && npx next export
3737
touch out/.nojekyll
3838
# CI: false # true -> fails on warning
39-
- name: Deploy 🚀
40-
uses: JamesIves/github-pages-deploy-action@v4
39+
# - name: Deploy 🚀
40+
# uses: JamesIves/github-pages-deploy-action@v4
41+
# with:
42+
# token: ${{ secrets.GITHUB_TOKEN }}
43+
# branch: gh-pages # The branch the action should deploy to.
44+
# folder: out # The folder the action should deploy.
45+
# clean: true # Automatically remove deleted files from the deploy branch
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v5
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
4150
with:
42-
token: ${{ secrets.GITHUB_TOKEN }}
43-
branch: gh-pages # The branch the action should deploy to.
44-
folder: out # The folder the action should deploy.
45-
clean: true # Automatically remove deleted files from the deploy branch
51+
path: 'out'
52+
- name: Deploy to GitHub Pages 🚀
53+
id: deployment
54+
uses: actions/deploy-pages@v4
Loading
Loading
Loading
Loading
Loading

components/PublicationCard/PublicationCard.module.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
}
2424

2525
h2 {
26-
font-family: "Conduit ITC W04 Regular", 'system-ui';
26+
font-family: "Conduit ITC W04 Regular", "system-ui";
2727
font-size: 180%;
2828
}
2929
}
3030

3131
.publication-card--avatar {
3232
background-color: $red;
33-
background-size: 50px;
3433
border-radius: 50%;
3534
color: black;
3635
height: 50px;
@@ -39,6 +38,16 @@
3938
text-align: center;
4039
font-size: 40px;
4140
font-family: "Righteous", sans-serif;
41+
42+
.publication-card--avatar-img {
43+
border-radius: 50%;
44+
height: 50px;
45+
width: 50px;
46+
position: absolute;
47+
top: 0;
48+
background-size: 50px;
49+
overflow: hidden;
50+
}
4251
}
4352

4453
.publication-card--author {

components/PublicationCard/PublicationCard.tsx

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,19 @@ import { formatDate } from "../../lib/formatDate";
33
import { IPublication } from "../../lib/publications/publications.types";
44
// import SanitizedHTML from 'react-sanitized-html';
55
import styles from "./PublicationCard.module.scss";
6+
import { PublicationCardAvatar } from "./PublicationCardAvatar";
67

78
interface IPublicationCardProps {
89
publication: IPublication;
910
}
1011

11-
const avatars: Record<string, string> = {
12-
mdworld: "https://miro.medium.com/fit/c/176/176/0*gTl35Xy5zRcgu5wJ.png",
13-
"nathan perdijk":
14-
"https://miro.medium.com/fit/c/88/88/0*Bqr-dMZplB-namyY.jpg",
15-
"bjorn ‘bjeaurn’":
16-
"https://miro.medium.com/fit/c/176/176/0*o9UzuQyUwobacrCt.jpeg",
17-
"hamza haiken":
18-
"https://miro.medium.com/fit/c/176/176/2*1JTGoMi8_nuGQVO1EoItXg.png",
19-
"nick ten veen":
20-
"https://miro.medium.com/fit/c/88/88/2*k7vMxGfKwfqJ86TcprDA_Q.jpeg",
21-
};
22-
2312
const PublicationCard: FC<IPublicationCardProps> = ({ publication }) => {
2413
const { title, author, uniqueSlug, latestPublishedAt } = publication;
25-
const avatar = avatars[author.toLowerCase()];
14+
2615
return (
2716
<a href={uniqueSlug} className={styles["publication-card"]}>
2817
<section>
29-
<div
30-
className={styles["publication-card--avatar"]}
31-
style={
32-
avatar
33-
? {
34-
backgroundImage: `url(${avatar})`,
35-
}
36-
: {}
37-
}
38-
>
39-
{avatar ? "" : author.slice(0, 1).toUpperCase()}
40-
</div>
18+
<PublicationCardAvatar author={author} />
4119
<div>
4220
<p className={styles["publication-card--author"]}>{author}</p>
4321
<p className={styles["publication-card--date"]}>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { FC } from "react";
2+
import styles from "./PublicationCard.module.scss";
3+
import nathanImg from "./0_Bqr-dMZplB-namyY.jpg";
4+
import mdworldImg from "./0_gTl35Xy5zRcgu5wJ.png";
5+
import nickImg from "./2_k7vMxGfKwfqJ86TcprDA_Q.jpg";
6+
import hamzaImg from "./2_1JTGoMi8_nuGQVO1EoItXg.png";
7+
import bjornImg from "./0_o9UzuQyUwobacrCt.jpg";
8+
import Image, { StaticImageData } from "next/image";
9+
10+
const avatars: Record<string, StaticImageData> = {
11+
mdworld: mdworldImg,
12+
"nathan perdijk": nathanImg,
13+
"bjorn ‘bjeaurn’": bjornImg,
14+
"hamza haiken": hamzaImg,
15+
"nick ten veen": nickImg,
16+
};
17+
18+
export const PublicationCardAvatar: FC<{ author: string }> = ({ author }) => {
19+
const avatar = avatars[author.toLowerCase()];
20+
21+
return (
22+
<div className={styles["publication-card--avatar"]}>
23+
<div className="letter">{author.slice(0, 1).toUpperCase()}</div>
24+
25+
<div className={styles["publication-card--avatar-img"]}>
26+
{avatar && <Image src={avatar} alt="avatar" width={50} height={50} />}
27+
</div>
28+
</div>
29+
);
30+
};

components/TopBar/TopBar.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
a {
3131
border-radius: 4px;
3232
padding: 10px;
33+
color: var(--cs-brutalist-creme);
3334

3435
&:hover {
3536
background-color: #222;

components/TopBar/TopBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const TopBar: FC = () => {
1818
</li>
1919
<li>Codelancer</li> */}
2020
<li>
21-
<a href="https://www.ordina.nl/vakgebieden/scala/">Contact</a>
21+
<a href="https://www.linkedin.com/company/codestar-powered-by-sopra-steria/">
22+
Contact
23+
</a>
2224
</li>
2325
</ul>
2426
</div>

lib/publications/publications.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface IMediumRSSResponse {
1717
id: string;
1818
title: string;
1919
author: string;
20+
avatar?: string;
2021
latestPublishedAt: string;
2122
uniqueSlug: string;
2223
paragraphs: string;

0 commit comments

Comments
 (0)