mirror of
https://github.com/UiO-Gaming/uiogaming.no.git
synced 2026-11-05 13:56:47 +01:00
Use real links in the "Other" dropdown
The items were buttons calling window.open() without noopener, which let the opened page access window.opener. Links also support middle-click and show the URL on hover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c997b74d01
commit
d04afb3e0c
2 files changed
+10
-7
No files matched your search
@@ -36,7 +36,8 @@
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.dropdownButton {
|
||||
.dropdownLink {
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: black;
|
||||
background-color: #cccccc;
|
||||
@@ -52,7 +53,7 @@
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
.dropdownButton:hover {
|
||||
.dropdownLink:hover {
|
||||
color: black;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,16 @@ const OtherButton = () => {
|
||||
{isOpen && (
|
||||
<div className={styles.dropdown}>
|
||||
{links.map((link, index) => (
|
||||
<button
|
||||
key={index}
|
||||
onClick={() => window.open(link.url, "_blank")}
|
||||
className={styles.dropdownButton}
|
||||
<a
|
||||
key={link.url}
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={styles.dropdownLink}
|
||||
style={{ marginTop: index === 0 ? "8px" : "4px" }}
|
||||
>
|
||||
{link.label}
|
||||
</button>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user