state/user/hooks#useURLWarningVisible TypeScript Examples

The following examples show how to use state/user/hooks#useURLWarningVisible. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx    From interface-v2 with GNU General Public License v3.0 6 votes vote down vote up
Popups: React.FC = () => {
  // get all popups
  const activePopups = useActivePopups();
  const urlWarningActive = useURLWarningVisible();
  const classes = useStyles({
    extraPadding: urlWarningActive,
    height: activePopups?.length > 0 ? 'fit-content' : 0,
  });

  return (
    <>
      <Box className={classes.fixedPopupColumn}>
        {activePopups.map((item) => (
          <PopupItem
            key={item.key}
            content={item.content}
            popKey={item.key}
            removeAfterMs={item.removeAfterMs}
          />
        ))}
      </Box>
      <Box className={classes.mobilePopupWrapper}>
        <Box className={classes.mobilePopupInner}>
          {activePopups // reverse so new items up front
            .slice(0)
            .reverse()
            .map((item) => (
              <PopupItem
                key={item.key}
                content={item.content}
                popKey={item.key}
                removeAfterMs={item.removeAfterMs}
              />
            ))}
        </Box>
      </Box>
    </>
  );
}