Sha256: 5e9945f9a1e6a5d6e2a37ef46e4f30fce0eab20de35f51e281c0fa564070160d

Contents?: true

Size: 826 Bytes

Versions: 10

Compression:

Stored size: 826 Bytes

Contents

/* @flow */
/* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */

import React from 'react'
import classnames from 'classnames'

import { Badge } from '../'
import { buildCss } from '../utilities/props'

type HashtagProps = {
  className?: String,
  data?: String,
  dark?: Boolean,
  id?: String,
  text?: String,
  type: 'default' | 'home' | 'project',
  url?: String,
}

const typeMap = {
  'home': 'H#',
  'project': 'P#',
  'default': '#',
}

const Hashtag = ({
  className,
  dark = false,
  text,
  type,
  url,
}: HashtagProps) => (
  <span className={classnames(className, buildCss('pb_hashtag_kit', { 'dark': dark }))}>
    <a href={url}>
      <Badge
          dark={dark}
          text={typeMap[type] + text}
          variant="primary"
      />
    </a>
  </span>
)

export default Hashtag

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
playbook_ui-4.2.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.1.2 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.1.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.1.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.0.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.0.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-3.5.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-3.4.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-3.3.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-3.2.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx