Skip to content

Commit

Permalink
use public folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cojua8 committed Jan 9, 2024
1 parent 97c8b18 commit bb7cf13
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/favicon.svg" type="image/x-icon" />
<title>Curriculum Vitae</title>
</head>
<body>
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import { library } from "@fortawesome/fontawesome-svg-core";
import { fab } from "@fortawesome/free-brands-svg-icons";
import { fas } from "@fortawesome/free-solid-svg-icons";
import { useState } from "react";
import { useEffect, useState } from "react";
import Experience from "./components/Experience";
import { FileDownloadButton } from "./components/FileDownloadButton";
import { FileUploadButton } from "./components/FileUploadButton";
import PrintButton from "./components/PrintButton";
import Sidebar from "./components/Sidebar";
import StickyButtonGroup from "./components/base/StickyButtonGroup";
import { CVData, DataContext } from "./components/contexts/DataContext";
import context_data from "./data.json";

library.add(fas, fab);

const App = () => {
const context = context_data as CVData;
const [data, setData] = useState<CVData | null>(null);

const [data, setData] = useState(context);
useEffect(() => {
fetch(`${import.meta.env.BASE_URL}data.json`)
.then((response) => response.json())
.then((data) => setData(data as CVData));
}, []);

if (!data) {
return <div>Loading...</div>;
}

return (
<div>
Expand Down

0 comments on commit bb7cf13

Please sign in to comment.