Edited button component
This commit is contained in:
parent
3905923985
commit
d0652e52a5
2 changed files with 20 additions and 17 deletions
|
|
@ -4,13 +4,13 @@
|
||||||
.button
|
.button
|
||||||
background: vars.$primaryColor
|
background: vars.$primaryColor
|
||||||
border: none
|
border: none
|
||||||
border-radius: 16px
|
border-radius: 32px
|
||||||
color: white
|
color: white
|
||||||
padding: 0.5rem 1.25rem
|
padding: 0.5rem 1.25rem
|
||||||
text-align: center
|
text-align: center
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
display: inline-block
|
display: inline-block
|
||||||
font-size: 0.75rem
|
font-size: 1rem
|
||||||
font-weight: 700
|
font-weight: 700
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
transition: all 0.2s ease-out
|
transition: all 0.2s ease-out
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,25 @@ import './Button.sass'
|
||||||
import { Show } from 'solid-js'
|
import { Show } from 'solid-js'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label?: string;
|
label?: string
|
||||||
to?: string;
|
to?: string
|
||||||
onClick?: () => void;
|
onClick?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
return
|
return (
|
||||||
<>
|
<>
|
||||||
<Show when={props.to}>
|
<Show when={props.to}>
|
||||||
<a href={props.to} aria-label={props.label}>
|
<a href={props.to} aria-label={props.label}>
|
||||||
<button class="button">{props.label || 'Click Me!'}</button>
|
<button class="button">{props.label || 'Click Me!'}</button>
|
||||||
</a>
|
</a>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={!props.to}>
|
<Show when={!props.to}>
|
||||||
<button class="button" onClick={props.onClick}>{props.label || 'Click Me!'}</button>
|
<button class="button" onClick={props.onClick}>
|
||||||
</Show>
|
{props.label || 'Click Me!'}
|
||||||
</>
|
</button>
|
||||||
}
|
</Show>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue