How to use the reakit/Tooltip.useTooltipState function in reakit

To help you get started, we’ve selected a few reakit 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 SaraVieira / svg-to-jsx-electron / src / components / Code.js View on Github external
export default ({ code, filename, jsx }) => {
  const copyTooltip = useTooltipState({ placement: "top-end" })
  const downloadTooltip = useTooltipState({ placement: "top-end" })
  const [copied, setCopied] = useState(false)

  const save = () => {
    dialog
      .showSaveDialog(null, {
        defaultPath: `${filename ? filename.split(".")[0] : "icon"}.${
          jsx ? "jsx" : "js"
        }`
      })
      .then(({ filePath }) => {
        if (filePath === undefined) {
          return
        }

        fs.writeFile(filePath, code, err => {
          // eslint-disable-next-line
github SaraVieira / svg-to-jsx / electron-app / src / components / Code.js View on Github external
export default ({ code, filename, jsx }) => {
  const copyTooltip = useTooltipState({ placement: 'top-end' })
  const downloadTooltip = useTooltipState({ placement: 'top-end' })
  const [copied, setCopied] = useState(false)

  const save = () => {
    dialog
      .showSaveDialog(null, {
        defaultPath: `${filename.split('.')[0]}.${jsx ? 'jsx' : 'js'}`
      })
      .then(({ filePath }) => {
        if (filePath === undefined) {
          return
        }

        fs.writeFile(filePath, code, err => {
          if (err) return console.error(err)
        })
      })
github SaraVieira / svg-to-jsx / electron-app / src / components / Code.js View on Github external
export default ({ code, filename, jsx }) => {
  const copyTooltip = useTooltipState({ placement: 'top-end' })
  const downloadTooltip = useTooltipState({ placement: 'top-end' })
  const [copied, setCopied] = useState(false)

  const save = () => {
    dialog
      .showSaveDialog(null, {
        defaultPath: `${filename.split('.')[0]}.${jsx ? 'jsx' : 'js'}`
      })
      .then(({ filePath }) => {
        if (filePath === undefined) {
          return
        }

        fs.writeFile(filePath, code, err => {
          if (err) return console.error(err)
        })
github SaraVieira / svg-to-jsx-electron / src / components / Code.js View on Github external
export default ({ code, filename, jsx }) => {
  const copyTooltip = useTooltipState({ placement: "top-end" })
  const downloadTooltip = useTooltipState({ placement: "top-end" })
  const [copied, setCopied] = useState(false)

  const save = () => {
    dialog
      .showSaveDialog(null, {
        defaultPath: `${filename ? filename.split(".")[0] : "icon"}.${
          jsx ? "jsx" : "js"
        }`
      })
      .then(({ filePath }) => {
        if (filePath === undefined) {
          return
        }

        fs.writeFile(filePath, code, err => {
github btzr-io / Villain / src / components / menu.js View on Github external
({ disclosure, tooltip, items, placement, ariaLabel, ...props }, ref) => {
    const menu = useMenuState({ placement })
    const tooltipState = useTooltipState({ placement })

    const subRef = React.useRef(null)
    const mainRef = React.useRef(null)

    const [height, setHeight] = React.useState(0)
    const [submenuState, setSubmenuState] = React.useState({
      show: false,
      list: null,
      index: null,
      items: null,
      title: null,
    })
    const getHeight = element => {
      const bounds = element.getBoundingClientRect()
      return bounds.height
    }
github ggoodman / velcro / packages / playground / src / App.tsx View on Github external
const StatusBar: React.FC = () => {
  const serviceWorker = useServiceWorker();
  const offlineTooltip = useTooltipState({ gutter: 0 });
  const reloadTooltip = useTooltipState({ gutter: 0 });

  return (
    
      {serviceWorker.assetsCached ? (
        
          
           Offline ready
        
      ) : null}
      
        This application has been fully cached and can now be used offline.
      

      {serviceWorker.assetsUpdateReady ? (
github ggoodman / velcro / packages / playground / src / playground / Sidebar.tsx View on Github external
const SidebarFile: React.FC<{ className?: string; model: Monaco.editor.ITextModel }> = ({ className, model }) => {
  const activeModel = useActiveModel();
  const editorManager = useContext(EditorManagerContext);
  const tooltip = useTooltipState({ gutter: 0 });

  const onClickDelete = () => {
    model.dispose();
  };

  return (
    
      <span> editorManager.focusModel(model)}&gt;{model.uri.fsPath.slice(1)}</span>
       onClickDelete()}&gt;
        <span aria-label="Delete file" role="img"></span>
      
      
        Delete file
github ggoodman / velcro / packages / playground / src / App.tsx View on Github external
const StatusBar: React.FC = () =&gt; {
  const serviceWorker = useServiceWorker();
  const offlineTooltip = useTooltipState({ gutter: 0 });
  const reloadTooltip = useTooltipState({ gutter: 0 });

  return (
    
      {serviceWorker.assetsCached ? (
        
          
          &nbsp;Offline ready
        
      ) : null}
      
        This application has been fully cached and can now be used offline.
      

      {serviceWorker.assetsUpdateReady ? (