Sha256: b63827bac326dece8c16c100c5e01f941523d6b34196ba89c0f7aaf517d270de

Contents?: true

Size: 865 Bytes

Versions: 28

Compression:

Stored size: 865 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' | 'appointment',
  url?: String,
}

const typeMap = {
  'home': 'H#',
  'project': 'P#',
  'appointment': 'A#',
  '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

28 entries across 28 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.8.2 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.7.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.7.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.6.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx