Skip to content
Merged
Show file tree
Hide file tree
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
199 changes: 51 additions & 148 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,173 +1,76 @@
import { A } from "@solidjs/router";
import { AiFillHome } from "solid-icons/ai";
import { OcLinkexternal2 } from "solid-icons/oc";
import { createSignal } from "solid-js";

import logo from "../assets/olympus-z-white.svg";
import { useGlobalContext } from "../context/Global";
import "../style/nav.scss";

const Nav = () => {
const { t } = useGlobalContext();
const [isMenuOpen, setIsMenuOpen] = createSignal(false);

const closeMenu = () => setIsMenuOpen(false);

return (
<div
style={{
position: "fixed",
top: 0,
left: 0,
width: "100%",
}}>
<div
style={{
position: "absolute",
left: "10px",
top: "10px",
display: "flex",
"align-items": "center",
}}>
<A
href="/"
style={{
"text-decoration": "none",
color: "inherit",
display: "flex",
"align-items": "center",
}}>
<img
src={logo}
height="30"
alt="Swaps by ZEUS LSP"
style={{ "margin-right": "8px" }}
/>
<p
class="hide-on-mobile"
style={{
"font-size": "18px",
margin: 0,
color: "#fff",
}}>
Swaps by ZEUS LSP
</p>
<div class="navbar-container">
<div class="logo-container">
<A href="/" onClick={closeMenu}>
<img src={logo} height="30" alt="Swaps by ZEUS LSP" />
<p class="hide-on-mobile">Swaps by ZEUS LSP</p>
</A>
</div>

<div
style={{
padding: "16px 0",
display: "flex",
"align-items": "center",
"justify-content": "center",
gap: "16px",
}}>
<A
href="/swap"
style={{
color: "#fff",
"text-decoration": "none",
"font-size": "18px",
}}
onMouseEnter={(e) => {
e.currentTarget.style.color = "yellow";
e.currentTarget.style.textDecoration = "underline";
}}
onMouseLeave={(e) => {
e.currentTarget.style.color = "#fff";
e.currentTarget.style.textDecoration = "none";
}}>
{t("swap")}
</A>

<div
style={{
width: "1px",
height: "20px",
"background-color": "#fff",
}}
/>
<A
href="/rescue"
style={{
color: "#fff",
"text-decoration": "none",
"font-size": "18px",
}}
onMouseEnter={(e) => {
e.currentTarget.style.color = "#efc22b";
e.currentTarget.style.textDecoration = "underline";
}}
onMouseLeave={(e) => {
e.currentTarget.style.color = "#fff";
e.currentTarget.style.textDecoration = "none";
}}>
{t("rescue")}
</A>

<div
style={{
width: "1px",
height: "20px",
"background-color": "#fff",
}}
/>
<A
href="/history"
style={{
color: "#fff",
"text-decoration": "none",
"font-size": "18px",
}}
onMouseEnter={(e) => {
e.currentTarget.style.color = "yellow";
e.currentTarget.style.textDecoration = "underline";
}}
onMouseLeave={(e) => {
e.currentTarget.style.color = "#fff";
e.currentTarget.style.textDecoration = "none";
}}>
{t("history")}
</A>
<div
style={{
width: "1px",
height: "20px",
"background-color": "#fff",
}}
/>
<A
href="https://docs.zeusln.app/swaps/intro"
class="external"
target="_blank"
style={{
color: "#fff",
"text-decoration": "none",
"font-size": "18px",
}}
onMouseEnter={(e) => {
e.currentTarget.style.color = "yellow";
e.currentTarget.style.textDecoration = "underline";
}}
onMouseLeave={(e) => {
e.currentTarget.style.color = "#fff";
e.currentTarget.style.textDecoration = "none";
}}>
<div class="desktop-nav-links">
<A href="/swap">{t("swap")}</A>
<div class="separator" />
<A href="/rescue">{t("rescue")}</A>
<div class="separator" />
<A href="/history">{t("history")}</A>
<div class="separator" />
<A href="https://docs.zeusln.app/swaps/intro" target="_blank">
{t("documentation")}
<OcLinkexternal2 size={24} />
</A>
</div>

<div style={{ position: "absolute", right: 0, top: 0 }}>
<A
href="https://olympusln.com"
style={{
"text-decoration": "none",
color: "inherit",
padding: "10px",
display: "flex",
"align-items": "center",
"justify-content": "center",
}}>
<div class="desktop-home-icon">
<A href="https://olympusln.com">
<AiFillHome size={25} color="white" />
</A>
</div>

<div
class={`hamburger-icon ${isMenuOpen() ? "active" : ""}`}
onClick={() => setIsMenuOpen(!isMenuOpen())}>
<div class="bar1"></div>

Check warning on line 47 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing

Check warning on line 47 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing
<div class="bar2"></div>

Check warning on line 48 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing

Check warning on line 48 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing
<div class="bar3"></div>

Check warning on line 49 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing

Check warning on line 49 in src/components/Nav.tsx

View workflow job for this annotation

GitHub Actions / ci

Empty components are self-closing
</div>

{isMenuOpen() && (
<div class="mobile-nav-overlay">
<A href="/swap" onClick={closeMenu}>
{t("swap")}
</A>
<A href="/rescue" onClick={closeMenu}>
{t("rescue")}
</A>
<A href="/history" onClick={closeMenu}>
{t("history")}
</A>
<A
href="https://docs.zeusln.app/swaps/intro"
target="_blank"
onClick={closeMenu}>
{t("documentation")} <OcLinkexternal2 size={24} />
</A>
<A href="https://olympusln.com" onClick={closeMenu}>
<AiFillHome size={25} color="white" /> Home
</A>
</div>
)}
</div>
);
};
Expand Down
Loading
Loading