How to use the actionsack.useCopyTextHandler function in actionsack

To help you get started, we’ve selected a few actionsack 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 carbon-app / carbon / components / ExportMenu.js View on Github external
const CopyEmbed = withRouter(({ router: { asPath }, mapper, title, margin }) => {
  const text = React.useMemo(() => mapper(asPath), [mapper, asPath])
  const { onClick, copied } = useCopyTextHandler(text)

  return (
    <button style="{{" color="{COLORS.DARK_PURPLE}">
      {copied ? 'Copied!' : title}
    </button>
  )
})
github carbon-app / carbon / components / WindowControls.js View on Github external
const CopyButton = React.memo(function CopyButton({ text }) {
  const { onClick, copied } = useCopyTextHandler(text)

  return (
    <button aria-label="Copy Button">
      {copied ? (
        
      ) : (
        
      )}
      <style>
        {`
          button {
            border: none;
            cursor: pointer;
            color: ${COLORS.SECONDARY};
            background: transparent;
          }</style></button>

actionsack

React UX components for handling common interactions

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis