-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dropdown to apply roles in diffrent tenants
- Loading branch information
1 parent
1e3e97d
commit 7c262d4
Showing
16 changed files
with
191 additions
and
38 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,47 @@ | ||
import { useState } from "react"; | ||
import { ReactComponent as ArrowDown } from "../../../assets/arrow-down.svg"; | ||
|
||
import "./select.scss"; | ||
|
||
type SelectProps = { | ||
options: { value: string; name: string }[]; | ||
selectedOption: string; | ||
onOptionSelect: (value: string) => void; | ||
}; | ||
export default function Select({ onOptionSelect, options, selectedOption }: SelectProps) { | ||
const [showOptions, setShowOptions] = useState(false); | ||
return ( | ||
<div | ||
className="select-container" | ||
onMouseLeave={() => setShowOptions(false)} | ||
onMouseEnter={() => setShowOptions(true)}> | ||
<div className="select-action"> | ||
{selectedOption}{" "} | ||
<ArrowDown | ||
color="#000" | ||
style={{ rotate: showOptions ? "180deg" : undefined }} | ||
/> | ||
</div> | ||
{showOptions ? ( | ||
<div className="select-dropdown-wrapper"> | ||
<div className="select-dropdown"> | ||
{options.map((option) => { | ||
return ( | ||
<div | ||
className="select-item" | ||
key={option.value} | ||
onClick={(e) => { | ||
e.stopPropagation(); | ||
onOptionSelect(option.value); | ||
setShowOptions(false); | ||
}}> | ||
{option.name} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
) : null} | ||
</div> | ||
); | ||
} |
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,53 @@ | ||
.select-container { | ||
position: relative; | ||
cursor: pointer; | ||
|
||
.select-action { | ||
display: flex; | ||
width: 210px; | ||
height: 36px; | ||
padding: 9px 13px; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 10px; | ||
flex-shrink: 0; | ||
|
||
border-radius: 6px; | ||
border: 1px solid #e5e5e5; | ||
background: #fff; | ||
|
||
color: #222; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
} | ||
.select-dropdown-wrapper { | ||
padding-top: 5px; | ||
z-index: 5; | ||
position: absolute; | ||
width: 100%; | ||
|
||
.select-dropdown { | ||
background: #fff; | ||
border-radius: 6px; | ||
background: #fff; | ||
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.16); | ||
|
||
.select-item { | ||
cursor: pointer; | ||
padding: 12px; | ||
color: #222; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
|
||
&:hover { | ||
background: #f0f0f0; | ||
width: 100%; | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.