diff --git a/src/components/Person.js b/src/components/Person.js index 78a69ed7..20d22ba1 100644 --- a/src/components/Person.js +++ b/src/components/Person.js @@ -1,6 +1,7 @@ import React from 'react'; import { name } from 'country-emoji'; import styled from 'styled-components'; +import { Tag, Tags } from './Topics'; import iphone from '../images/iphone.png'; import android from '../images/android.png'; import windows from '../images/windows.svg'; @@ -26,16 +27,13 @@ export default function Person({ person, currentTag }) { >{`${url.host}${url.pathname}`}

{person.description}

- + @@ -88,29 +86,24 @@ const PersonInner = styled.div` h3 { margin: 0; } - ul li { - font-size: 1.2rem; - &.currentTag { - color: var(--yellow); - } - } header { display: grid; grid-template-rows: auto auto; grid-template-columns: auto 1fr; grid-gap: 0 1rem; - img { - grid-row: 1 / -1; - background: var(--lightblue); - font-size: 1rem; - } - .displayLink { - text-decoration: none; - color: var(--vape); - letter-spacing: 1px; - font-size: 1.2rem; - :hover { - color: var(--pink); + img { + grid-row: 1 / -1; + background: var(--lightblue); + font-size: 1rem; + } + .displayLink { + text-decoration: none; + color: var(--vape); + letter-spacing: 1px; + font-size: 1.2rem; + :hover { + color: var(--pink); + } } } `; diff --git a/src/components/Topics.js b/src/components/Topics.js index d46e0752..327e1284 100644 --- a/src/components/Topics.js +++ b/src/components/Topics.js @@ -10,8 +10,8 @@ export default function Topics() { return ( {tags.map(tag => ( - @@ -25,12 +25,12 @@ export default function Topics() { /> {tag.name} {tag.count} - + ))} {countries.map(tag => ( - {tag.emoji} {tag.count} - + ))} ); @@ -60,11 +60,12 @@ const Tags = styled.div` flex-wrap: wrap; `; -const TagLabel = styled.label` +const Tag = styled.label` background: var(--pink); margin: 2px; border-radius: 3px; - font-size: 1.7rem; + font-size: ${props => (props.small ? `1.2rem;` : `1.7rem;`)} + padding: 5px; color: hsla(0, 100%, 100%, 0.8); transition: background-color 0.2s; @@ -75,10 +76,12 @@ const TagLabel = styled.label` input { display: none; } - &.currentTag { + ${props => + props.currentTag && + ` background: var(--yellow); color: hsla(0, 100%, 0%, 0.8); - } + `} `; const TagEmoji = styled.span` @@ -93,3 +96,5 @@ const TagCount = styled.span` border-radius: 2px; margin-left: 5px; `; + +export { Tag, Tags };