From 6682690a1c8a05bcffc24bcef3c89a14c1762d85 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 26 Mar 2021 21:28:29 +0100 Subject: image and button components --- components/button.tsx | 9 +++++++++ components/image.tsx | 13 +++++++++++++ pages/_app.tsx | 2 ++ pages/index.tsx | 5 +++++ styles/button.css | 25 +++++++++++++++++++++++++ styles/image.css | 16 ++++++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 components/button.tsx create mode 100644 components/image.tsx create mode 100644 styles/button.css create mode 100644 styles/image.css 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 ? + {props.text} : + +} 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
+ {props.title}/ + { + props.title &&
+

{props.title}

+
+ } +
+} diff --git a/pages/_app.tsx b/pages/_app.tsx index f0c16f4..1e9ba0d 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,6 +4,8 @@ import '../styles/colors.css'; import '../styles/layout.css'; import '../styles/globals.css'; import '../styles/navbarItem.css'; +import '../styles/button.css'; +import '../styles/image.css'; export default function Blog({ Component, pageProps }) { return
diff --git a/pages/index.tsx b/pages/index.tsx index 6450fd8..18e09fe 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,7 @@ import Seperator from '../components/articleSeperator'; import Navbar from '../components/navbar'; +import Button from '../components/button'; +import Image from '../components/image'; export default function Home() { return
@@ -16,6 +18,9 @@ export default function Home() { Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Gravida dictum fusce ut placerat orci nulla pellentesque. Laoreet id donec ultrices tincidunt arcu. Tortor aliquam nulla facilisi cras fermentum odio eu feugiat. A scelerisque purus semper eget duis at tellus. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Arcu bibendum at varius vel pharetra vel turpis nunc eget. Euismod in pellentesque massa placerat duis. Lorem ipsum dolor sit amet consectetur adipiscing elit. Ultrices in iaculis nunc sed augue lacus. Vestibulum mattis ullamcorper velit sed. Adipiscing diam donec adipiscing

Here's a link +