This commit is contained in:
Patrick Alvin Alcala 2025-06-03 15:54:18 +08:00
parent 4f9d7c3fd5
commit 925cd19315
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,14 @@
@use '/src/styles/variables.sass' as vars
.button
background-color: #5e825f
border: none
border-radius: 4px
color: white
padding: 1rem 2rem
text-align: center
text-decoration: none
display: inline-block
font-size: 16px
margin: 4px 2px
cursor: pointer

View file

@ -0,0 +1,17 @@
import './Button.sass'
import { Show } from 'solid-js'
export default (props: { label?: string; to?: string; onClick?: () => void; }) => {
return <>
<Show when={props.to}>
<a href={props.to} aria-label={props.label}>
<button class="button">{props.label || 'Click Me!'}</button>
</a>
</Show>
<Show when={!props.to}>
<button class="button" onClick={props.onClick}>{props.label || 'Click Me!'}</button>
</Show>
</>
}