Added width props to modal component
This commit is contained in:
parent
62aa74b0c4
commit
103cc53155
1 changed files with 4 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ interface Props {
|
|||
border?: string
|
||||
opacity?: number
|
||||
trigger: boolean
|
||||
width?: string
|
||||
}
|
||||
|
||||
export default (props: Props) => {
|
||||
|
|
@ -17,18 +18,18 @@ export default (props: Props) => {
|
|||
<Show when={props.trigger}>
|
||||
<div class="modal">
|
||||
<Show when={props.border}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; border: 2px solid ${props.border}; opacity: ${props.opacity || 1}`}>
|
||||
<div class="modal__content" style={`background-color: ${props.background}; color: ${props.color}; border: 2px solid ${props.border}; opacity: ${props.opacity || 1}; width: ${props.width || 'auto'}`}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<Show when={!props.border}>
|
||||
<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)`}>
|
||||
<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); width: ${props.width || 'auto'}`}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
</Show >
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue