Skip to content

Commit c9a1b6b

Browse files
authored
Merge pull request #2 from code-star/main
restyle
2 parents 647a00c + 01f4313 commit c9a1b6b

File tree

7 files changed

+76
-20
lines changed

7 files changed

+76
-20
lines changed

components/MeetupCard/MeetupCard.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
& > ul {
1414
list-style-type: none;
1515
padding: 0;
16+
17+
& > li > a:hover {
18+
text-decoration: underline;
19+
}
1620

1721
& > li {
1822
overflow: hidden;
1923

24+
2025
// &:hover h3 {
2126
// // color: blue;
2227
// text-shadow: 2px 2px 2px black;

components/PlaylistItemCard/PlaylistItemCard.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
flex-direction: column;
88
gap: 10px;
99

10+
&:hover {
11+
background-color: lighten($highlight-card-bg, 10%);
12+
}
13+
1014
& > :global(.img) {
1115
border-top-left-radius: 4px;
1216
border-top-right-radius: 4px;

components/PublicationCard/PublicationCard.module.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
padding: 0 10px;
77

88
&:hover {
9-
background-color: #213c5e;
9+
background-color: lighten($highlight-card-bg, 10%);
1010
}
1111

1212
& > section {
@@ -25,12 +25,14 @@
2525

2626
.publication-card--avatar {
2727
background-color: $orange;
28+
background-size: 50px;
2829
border-radius: 50%;
2930
color: black;
30-
height: 20px;
31-
min-width: 20px;
31+
height: 50px;
32+
min-width: 50px;
3233
position: relative;
3334
text-align: center;
35+
font-size: 40px;
3436
}
3537

3638
.publication-card--author {

components/PublicationCard/PublicationCard.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
import { FC } from "react";
22
import { formatDate } from "../../lib/formatDate";
33
import { IPublication } from "../../lib/publications/publications.types";
4-
// import { IPublication } from "../../lib/publications/getPublications";
54
// import SanitizedHTML from 'react-sanitized-html';
65
import styles from "./PublicationCard.module.scss";
76

87
interface IPublicationCardProps {
98
publication: IPublication;
109
}
1110

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+
1223
const PublicationCard: FC<IPublicationCardProps> = ({ publication }) => {
13-
const { title, author, uniqueSlug, paragraphs, latestPublishedAt } =
14-
publication;
24+
const { title, author, uniqueSlug, latestPublishedAt } = publication;
25+
const avatar = avatars[author.toLowerCase()];
1526
return (
1627
<a href={uniqueSlug} className={styles["publication-card"]}>
1728
<section>
18-
{/* TODO map avatars */}
19-
<div className={styles["publication-card--avatar"]}>
20-
{author.slice(0, 1).toUpperCase()}
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()}
2140
</div>
2241
<div>
2342
<p className={styles["publication-card--author"]}>{author}</p>

components/UpcomingMeetupCard/UpcomingMeetupCard.module.scss

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,36 @@
44
border-radius: 4px;
55
background-color: $highlight-card-bg;
66
padding: 1rem;
7+
text-align: center;
78

8-
h3 {
9-
margin: 0;
9+
&:hover {
10+
background-color: lighten($highlight-card-bg, 10%);
1011
}
1112

12-
p {
13-
font-size: 80%;
14-
margin-top: 2px;
15-
color: $underline-text;
13+
h2, h3 {
14+
margin-top: 0;
1615
}
1716

18-
> a {
17+
// h2 {
18+
// background-color: black;
19+
// padding: 1rem;
20+
// }
21+
22+
> p > a {
1923
display: inline-block;
2024
background-color: $orange;
2125
border-radius: 4px;
2226
padding: 8px;
2327
font-weight: bold;
2428
color: black;
29+
width: 100%;
30+
max-width: $aside-width;
31+
text-align: center;
32+
33+
@media (min-width: $main-width) {
34+
// width: $aside-width - 30px;
35+
max-width: auto;
36+
// width: 100%;
37+
}
2538
}
2639
}

components/UpcomingMeetupCard/UpcomingMeetupCard.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
import { FC } from "react";
22
import { IMeetupEvent } from "../../lib/meetup/meetup.types";
33
import Image from "next/image";
4-
import { formatDate } from "../../lib/formatDate";
4+
55
import styles from "./UpcomingMeetupCard.module.scss";
66

77
interface IUpcomingMeetupCardProps {
88
meetup: IMeetupEvent;
99
}
1010

11+
const formatDate = (time: string) =>
12+
new Date(time).toLocaleDateString("en-GB", {
13+
day: "2-digit",
14+
month: "short",
15+
year: "numeric",
16+
});
17+
1118
const UpcomingMeetupCard: FC<IUpcomingMeetupCardProps> = ({ meetup }) => {
1219
const { link, featured_photo, name, time } = meetup;
1320
return (
1421
<a href={link}>
1522
<section className={styles["upcoming-meetup-card"]}>
23+
<h2>MEETUP</h2>
24+
<h3>{name}</h3>
1625
{featured_photo && (
1726
<Image
1827
alt=""
@@ -21,9 +30,9 @@ const UpcomingMeetupCard: FC<IUpcomingMeetupCardProps> = ({ meetup }) => {
2130
height={200}
2231
/>
2332
)}
24-
<h3>{name}</h3>
25-
<p>{formatDate(time)}</p>
26-
<a href={link}>SIGN UP!</a>
33+
<p>
34+
<a href={link}>SIGN UP FOR {formatDate(time).toUpperCase()}</a>
35+
</p>
2736
</section>
2837
</a>
2938
);

components/UpcomingMeetupList/UpcomingMeetupList.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
padding: 1rem;
55
width: 100%;
66

7+
& > :global(a) {
8+
width: 100%;
9+
}
10+
711
@media (min-width: $main-width) {
812
padding: 0;
913
width: $aside-width;

0 commit comments

Comments
 (0)