updated
This commit is contained in:
parent
4f9d7c3fd5
commit
925cd19315
2 changed files with 31 additions and 0 deletions
14
src/components/ButtonComponent/Button.sass
Normal file
14
src/components/ButtonComponent/Button.sass
Normal 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
|
||||
17
src/components/ButtonComponent/Button.tsx
Normal file
17
src/components/ButtonComponent/Button.tsx
Normal 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>
|
||||
|
||||
</>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue