Skip to content

Commit 7ac38a9

Browse files
feat: setup tailwind
1 parent 6ead515 commit 7ac38a9

34 files changed

+555365
-254
lines changed

frontend/containers/LandingPage/index.tsx

-63
This file was deleted.

frontend/containers/Routes/index.tsx

-38
This file was deleted.

frontend/hooks/index.ts

-4
This file was deleted.

frontend/hooks/useScrollPosition.ts

-54
This file was deleted.

frontend/index.tsx

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
import React from "react";
2-
import dayjs from "dayjs";
3-
import LocalizedFormat from "dayjs/plugin/localizedFormat";
42
import { createRoot } from "react-dom/client";
5-
import { BrowserRouter } from "react-router-dom";
6-
import { Routes } from "./containers/Routes";
3+
import { Root } from "./lib";
74

8-
dayjs.extend(LocalizedFormat);
5+
const container = document.getElementById("root");
96

10-
const Root: React.FC = () => {
11-
return (
12-
<BrowserRouter>
13-
<Routes />
14-
</BrowserRouter>
15-
);
16-
};
7+
if (!container) {
8+
throw new Error("Container not found");
9+
}
1710

18-
const container = document.getElementById("root");
1911
const root = createRoot(container);
2012
root.render(<Root />);

frontend/lib/api/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./types";
2+
export * from "./utils";
3+
export * from "./use-api";

frontend/lib/api/types.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
interface ITextBlock {
2+
title: string;
3+
body: string;
4+
description?: string;
5+
}
6+
7+
export interface IPublication extends ITextBlock {
8+
slug: string;
9+
created_at: string;
10+
tag: string[];
11+
image: string;
12+
image_description: string;
13+
}
14+
15+
export interface IGetPaginatedPublicationsResponse {
16+
count: number;
17+
current_page: number;
18+
total_pages: number;
19+
next: string | null;
20+
previous: string | null;
21+
results: IPublication[];
22+
}

frontend/hooks/useApi.ts renamed to frontend/lib/api/use-api.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import {
2-
IGetPaginatedPublicationsResponse,
3-
IPublication,
42
getPaginatedPublicationsEndpoint,
53
getPublicationsEndpoint,
64
getPublicationEndpoint,
75
getFilteredPublicationsEndoint,
86
getPaginatedFilteredPublicationsEndoint,
9-
} from "../utils/api";
7+
} from "./utils";
108
import { getSecrets } from "../config";
9+
import type { IGetPaginatedPublicationsResponse, IPublication } from "./types";
1110

1211
const { NODE_ENV, AUTH_TOKEN } = getSecrets();
1312

frontend/utils/api.ts renamed to frontend/lib/api/utils.ts

-23
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
interface ITextBlock {
2-
title: string;
3-
body: string;
4-
description?: string;
5-
}
6-
7-
export interface IPublication extends ITextBlock {
8-
slug: string;
9-
created_at: string;
10-
tag: string[];
11-
image: string;
12-
image_description: string;
13-
}
14-
15-
export interface IGetPaginatedPublicationsResponse {
16-
count: number;
17-
current_page: number;
18-
total_pages: number;
19-
next: string | null;
20-
previous: string | null;
21-
results: IPublication[];
22-
}
23-
241
export function getFilteredPublicationsEndoint(
252
args: {
263
title: string;

frontend/containers/LandingPage/BlogSection/index.tsx renamed to frontend/lib/components/blog-section.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { useState, useEffect } from "react";
2-
import { IPublication } from "../../../utils/api";
3-
import { useRouter } from "../../../hooks/useRouter";
4-
import { ROUTES } from "../../../routes";
5-
import { useDebounce, useApi } from "../../../hooks";
6-
import { getSecrets } from "../../../config";
2+
import { getSecrets } from "../config";
3+
import { type IPublication, useApi } from "../api";
4+
import { useDebounce } from "../hooks";
5+
import { ROUTES, useRouter } from "../routes";
76

87
interface IProps {
98
data: IPublication[] | undefined;
@@ -54,7 +53,7 @@ export const BlogSection: React.FC<IProps> = ({ data: blogCarouselData }) => {
5453
maxWidth: 1124,
5554
}}
5655
>
57-
<div>Título</div>
56+
<div>Blog</div>
5857
{data && data.length > 0 && (
5958
<input
6059
placeholder={"Search"}
File renamed without changes.

frontend/lib/hooks/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./use-debounce";
File renamed without changes.

0 commit comments

Comments
 (0)