How to use services - 10 common examples

To help you get started, we’ve selected a few services examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zenika-open-source / FAQ / client / src / scenes / Question / scenes / Read / components / History / History.jsx View on Github external
const History = () => {
  const intl = useIntl(History)
  const [open, setOpen] = useState(false)

  return (
    <div>
      <div open=""> setOpen(st =&gt; !st)}&gt;
        <span>{intl('title')}</span>
        <div>
      </div>
      {open &amp;&amp; (
        <div>
          
        </div>
      )}
    </div>
  )
}</div>
github zenika-open-source / FAQ / client / src / components / Flags / Flags.jsx View on Github external
const Flags = ({ node, withLabels }) =&gt; {
  const intl = useIntl(Flags)
  const flagIntl = useIntl(Flag)

  const flags = clone(node.flags)

  if (flags.length === 0) return ''

  return (
    <div>
      {map(flagMeta, (meta, type) =&gt; {
        let flag = find(flags, { type })

        if (!flag) return null

        let tooltip

        if (withLabels &amp;&amp; flag.user) {</div>
github zenika-open-source / FAQ / client / src / components / Input / MarkdownEditor / MarkdownEditor.jsx View on Github external
const MarkdownEditor = ({ content, onChange }) =&gt; {
  const intl = useIntl(MarkdownEditor)
  const [tab, setTab] = useState('write')
  return (
     Promise.resolve(markdown.text(md))}
      onChange={onChange}
      commands={listCommands}
      l18n={intl('l18n')}
    /&gt;
  )
}
github zenika-open-source / FAQ / client / src / scenes / Question / scenes / Answer / components / Tips / Tips.jsx View on Github external
const Tips = props =&gt; {
  const intl = useIntl(Tips)

  return (
    
      <h3>{intl('title')}</h3>
      <div style="{{">
        <ul style="{{">
          {intl('tips').map((tip, i) =&gt; (
            <li>{tip}</li>
          ))}
        </ul>
      </div>
    
  )
}
github zenika-open-source / FAQ / client / src / components / Flags / Flag.jsx View on Github external
const Flag = ({ flag, withlabel, style, ...otherProps }) =&gt; {
  const intl = useIntl(Flag)

  return (
    <div style="{{">
      <i>{flagMeta[flag.type].icon}</i>
      {withlabel &amp;&amp; <span>{capitalize(intl(flag.type))}</span>}
    </div>
  )
}
github zenika-open-source / FAQ / client / src / scenes / Question / scenes / Read / components / Views / Views.jsx View on Github external
const Views = ({ value }) =&gt; {
  const intl = useIntl(Views)
  let formattedValue = value || 0
  if (value &gt; 1000) {
    const locale = window.navigator.language
    const formatter = new Intl.NumberFormat(locale, { maximumSignificantDigits: 2 })
    formattedValue = `${formatter.format(value / 1000)}k`
  }

  return (
    <span>
      {formattedValue} {formattedValue &gt; 1 ? intl('views') : intl('view')}
    </span>
  )
}
github zenika-open-source / FAQ / client / src / scenes / Auth / Callback.jsx View on Github external
const Callback = ({ location }) =&gt; {
  const intl = useIntl(Callback)

  const { parseHash } = useAuth()

  useEffect(() =&gt; {
    parseHash(location.hash)
  }, [parseHash, location.hash])

  return 
}
github zenika-open-source / FAQ / client / src / components / PairInputList / PairInputList.jsx View on Github external
const PairInputList = ({ pairs, options, actions, disabled, className, ...rest }) => {
  const intl = useIntl(PairInputList)

  const defaultOptions = {
    labels: intl('labels'),
    icons: {
      more: 'add',
      line: 'info_outline',
      key: 'label_outline',
      value: 'link'
    }
  }

  const defaultActions = {
    create: noop,
    update: noop,
    delete: noop
  }
github zenika-open-source / FAQ / client / src / scenes / Question / scenes / Read / components / FlagsDropdown / FlagsDropdown.jsx View on Github external
const FlagsDropdown = ({ flags, onSelect, onRemove }) =&gt; {
  const intl = useIntl(FlagsDropdown)
  const flagIntl = useIntl(Flag)

  const flagTypes = ['incomplete', 'outdated', 'duplicate']

  const items = flagTypes.map(type =&gt; {
    const isSelected = flags.filter(f =&gt; f.type === type).length &gt; 0
    return (
       isSelected &amp;&amp; onRemove(type)}&gt;
              close
            
          ) : null
github zenika-open-source / FAQ / client / src / scenes / Question / scenes / Random / Random.jsx View on Github external
const Random = ({ randomNode }) =&gt; {
  const intl = useIntl(Random)

  if (randomNode.id) {
    return 
  }

  return <div style="{{">{intl('error')}</div>
}

services

A Service layer for node js.

Unknown
Latest version published 12 years ago

Package Health Score

36 / 100
Full package analysis

Popular services functions