Files
uiogaming.no/src/components/items/otherButton.js
T
leander 0a3894e14d temporarily remove english translation
the site would not build due to some weird issue I have yet to figure
out. temporarily removing all english translations fixes it however. I
am probably migrating the site away from gatsby anyway so a temp fix is
fine
2025-07-22 02:05:19 +02:00

41 lines
1.1 KiB
JavaScript

import * as React from "react"
import * as styles from "./otherButton.module.css"
import { useState } from "react"
const OtherButton = () => {
const [isOpen, setIsOpen] = useState(false)
const toggleDropdown = () => setIsOpen(!isOpen)
const links = [
{ url: "https://vedtekter.uiogaming.no", label: "Vedtekter" },
{ url: "https://klage.uiogaming.no", label: "Klage" },
{ url: "https://github.com/UiO-Gaming/dokumenter", label: "Dokumenter" },
]
return (
<div>
<button onClick={toggleDropdown} className={styles.button}>
Annet{" "}
<span className={isOpen ? styles.arrowUp : styles.arrowDown}></span>
</button>
{isOpen && (
<div className={styles.dropdown}>
{links.map((link, index) => (
<button
key={index}
onClick={() => window.open(link.url, "_blank")}
className={styles.dropdownButton}
style={{ marginTop: index === 0 ? "8px" : "4px" }}
>
{link.label}
</button>
))}
</div>
)}
</div>
)
}
export default OtherButton