Update logo
Browse files
frontend/public/YaleUniLogo.svg
ADDED
|
frontend/src/components/Logo/Logo.js
CHANGED
@@ -5,76 +5,55 @@ import HFLogo from "./HFLogo";
|
|
5 |
import { useLeaderboard } from "../../pages/LeaderboardPage/components/Leaderboard/context/LeaderboardContext";
|
6 |
|
7 |
const Logo = ({ height = "40px" }) => {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
-
<Box
|
31 |
-
onClick={handleReset}
|
32 |
-
sx={{
|
33 |
-
height,
|
34 |
-
display: "flex",
|
35 |
-
alignItems: "center",
|
36 |
-
justifyContent: "center",
|
37 |
-
cursor: "pointer",
|
38 |
-
transition: "opacity 0.2s ease",
|
39 |
-
"&:hover": {
|
40 |
-
opacity: 0.8,
|
41 |
-
},
|
42 |
-
}}
|
43 |
-
>
|
44 |
<Box
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
<Box
|
69 |
-
component="img"
|
70 |
-
src="/airclogo.png"
|
71 |
-
sx={{
|
72 |
-
height: 80,
|
73 |
-
mx: 2,
|
74 |
-
}}
|
75 |
-
/>
|
76 |
-
</Box>
|
77 |
-
);
|
78 |
};
|
79 |
|
80 |
export default Logo;
|
|
|
5 |
import { useLeaderboard } from "../../pages/LeaderboardPage/components/Leaderboard/context/LeaderboardContext";
|
6 |
|
7 |
const Logo = ({ height = "40px" }) => {
|
8 |
+
const navigate = useNavigate();
|
9 |
+
const [searchParams, setSearchParams] = useSearchParams();
|
10 |
+
const location = useLocation();
|
11 |
+
const { actions } = useLeaderboard();
|
12 |
|
13 |
+
const handleReset = () => {
|
14 |
+
// Reset all leaderboard state first
|
15 |
+
actions.resetAll();
|
16 |
|
17 |
+
// Then clean URL in one go
|
18 |
+
if (
|
19 |
+
location.pathname !== "/" ||
|
20 |
+
searchParams.toString() !== "" ||
|
21 |
+
location.hash !== ""
|
22 |
+
) {
|
23 |
+
window.history.replaceState(null, "", "/");
|
24 |
+
navigate("/", { replace: true, state: { skipUrlSync: true } });
|
25 |
+
setSearchParams(
|
26 |
+
{},
|
27 |
+
{ replace: true, state: { skipUrlSync: true } }
|
28 |
+
);
|
29 |
+
}
|
30 |
+
};
|
31 |
|
32 |
+
return (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<Box
|
34 |
+
onClick={handleReset}
|
35 |
+
sx={{
|
36 |
+
height,
|
37 |
+
display: "flex",
|
38 |
+
alignItems: "center",
|
39 |
+
justifyContent: "center",
|
40 |
+
cursor: "pointer",
|
41 |
+
transition: "opacity 0.2s ease",
|
42 |
+
"&:hover": {
|
43 |
+
opacity: 0.8,
|
44 |
+
},
|
45 |
+
}}
|
46 |
+
>
|
47 |
+
<Box
|
48 |
+
component="img"
|
49 |
+
src="/YaleUniLogo.svg"
|
50 |
+
sx={{
|
51 |
+
height: 60,
|
52 |
+
mx: 2,
|
53 |
+
}}
|
54 |
+
/>
|
55 |
+
</Box>
|
56 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
};
|
58 |
|
59 |
export default Logo;
|