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.6.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.5.2 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.5.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.5.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.4.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.4.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.3.1 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx
playbook_ui-4.3.0 app/pb_kits/playbook/pb_hashtag/_hashtag.jsx