Skip to content

Added 'Discord' link to navbar #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
InfoOutlined,
BookOutlined,
CaretDownFilled,
MenuOutlined
MenuOutlined,
DiscordOutlined
} from "@ant-design/icons";
import ToggleDarkMode from "./ToggleDarkMode";

Expand All @@ -21,7 +22,7 @@ interface NavbarProps {

function Navbar({ scrollToFooter }: NavbarProps) {
const [hovered, setHovered] = useState<
null | "home" | "explore" | "help" | "github" | "join"
null | "home" | "explore" | "help" | "github" | "join" | "discord"
>(null);
const screens = useBreakpoint();
const location = useLocation();
Expand Down Expand Up @@ -284,10 +285,14 @@ function Navbar({ scrollToFooter }: NavbarProps) {
</Link>
</div>
)}
<div style={{ display: screens.md ? "flex" : "none" }}>
<div
style={{
height: "65px",
display: "flex",
border: "1.5px solid rgba(255, 255, 255, 0.1)",
borderTop: "none",
borderBottom: "none",
alignItems: "center",
justifyContent: "center",
padding: screens.md ? "0 20px" : "0 10px",
Expand Down Expand Up @@ -320,6 +325,46 @@ function Navbar({ scrollToFooter }: NavbarProps) {
<span style={{ display: screens.md ? "inline" : "none" }}>Github</span>
</a>
</div>
<div
style={{
height: "65px",
display: "flex",
borderRight: "1.5px solid rgba(255, 255, 255, 0.1)",
borderTop: "none",
borderBottom: "none",
alignItems: "center",
justifyContent: "center",
padding: screens.md ? "0 20px" : "0 10px",
borderRadius: "5px",
borderLeft: screens.md
? "1.5px solid rgba(255, 255, 255, 0.1)"
: "none",
paddingLeft: screens.md ? 16 : 5,
paddingRight: screens.md ? 16 : 5,
backgroundColor:
hovered === "discord" ? "rgba(255, 255, 255, 0.1)" : "transparent",
cursor: "pointer",
}}
onMouseEnter={() => setHovered("discord")}
onMouseLeave={() => setHovered(null)}
>
<a
href="https://discord.com/invite/Zm99SKhhtA"
target="_blank"
rel="noopener noreferrer"
style={{ display: "flex", alignItems: "center", color: "white" }}
>
<DiscordOutlined
style={{
fontSize: "20px",
color: "white",
marginRight: screens.md ? "5px" : "0",
}}
/>
<span style={{ display: screens.md ? "inline" : "none" }}>Discord</span>
</a>
</div>
</div>
</div>
</div>
);
Expand Down
Loading