mirror of
https://github.com/UiO-Gaming/uiogaming.no.git
synced 2026-11-05 13:56:47 +01:00
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
41 lines
1.1 KiB
JavaScript
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
|