Skip to content

Commit 9365ab6

Browse files
authored
Merge pull request #16 from mateonunez/feat/projects
2 parents 1d8e27e + 1694228 commit 9365ab6

File tree

27 files changed

+733
-52
lines changed

27 files changed

+733
-52
lines changed

.env.local.example

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Next
22
NEXT_PUBLIC_BASE_URL=
33

4-
# Spotify
4+
# Spotify
55
SPOTIFY_CLIENT_ID=
66
SPOTIFY_CLIENT_SECRET=
77
SPOTIFY_REFRESH_TOKEN=
8-
SPOTIFY_REDIRECT_URI=
8+
SPOTIFY_REDIRECT_URI=
9+
10+
# Github
11+
GITHUB_TOKEN=

components/articles/mdx/heading/index.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,28 @@ const copyToClipboard = ({ id, title, ...rest }) => {
1616
);
1717
};
1818

19-
export const H1 = ({ id, children, ...rest }) => (
20-
<>
21-
<h1 title={children} aria-label={children} {...rest}>
22-
{children}
19+
export const H1 = ({ id, children, ...rest }) => {
20+
let title;
21+
if (typeof children === 'object') {
22+
title = children.props?.title;
23+
} else {
24+
title = children;
25+
}
2326

24-
{id && copyToClipboard({ id, title: children })}
25-
</h1>
26-
</>
27-
);
27+
return (
28+
<>
29+
<h1 title={title} aria-label={title} {...rest} className="flex text-2xl">
30+
{children}
31+
32+
{id && copyToClipboard({ id, title: children })}
33+
</h1>
34+
</>
35+
);
36+
};
2837

2938
export const H2 = ({ id, children, ...rest }) => (
3039
<>
31-
<h2 title={children} aria-label={children} {...rest}>
40+
<h2 title={children} aria-label={children} {...rest} className="text-lg">
3241
{children}
3342

3443
{id && copyToClipboard({ id, title: children })}

components/articles/mdx/link/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ import Link from 'next/link';
33
export default function MDXLink({ children, ...rest }) {
44
const { href } = rest;
55

6+
let title;
7+
if (typeof children === 'object') {
8+
title = children.props?.alt;
9+
} else {
10+
title = children;
11+
}
12+
613
return (
714
<>
815
<Link href={href}>
9-
<a href={href} alt={children} title={children} target="_blank" rel="noreferrer">
16+
<a href={href} alt={title} title={title} target="_blank" rel="noreferrer">
1017
{children}
1118
</a>
1219
</Link>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as GitHubProfile } from './profile';
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import s from './profile.module.css';
2+
3+
import { Container } from 'components';
4+
5+
import Image from 'next/image';
6+
import Link from 'next/link';
7+
8+
export default function Profile({ avatar, bio, company, email, username, url, location, ...rest }) {
9+
console.log('Snooping...', {
10+
company,
11+
email,
12+
location
13+
});
14+
15+
return (
16+
<>
17+
<Container {...rest}>
18+
<div className={s.root}>
19+
{/* Avatar */}
20+
<div className={s.avatar}>
21+
<Image
22+
width={150}
23+
height={150}
24+
src={avatar}
25+
alt="Mateo Nunez's face"
26+
layout="responsive"
27+
/>
28+
</div>
29+
<div className={s.bioContainer}>
30+
{/* Name */}
31+
<h1 className={s.name}>@{username}</h1>
32+
{/* Bio */}
33+
<p className={s.bio}>{bio}</p>
34+
{/* Url */}
35+
<Link href={url}>
36+
<a title="Github" aria-label="Github" rel="canonical" target="_blank">
37+
{url}
38+
</a>
39+
</Link>
40+
</div>
41+
</div>
42+
</Container>
43+
</>
44+
);
45+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.root {
2+
margin: auto 4rem;
3+
display: flex;
4+
flex-direction: row;
5+
align-items: center;
6+
width: 600px;
7+
min-height: auto;
8+
}
9+
10+
.avatar {
11+
width: 150px;
12+
height: 150px;
13+
border-radius: 50%;
14+
overflow: hidden;
15+
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
16+
}
17+
18+
.bioContainer {
19+
margin-top: 1rem;
20+
margin-left: 2rem;
21+
}
22+
23+
.name {
24+
font-size: 1.5rem;
25+
font-weight: bold;
26+
}
27+
28+
.bio {
29+
font-size: 1rem;
30+
font-weight: lighter;
31+
}
32+
33+
@media (max-width: 600px) {
34+
.root {
35+
margin: 1rem 0 4rem;
36+
}
37+
}

components/github/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './cards/profile';
2+
export * from './repositories/preview';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as RepositoryPreview } from './preview';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as RepositoryPreview } from './preview';
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { Fork, Star } from 'components';
2+
import Link from 'next/link';
3+
import s from './preview.module.css';
4+
5+
export default function RepositoryPreview({
6+
name,
7+
description,
8+
forks,
9+
language,
10+
languageColor,
11+
stars,
12+
url
13+
}) {
14+
return (
15+
<>
16+
<div className={s.root}>
17+
<div className={s.container}>
18+
{/* Heading */}
19+
20+
{/* Name */}
21+
<Link href={url}>
22+
<a
23+
rel="canonical noreferrer"
24+
target="_blank"
25+
className={s.name}
26+
title={name}
27+
href={url}>
28+
{name}
29+
</a>
30+
</Link>
31+
32+
{/* Description */}
33+
<div className={s.description}>{description}</div>
34+
35+
{/* Stats and Language */}
36+
<div className={s.stats}>
37+
{/* Language */}
38+
{language && (
39+
<div className={s.language}>
40+
<div className={s.languageColor} style={{ backgroundColor: languageColor }} />
41+
<div className={s.languageName}>{language}</div>
42+
</div>
43+
)}
44+
45+
{/* Stars */}
46+
<div className={s.stars}>
47+
<Link href={`${url}/stargazers`}>
48+
<a
49+
href={`${url}/stargazers`}
50+
rel="canonical noreferrer"
51+
target="_blank"
52+
aria-label={`${name} stars`}
53+
title={`${name} stars`}
54+
className="flex">
55+
<Star className="w-5 h-5" />
56+
<span className={s.starsCount}>{stars}</span>
57+
</a>
58+
</Link>
59+
</div>
60+
61+
{/* Forks */}
62+
<div className={s.forks}>
63+
<Link href={`${url}/network/members`}>
64+
<a
65+
href={`${url}/network/members`}
66+
rel="canonical noreferrer"
67+
target="_blank"
68+
aria-label={`${name} forks`}
69+
title={`${name} forks`}
70+
className="flex">
71+
<Fork className="w-5 h-5" />
72+
<div className={s.forksCount}>{forks}</div>
73+
</a>
74+
</Link>
75+
</div>
76+
</div>
77+
</div>
78+
</div>
79+
</>
80+
);
81+
}

0 commit comments

Comments
 (0)