How to use the reakit/Dialog.useDialogState 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 codesandbox / codesandbox-client / packages / common / src / components / Modal / Modal.tsx View on Github external
export const Modal: React.FC = ({
  label,
  button = Button,
  backdrop = Backdrop,
  container = Container,
  isOpen,
  onClose = () => undefined,
  children,
  ...props
}) => {
  const dialog = useDialogState();
  const onHide = () => {
    dialog.hide();
    onClose();
  };

  return (
    <>
      {label && (
        
          {label}
        
      )}
github gregberge / gregberge.com / src / components / Navbar.js View on Github external
export function Navbar({ children }) {
  const dialog = useDialogState({ unstable_animated: true, visible: false })
  const childrenArray = React.Children.toArray(children)
  const secondary = childrenArray.find(child => child.type === NavbarSecondary)
  return (
    <nav>
      {secondary.props.children}
      
        {children}
        
        
      
    </nav>
github gregberge / svgr / website / src / components / playground / Playground.js View on Github external
export function Playground() {
  const [input, setInput] = React.useState(defaultSvg)
  const [output, setOutput] = React.useState('')
  const [loading, setLoading] = React.useState(false)
  const [state, setState] = useQuery(getInitialState)
  const dialog = useDialogState({ visible: false })

  const transformIdRef = React.useRef(0)

  React.useEffect(() => {
    async function transform() {
      if (input.trim() === '') {
        setOutput('')
        return
      }

      setLoading(true)

      if (window.ga) {
        window.ga('send', {
          hitType: 'event',
          eventCategory: 'Playground',