summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2018-08-19 23:59:24 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2018-08-19 23:59:24 -0700
commit141f9dcf0d3609d67b47507d2a2b5c5b1ebeee43 (patch)
tree54008ea89ae8ddb157abae11018e07e371fd4c09 /src/components
parent567234dd9f05715123c9e271fd83296660e04cbc (diff)
Implement tag component
Diffstat (limited to 'src/components')
-rw-r--r--src/components/tag.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/tag.js b/src/components/tag.js
new file mode 100644
index 0000000..794497c
--- /dev/null
+++ b/src/components/tag.js
@@ -0,0 +1,26 @@
+import React from 'react'
+import FA from 'react-fontawesome'
+import { css } from 'emotion'
+import { margins, colours } from './globals'
+
+const tagIconStyle = css(`
+ margin-right: ${margins.xsm}px;
+`)
+
+export const Tag = p => {
+ const tagStyle = css(`
+ margin: 0 ${margins.sm}px;
+ padding: ${margins.xsm}px;
+ border-radius: 5px;
+ color: ${colours.background};
+ background: ${colours.main};
+ ${p.fontSize ? `font-size: ${p.fontSize}` : ''};
+ line-height: 1.5em;
+ `)
+ return (
+ <div className={tagStyle}>
+ <FA name="tag" className={tagIconStyle} />
+ {p.children}
+ </div>
+ )
+}