-
diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx
index c3bb8c6..ce26803 100644
--- a/src/pages/HomePage.tsx
+++ b/src/pages/HomePage.tsx
@@ -1,7 +1,6 @@
import "../style/home/home.css"
// import AccountSvg from "../assets/account.svg?react"
-import { Header } from "./template/Header"
import { BASE } from "../Constants"
import { getSession } from "../api/session.ts"
import { fetchAPIGet, redirect } from "../Fetcher.ts"
@@ -26,7 +25,7 @@ interface Team {
export default function HomePage() {
type UserDataResponse = {user?: User, tactics: Tactic[], teams: Team[]}
- const [{ user, tactics, teams }, setInfo] = useState({tactics: [], teams: []})
+ const [{tactics, teams }, setInfo] = useState({tactics: [], teams: []})
useLayoutEffect(() => {
@@ -46,26 +45,21 @@ export default function HomePage() {
}, [])
- console.log(user)
-
const lastTactics = tactics!.sort((a, b) => a.creationDate.getMilliseconds() - b.creationDate.getMilliseconds()).slice(0, 5)
- return
+ return
}
function Home({
lastTactics,
allTactics,
teams,
- username,
}: {
lastTactics: Tactic[]
allTactics: Tactic[]
teams: Team[]
- username: string
}) {
return (
-
{
+ async function getUsername() {
+ const response = await fetchAPIGet("user", getSession())
+ //TODO check if the response is ok and handle errors
+ const {name} = await response.json()
+ setUsername(name)
+ }
+
+ getUsername()
+ }, [])
+
return (
-
{ location.pathname = BASE + "/" }}> - IQ - Ball -
+ IQBall +
diff --git a/src/style/home/home.css b/src/style/home/home.css
index 0c4ecf7..bc1bf4a 100644
--- a/src/style/home/home.css
+++ b/src/style/home/home.css
@@ -5,7 +5,9 @@
body {
/* background-color: #303030; */
+ overflow-x: hidden;
}
+
#main {
/* margin-left : 10%;
margin-right: 10%; */
diff --git a/src/style/template/header.css b/src/style/template/header.css
index 266b8c8..e0fb2c5 100644
--- a/src/style/template/header.css
+++ b/src/style/template/header.css
@@ -1,49 +1,49 @@
#header {
text-align: center;
background-color: var(--home-main-color);
- margin: 0px;
- /* border : var(--accent-color) 1px solid; */
+ margin: 0;
display: flex;
flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+
font-family: var(--font-title);
- /* border-radius: 0.75cap; */
+
+ height: 50px;
}
#img-account {
- width: 100%;
cursor: pointer;
}
-#header-right,
-#header-left {
- width: 10%;
- /* border: yellow 2px solid; */
+#header-left, #header-right, #header-center {
+ width: 100%;
}
#header-right {
display: flex;
flex-direction: column;
justify-content: center;
- align-items: center;
+ align-items: end;
}
#username {
color: var(--main-contrast-color);
- margin: 0;
+ margin-left: 10px;
}
#clickable-header-right:hover #username {
color: var(--accent-color);
}
-#header-center {
- width: 80%;
-}
-
#clickable-header-right {
- width: 40%;
border-radius: 1cap;
padding: 2%;
+
+ margin-right: 20px;
+ display: flex;
+ align-items: center;
+ justify-content: space-evenly;
}
#clickable-header-right:hover {
@@ -54,12 +54,10 @@
cursor: pointer;
}
-#img-account {
- width: 100%;
-}
-
#iqball {
+ margin: 0;
color: var(--accent-color);
font-weight: bold;
- font-size: 45px;
+ font-size: 35px;
}
+