1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
import { CSSProperties, ReactNode } from "react";
interface VierkantProps {
href?: string;
width?: string;
height?: string;
style?: CSSProperties;
children?: ReactNode;
}
export function Vierkant(props: VierkantProps) {
return <a style={{
padding: 24,
backgroundColor: "var(--background)",
borderRadius: 8,
color: "var(--text)",
margin: 6, // geen margin collapse = 12px marge
display: "inline-block",
position: "relative",
boxSizing: "border-box",
width: props.width ? props.width : undefined,
height: props.height ? props.height : undefined,
...props.style
}} href={props.href}>{props.children}</a>
}
interface ButtonProps {
text?: string;
children?: ReactNode;
style?: CSSProperties;
onclick?: (() => void);
}
export function Button(props: ButtonProps) {
return <div onClick={props.onclick} style={{
padding: props.text ? 8 : 16,
textAlign: props.text ? "center" : "left",
borderRadius: 8,
backgroundColor: "var(--disk-a)",
cursor: "pointer",
position: "relative",
...props.style
}}>
{
props.text ?
<span style={{
fontWeight: 600,
userSelect: "none"
}}>{props.text}</span>
: undefined
}
{ props.children }
</div>;
}
|