-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35423 Add Results tab to Generic Molecular Analysis
- Implemented Action button and column
- Loading branch information
1 parent
ba07c83
commit 81f5f06
Showing
6 changed files
with
167 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* SettingsButton Container */ | ||
.settings-button-container { | ||
position: relative; /* Make this the positioning context for the dropdown menu */ | ||
display: flex; | ||
justify-content: center; /* Center horizontally */ | ||
align-items: center; /* Center vertically */ | ||
height: 100%; /* Ensures full height for proper vertical alignment */ | ||
} | ||
|
||
.settings-container { | ||
position: relative; | ||
display: inline-block; | ||
} | ||
|
||
/* SettingsButton */ | ||
.settings-button { | ||
border: none; | ||
cursor: pointer; | ||
font-size: 20px; | ||
background: grey; /* Grey background */ | ||
color: white; /* White ellipsis */ | ||
border-radius: 5px; /* Round borders */ | ||
} | ||
|
||
.settings-button:focus { | ||
outline: none; | ||
} | ||
|
||
.settings-button:hover { | ||
background: darkgray; /* Color change on hover */ | ||
} | ||
|
||
/* SettingsButton menu*/ | ||
.settings-dropdown-menu { | ||
position: absolute; | ||
background: white; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
z-index: 9500; | ||
margin-top: 4px; /* Slight gap below the button */ | ||
width: 12rem; | ||
} | ||
|
||
/* SettingsButton dropdown item*/ | ||
.settings-dropdown-item { | ||
display: block; | ||
width: 100%; | ||
padding: 8px 16px; | ||
text-align: left; | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
z-index: 9500; | ||
} | ||
|
||
.settings-dropdown-item:hover { | ||
background: #f0f0f0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React, { useState, useRef } from "react"; | ||
import "./SettingsButton.css"; // For styling | ||
|
||
interface SettingsButtonProps { | ||
menuItems: JSX.Element[]; | ||
} | ||
|
||
export function SettingsButton({ menuItems }: SettingsButtonProps) { | ||
const [menuOpen, setMenuOpen] = useState(false); | ||
const menuRef = useRef<HTMLDivElement>(null); | ||
|
||
// Close the menu if clicked outside | ||
const handleClickOutside = (event) => { | ||
if (menuRef.current && !menuRef.current.contains(event.target)) { | ||
setMenuOpen(false); | ||
} | ||
}; | ||
|
||
React.useEffect(() => { | ||
document.addEventListener("mousedown", handleClickOutside); | ||
return () => { | ||
document.removeEventListener("mousedown", handleClickOutside); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="settings-container" ref={menuRef}> | ||
<button | ||
className="settings-button" | ||
onClick={() => setMenuOpen((prev) => !prev)} | ||
> | ||
⋮ {/* Unicode for vertical ellipsis */} | ||
</button> | ||
{menuOpen && ( | ||
<div className="settings-dropdown-menu"> | ||
{menuItems.map((element, index) => { | ||
return ( | ||
<div className="settings-dropdown-item" key={index}> | ||
{element} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default SettingsButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters