File size: 1,572 Bytes
5470817
 
 
4a90775
 
81702ec
5470817
 
81702ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5470817
81702ec
 
 
 
 
5470817
 
4a90775
 
5470817
4a90775
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5470817
 
 
4a90775
 
fd164b2
5470817
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React from "react";
import { Link } from "react-router-dom";
import { Box } from "@mui/material";
import logoText from "../../assets/logo-text.svg";
import gradient from "../../assets/gradient.svg";
import { useLeaderboard } from "../../context/LeaderboardContext";

const Logo = () => {
  const {
    setSearchQuery,
    setArenaOnly,
    setSelectedCategory,
    setSelectedLanguage,
    setExpandedSections,
  } = useLeaderboard();

  const handleReset = (e) => {
    e.preventDefault();
    setSearchQuery("");
    setArenaOnly(false);
    setSelectedCategory(null);
    setSelectedLanguage(null);
    setExpandedSections(new Set());
    window.history.pushState({}, "", window.location.pathname);
  };

  return (
    <Link
      to="/"
      onClick={handleReset}
      style={{ textDecoration: "none", position: "relative" }}
    >
      <Box
        component="img"
        src={gradient}
        alt=""
        sx={{
          position: "absolute",
          width: "150%",
          height: "auto",
          top: "50%",
          left: "50%",
          transform: "translate(-50%, -50%)",
          zIndex: 0,
          opacity: 1,
        }}
      />
      <Box
        component="img"
        src={logoText}
        alt="Leaderboards on the Hub"
        sx={{
          height: 110,
          width: "auto",
          display: "block",
          margin: "0 auto",
          position: "relative",
          zIndex: 1,
          opacity: (theme) => (theme.palette.mode === "dark" ? 0.8 : 1),
        }}
      />
    </Link>
  );
};

export default Logo;