Added modal opacity
This commit is contained in:
parent
8f8735ccce
commit
26cf7a74a2
2 changed files with 4 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ interface Props {
|
|||
color?: string
|
||||
border?: string
|
||||
trigger: boolean
|
||||
opacity?: number
|
||||
}
|
||||
|
||||
export default (props: Props) => {
|
||||
|
|
@ -34,13 +35,13 @@ export default (props: Props) => {
|
|||
<Show when={props.trigger}>
|
||||
<div class="modal" ref={dialogRef} onClick={closeHandler}>
|
||||
<Show when={props.border}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; border: 2px solid ${props.border}`}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; border: 2px solid ${props.border}; opacity: ${props.opacity || 1}`}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<Show when={!props.border}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; box-shadow: 5px 4px 6px rgba(0, 0, 0, 0.5)`}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; opacity: ${props.opacity || 1}; box-shadow: 5px 4px 6px rgba(0, 0, 0, 0.5)`}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Show>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue