Skip to content

Commit

Permalink
feat(FeedLabel): denote admin-only label
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Jul 20, 2021
1 parent be0b052 commit 83ae860
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/common/components/FeedLabel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import tinycolor from 'tinycolor2'
import Icon from '@conveyal/woonerf/components/icon'

const getComplementaryColor = (cssHex, strength) => {
const color = tinycolor(cssHex)
Expand All @@ -11,7 +12,7 @@ const getComplementaryColor = (cssHex, strength) => {
}

export default function Label (props) {
const { name, color, small } = props
const { name, color, small, adminOnly } = props

return (
<span
Expand All @@ -22,6 +23,7 @@ export default function Label (props) {
borderColor: getComplementaryColor(color, 10)
}}
>
{adminOnly ? <Icon type='lock' /> : ''}
{name}
</span>
)
Expand Down

0 comments on commit 83ae860

Please sign in to comment.