Skip to content

Commit 0207506

Browse files
authored
Merge pull request #1 from dlmarques/develop
MVP 1
2 parents 95c99e7 + 5f7d122 commit 0207506

File tree

12 files changed

+862
-507
lines changed

12 files changed

+862
-507
lines changed

LICENSE

Lines changed: 663 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 474 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "my-app",
33
"private": true,
44
"type": "module",
5+
"license": "AGPL-3.0",
56
"scripts": {
67
"start": "vite --port 3000",
78
"build": "vite build && tsc",

src/features/about/index.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const About = () => {
2+
return (
3+
<div style={{ display: "flex", flexDirection: "column", gap: "64px" }}>
4+
<h1 style={{ textAlign: "center" }}>Learn in 5 minutes</h1>
5+
<div>
6+
<p>
7+
Learn in 5 minutes is a simple AI powered project, the purpose is
8+
generate a new Computer Science/Programming concept everyday and
9+
provide a simple and catchy explanation.
10+
</p>
11+
</div>
12+
<div>
13+
<p>
14+
5 minutes of your day, while you drink a coffee, while you wait for a
15+
deploy, while you wait for massive packages installation, only 5
16+
minutes from your day it will be enough to learn something new or
17+
refresh your memory from forgot concepts.
18+
</p>
19+
</div>
20+
</div>
21+
);
22+
};
23+
24+
export default About;

src/features/topic/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ const Topic = () => {
1111
isError,
1212
isLoading,
1313
} = useQuery({
14-
queryKey: ["todos"],
14+
queryKey: ["topics"],
1515
queryFn: getTopic,
1616
});
1717

1818
if (isLoading) return <div>loading...</div>;
1919

20+
// TODO - handle error
2021
if (isError) return <div>Error</div>;
2122

2223
const topic = response?.data.content;

src/main.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) 2025 Daniel Marques
2+
// Licensed under the GNU AGPL v3. See LICENSE.
3+
14
import { StrictMode, Suspense } from "react";
25
import ReactDOM from "react-dom/client";
36
import {

src/pages/About.tsx

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1+
import Footer from "@/shared/components/footer";
12
import React from "react";
23

3-
// TODO - simple about
4-
const About = () => {
5-
return <div>About</div>;
4+
const About = React.lazy(() => import("../features/about"));
5+
6+
const AboutPage = () => {
7+
return (
8+
<main
9+
style={{
10+
padding: "32px",
11+
maxHeight: "100vh",
12+
display: "flex",
13+
justifyContent: "center",
14+
overflowY: "auto",
15+
overflowX: "hidden",
16+
}}
17+
>
18+
<div
19+
style={{
20+
width: "50vw",
21+
}}
22+
>
23+
<About />
24+
<Footer />
25+
</div>
26+
</main>
27+
);
628
};
729

8-
export default About;
30+
export default AboutPage;

src/pages/Topic.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Footer from "@/shared/components/footer";
12
import React from "react";
23

34
const Topic = React.lazy(() => import("../features/topic"));
@@ -20,6 +21,7 @@ const TopicPage = () => {
2021
}}
2122
>
2223
<Topic />
24+
<Footer />
2325
</div>
2426
</main>
2527
);

src/shared/components/code-example/index.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FaJava, FaJs, FaPython, FaPhp } from "react-icons/fa";
33
import { TbBrandCSharp } from "react-icons/tb";
44
import { SiCplusplus, SiTypescript } from "react-icons/si";
55
import { CodeBlock } from "react-code-block";
6-
import type { TopicExample } from "@/types/Topic";
6+
import { Languages, type TopicExample } from "@/types/Topic";
77

88
const ProgrammingLanguagesTabs = [
99
{ lang: "JavaScript", icon: <FaJs /> },
@@ -17,7 +17,10 @@ const ProgrammingLanguagesTabs = [
1717

1818
const CodeExample = ({ examples }: { examples: TopicExample[] }) => {
1919
return (
20-
<Card.Root size="sm" style={{ background: "#222222" }}>
20+
<Card.Root
21+
size="sm"
22+
style={{ background: "#222222", overflowX: "auto", padding: "0 8px" }}
23+
>
2124
<Tabs.Root defaultValue={examples[0].language} variant="plain">
2225
<Tabs.List>
2326
{ProgrammingLanguagesTabs.filter((tab) => {
@@ -37,7 +40,10 @@ const CodeExample = ({ examples }: { examples: TopicExample[] }) => {
3740
{examples.map((example) => {
3841
return (
3942
<Tabs.Content value={example.language}>
40-
<CodeBlock code={`${example.code}`} language="python">
43+
<CodeBlock
44+
code={`${example.code}`}
45+
language={Languages[example.language]}
46+
>
4147
<CodeBlock.Code style={{ padding: "16px" }}>
4248
<CodeBlock.LineContent>
4349
<CodeBlock.Token />
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Link, useLocation } from "@tanstack/react-router";
2+
3+
const Footer = ({ customStyles }: { customStyles?: React.CSSProperties }) => {
4+
const { pathname } = useLocation();
5+
return (
6+
<div
7+
style={{
8+
display: "flex",
9+
flexDirection: "column",
10+
alignItems: "center",
11+
paddingTop: "16px",
12+
...customStyles,
13+
}}
14+
>
15+
{pathname === "/" && (
16+
<Link to="/about">
17+
<p>Click here to visit about page</p>
18+
</Link>
19+
)}
20+
{pathname === "/about" && (
21+
<Link to="/">
22+
<p>Click here to visit topic page</p>
23+
</Link>
24+
)}
25+
<p style={{ fontSize: "14px" }}>@2025 dlmarques</p>
26+
</div>
27+
);
28+
};
29+
30+
export default Footer;

0 commit comments

Comments
 (0)