Skip to content

Commit

Permalink
fix app layout
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelomota committed Feb 19, 2024
1 parent d8c5b22 commit f422934
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
14 changes: 14 additions & 0 deletions backend/.firebase/hosting.cHVibGlj.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
asset-manifest.json,1707701048153,b5c436bdc34cc342c651c0787d531208a5a151e708f2215c10b7d7eac3d15e42
index.html,1707701048153,70309e2e31ed013820eb1622639d3b37649dae876d2f32d1176dee1c51761486
favicon.ico,1707701039653,b72f7455f00e4e58792d2bca892abb068e2213838c0316d6b7a0d6d16acd1955
robots.txt,1707701039654,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
logo192.png,1707701039654,caff018b7f1e8fd481eb1c50d75b0ef236bcd5078b1d15c8bb348453fee30293
static/css/main.f855e6bc.css,1707701048167,b61eb3bbf7dd6148bab9cf577b732df73faa394d9b8bacb8422e10fa90ffa46e
static/css/main.f855e6bc.css.map,1707701048167,22280b0c507a9b42de44c6d2601519ed3675fa26db7b6de124a4a8999d95d5be
static/js/592.bf6ca574.chunk.js,1707701048168,9cbb782c7c3465940b628e2bc264cd06b0d4b9c9354f9312a7c5c188c3061251
logo512.png,1707701039654,191fc21360b4ccfb1cda11a1efb97f489ed22672ca83f4064316802bbfdd750e
static/js/main.f3d14467.js.LICENSE.txt,1707701048167,464657798dcdad2f37b2c87a4c96315be1a01694fe3fe78be6a7a808e49fc5aa
manifest.json,1707701039654,341d52628782f8ac9290bbfc43298afccb47b7cbfcee146ae30cf0f46bc30900
static/js/592.bf6ca574.chunk.js.map,1707701048168,09bac0466318d1599102d33898aa172ad0d4e5ed2a2d9ae72986cb49e3af2de7
static/js/main.f3d14467.js,1707701048167,625b8b409488e25257d90eb6b68e90d0bddcb8cfe6279334e65f1b2a734b26e6
static/js/main.f3d14467.js.map,1707701048168,0270ffbeae0bb881f7c961c89933c69800205bcc6706104e6205601c485d13a4
20 changes: 6 additions & 14 deletions frontend/src/context/TargetContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,12 @@ export interface TargetProps {
entries?: Entry[];
}

const userId = "ZR9MbNxPj6CfaoHgnXoq";

export const TargetContextProvider: React.FC<React.PropsWithChildren> = ({
children,
}) => {
const [targets, setTargets] = useState<TargetProps[]>(
localStorage.getItem("targets")
? JSON.parse(localStorage.getItem("targets")!)
: []
);

const userId = "ZR9MbNxPj6CfaoHgnXoq";

const addTarget = (target: Target) => {
// add target to firestore database
addDoc(collection(db, "users/" + userId + "/targets"), target);
};
const [targets, setTargets] = useState<TargetProps[]>([]);

const getTargetById = useCallback(
(id: number) => {
Expand All @@ -74,11 +65,12 @@ export const TargetContextProvider: React.FC<React.PropsWithChildren> = ({
const contextValue = useMemo(
() => ({
targets,
addTarget,
addTarget: (target: Omit<TargetProps, "id">) =>
addDoc(collection(db, "users/" + userId + "/targets"), target),
getTargetById,
incrementEntry,
}),
[addTarget, targets, getTargetById, incrementEntry]
[targets, getTargetById, incrementEntry]
);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Breadcrumb, Layout, Menu, theme } from "antd";
import { AimOutlined, HomeOutlined } from "@ant-design/icons";
import { Outlet, useNavigate } from "react-router-dom";
import { Outlet } from "react-router-dom";

const { Header, Content, Footer } = Layout;

Expand Down

0 comments on commit f422934

Please sign in to comment.