Skip to content

Commit 7a43d09

Browse files
authored
Merge pull request #75 from techknowledge-blog/feature/knowledger-socials-and-empty-state
knowledgers
2 parents e4fdcf7 + 4743991 commit 7a43d09

10 files changed

Lines changed: 187 additions & 2291 deletions

File tree

package-lock.json

Lines changed: 154 additions & 2135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@mdx-js/loader": "^3.1.0",
14-
"@mdx-js/react": "^3.1.0",
15-
"@mdx-js/rollup": "^3.1.0",
1613
"@phosphor-icons/react": "^2.1.7",
1714
"@tailwindcss/typography": "^0.5.15",
1815
"axios": "^1.8.2",
@@ -23,8 +20,7 @@
2320
"react-router": "^7.0.2",
2421
"react-router-dom": "^7.4.1",
2522
"react-syntax-highlighter": "^15.5.0",
26-
"rehype-highlight": "^6.0.0",
27-
"vite-plugin-mdx": "^3.6.1"
23+
"rehype-highlight": "^6.0.0"
2824
},
2925
"devDependencies": {
3026
"@types/react": "^18.2.15",

src/components/cardknowledger/mockKnowledgers.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ export const mockKnowledgers = [
2020
imageProfile: MoniqueProfileImage,
2121
flag: "alagoas",
2222
social: [
23-
{ icon: GithubLogo, url: "" },
24-
{ icon: InstagramLogo, url: "" },
25-
{ icon: LinkedinLogo, url: "" },
23+
{ icon: GithubLogo, url: "https://github.com/CyberNicky" },
24+
{ icon: InstagramLogo, url: "https://www.instagram.com/nicky__dev/" },
25+
{
26+
icon: LinkedinLogo,
27+
url: "https://www.linkedin.com/in/monique-campos-albuquerque/",
28+
},
2629
],
2730
},
2831

@@ -59,9 +62,12 @@ export const mockKnowledgers = [
5962
imageProfile: JoaoProfileImage,
6063
flag: "alagoas",
6164
social: [
62-
{ icon: GithubLogo, url: "" },
63-
{ icon: InstagramLogo, url: "" },
64-
{ icon: LinkedinLogo, url: "" },
65+
{ icon: GithubLogo, url: "https://github.com/mrgreentm" },
66+
{ icon: InstagramLogo, url: "https://www.instagram.com/joaojacintoo/" },
67+
{
68+
icon: LinkedinLogo,
69+
url: "https://www.linkedin.com/in/joaojacintoneto/",
70+
},
6571
],
6672
},
6773

@@ -72,8 +78,8 @@ export const mockKnowledgers = [
7278
imageProfile: DanielProfileImage,
7379
flag: "alagoas",
7480
social: [
75-
{ icon: InstagramLogo, url: "" },
76-
{ icon: LinkedinLogo, url: "" },
81+
{ icon: InstagramLogo, url: "https://www.instagram.com/odaniel2d/" },
82+
{ icon: LinkedinLogo, url: "https://www.linkedin.com/in/daniel2d/" },
7783
],
7884
},
7985
];

src/components/posts/post/MdxProvider.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/components/posts/post/post1.mdx

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/components/posts/post/post2.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/components/posts/post/post3.mdx

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/components/posts/post/post4.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/pages/Profile.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ export function Profile() {
5656
<h3 className="text-xl font-bold mb-4">Artigos Publicados</h3>
5757

5858
<div className="flex flex-col gap-2">
59-
{user?.posts.map((post) => (
60-
<Link to={`/posts/${post.slug}`}>
61-
<a
62-
href=""
63-
className="text-blue-400 font-semibold hover:underline"
64-
>
65-
{post.title}
66-
</a>
67-
</Link>
68-
))}
59+
{user?.posts && user.posts.length > 0 ? (
60+
user?.posts.map((post) => (
61+
<Link key={post.slug} to={`/posts/${post.slug}`}>
62+
<span className="text-blue-400 font-semibold hover:underline">
63+
{post.title}
64+
</span>
65+
</Link>
66+
))
67+
) : (
68+
<p className="text-blue-400 font-semibold">
69+
Não há artigos publicados no momento.
70+
</p>
71+
)}
6972
</div>
7073
</div>
7174
</div>
@@ -86,7 +89,7 @@ export function Profile() {
8689
target="_blank"
8790
className="hover:text-blue-400"
8891
>
89-
<Icon key={index} size={32} />
92+
<Icon size={32} />
9093
</a>
9194
)
9295
)}

vite.config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
3-
import mdx from "@mdx-js/rollup";
43

54
// https://vitejs.dev/config/
65
export default defineConfig({
7-
plugins: [react(), mdx()],
6+
plugins: [react()],
87
server: {
9-
host: '0.0.0.0',
10-
port: 5173
11-
}
8+
host: "0.0.0.0",
9+
port: 5173,
10+
},
1211
});

0 commit comments

Comments
 (0)