aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-26 21:28:29 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-26 21:28:29 +0100
commit6682690a1c8a05bcffc24bcef3c89a14c1762d85 (patch)
tree1c02b2df5f0678853cd4979125e03e65b7a66501 /components
parent12b41df69ad0bb3e2697071d55e9023026a0c59a (diff)
image and button components
Diffstat (limited to 'components')
-rw-r--r--components/button.tsx9
-rw-r--r--components/image.tsx13
2 files changed, 22 insertions, 0 deletions
diff --git a/components/button.tsx b/components/button.tsx
new file mode 100644
index 0000000..452d85f
--- /dev/null
+++ b/components/button.tsx
@@ -0,0 +1,9 @@
+export default function Button(props: {
+ text: string;
+ href?: string;
+ onclick?: () => void;
+}) {
+ return props.href ?
+ <a href={props.href} className="button">{props.text}</a> :
+ <button onClick={props.onclick} className="button">{props.text}</button>
+}
diff --git a/components/image.tsx b/components/image.tsx
new file mode 100644
index 0000000..106c2bd
--- /dev/null
+++ b/components/image.tsx
@@ -0,0 +1,13 @@
+export default function Image(props: {
+ src: string;
+ title?: string;
+}) {
+ return <div className="image">
+ <img src={props.src} alt={props.title}/>
+ {
+ props.title && <div>
+ <p>{props.title}</p>
+ </div>
+ }
+ </div>
+}