react-feather#X TypeScript Examples

The following examples show how to use react-feather#X. 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 Aragorn with MIT License 6 votes vote down vote up
WindowButton = () => {
  function minWindow() {
    mainWindow.minimize();
  }
  function maxWindow() {
    if (mainWindow.isMaximized()) {
      mainWindow.unmaximize();
    } else {
      mainWindow.maximize();
    }
  }
  function closeWindow() {
    mainWindow.close();
  }

  return (
    <div className="window-button-wrapper">
      <div className="btn" onClick={minWindow}>
        <Minus className="icon" />
      </div>
      <div className="btn" onClick={maxWindow}>
        <Maximize2 className="icon icon-max" />
      </div>
      <div className="btn btn-close" onClick={closeWindow}>
        <X className="icon" />
      </div>
    </div>
  );
}
Example #2
Source File: UniBalanceContent.tsx    From dyp with Do What The F*ck You Want To Public License 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 16px;
  top: 16px;

  :hover {
    cursor: pointer;
  }
`
Example #3
Source File: DeleteFeedDialog.tsx    From bee-dashboard with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
export function DeleteFeedDialog({ identity, onConfirm, onClose }: Props): ReactElement {
  return (
    <SwarmDialog>
      <Box mb={4}>
        <TitleWithClose onClose={onClose}>Delete</TitleWithClose>
      </Box>
      <Box mb={2}>
        <Typography align="center">{`You are about to delete feed ${identity.name} Website. It is strongly advised to export this feed first.`}</Typography>
      </Box>
      <ExpandableListItemActions>
        <SwarmButton iconType={Trash} onClick={() => onConfirm(identity)}>
          Delete
        </SwarmButton>
        <SwarmButton iconType={X} onClick={onClose} cancel>
          Cancel
        </SwarmButton>
      </ExpandableListItemActions>
    </SwarmDialog>
  )
}
Example #4
Source File: PopupItem.tsx    From goose-frontend-amm with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #5
Source File: PopupItem.tsx    From pancake-swap-exchange-testnet with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #6
Source File: PopupItem.tsx    From cuiswap with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #7
Source File: PopupItem.tsx    From panther-frontend-dex with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #8
Source File: UniBalanceContent.tsx    From forward.swaps with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 16px;
  top: 16px;

  :hover {
    cursor: pointer;
  }
`
Example #9
Source File: index.tsx    From sushiswap-exchange with GNU General Public License v3.0 6 votes vote down vote up
StyledCloseIcon = styled(X)`
  height: 20px;
  width: 20px;
  :hover {
    cursor: pointer;
  }

  > * {
    stroke: ${({ theme }) => theme.text1};
  }
`
Example #10
Source File: UniBalanceContent.tsx    From luaswap-interface with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 16px;
  top: 16px;

  :hover {
    cursor: pointer;
  }
`
Example #11
Source File: index.tsx    From cheeseswap-interface with GNU General Public License v3.0 6 votes vote down vote up
StyledCloseIcon = styled(X)`
  height: 20px;
  width: 20px;
  :hover {
    cursor: pointer;
  }

  > * {
    stroke: ${({ theme }) => theme.colors.text1};
  }
`
Example #12
Source File: index.tsx    From cuiswap with GNU General Public License v3.0 6 votes vote down vote up
StyledCloseIcon = styled(X)`
  height: 20px;
  width: 20px;
  :hover {
    cursor: pointer;
  }

  > * {
    stroke: ${({ theme }) => theme.text1};
  }
`
Example #13
Source File: PopupItem.tsx    From sybil-interface with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #14
Source File: EditMode.tsx    From yet-another-generic-startpage with MIT License 6 votes vote down vote up
EditMode = ({ label, onSave, onAbort }: EditModeProps) => {
  const [newLabel, setNewLabel] = useState(label)

  return (
    <TitleLayout>
      <div>
        <TextInput value={newLabel} onChange={setNewLabel} />
      </div>
      <div>
        <IconButton
          icon={Save}
          label={`Save changes`}
          onClick={() => onSave(newLabel)}
        />
        <IconButton icon={X} label={`Discard changes`} onClick={onAbort} />
      </div>
    </TitleLayout>
  )
}
Example #15
Source File: PopupItem.tsx    From cheeseswap-interface with GNU General Public License v3.0 6 votes vote down vote up
StyledClose = styled(X)`
  position: absolute;
  right: 10px;
  top: 10px;

  :hover {
    cursor: pointer;
  }
`
Example #16
Source File: FilesList.tsx    From ke with MIT License 6 votes vote down vote up
export function FilesList({
  value,
  onChange,
  listItemIcon = Paperclip,
  linkProps,
}: FilesListProps): ReactElement<FilesListProps> {
  const deleteFile = (file: FileDescriptor): void => {
    const restFiles = value.filter((f) => f.uuid !== file.uuid)
    onChange(restFiles)
  }

  return (
    <List>
      {value.map((file) => (
        <ListItem display="flex" alignItems="center" className={listItemCss} key={file.uuid}>
          <ListIcon as={listItemIcon} />
          {file?.url ? (
            <Link href={file.url} isExternal {...linkProps}>
              {file.name}
            </Link>
          ) : (
            file.name
          )}
          <IconButton
            aria-label="Удалить"
            variant="unstyled"
            size="xs"
            icon={<X color="red" size={16} />}
            ml={2}
            onClick={() => deleteFile(file)}
          />
        </ListItem>
      ))}
    </List>
  )
}
Example #17
Source File: Dialog.tsx    From frontend-v1 with GNU Affero General Public License v3.0 6 votes vote down vote up
Dialog: React.FC<Props> = ({ isOpen, onClose, children }) => (
  <Overlay isOpen={isOpen}>
    <Wrapper aria-label="dialog">
      <CloseButton onClick={onClose}>
        <X />
      </CloseButton>
      <div>{children}</div>
    </Wrapper>
  </Overlay>
)
Example #18
Source File: ItemEditMode.tsx    From yet-another-generic-startpage with MIT License 6 votes vote down vote up
ItemEditMode = ({
  label,
  url,
  onSave,
  onAbort,
}: ItemEditModeProps) => {
  const [newLabel, setNewLabel] = useState(label)
  const [newUrl, setNewUrl] = useState(url)

  const newBookmark: RowElement = {
    label: newLabel,
    url: newUrl,
  }

  return (
    <Wrapper>
      <TextInput label="Label" value={newLabel} onChange={setNewLabel} />
      <TextInput label="Url" value={newUrl} onChange={setNewUrl} />
      <div>
        <IconButton
          icon={Save}
          label="Save changes"
          onClick={() => onSave(newBookmark)}
        />
        <IconButton icon={X} label="Discard changes" onClick={onAbort} />
      </div>
    </Wrapper>
  )
}
Example #19
Source File: components.tsx    From sybil-interface with GNU General Public License v3.0 5 votes vote down vote up
CloseIcon = styled(X)<{ onClick?: () => void }>`
  cursor: pointer;

  :active {
    stroke: ${({ theme }) => theme.text1};
  }
`
Example #20
Source File: Filters.tsx    From gear-js with GNU General Public License v3.0 5 votes vote down vote up
Filters = ({ values, setValues, isAnySelected }: Props) => {
  const [isOpen, setIsOpen] = useState(false);
  const filters = Object.keys(values);

  const handleChange = ({ target: { name, checked } }: ChangeEvent<HTMLInputElement>) => {
    setValues((prevValues) => {
      const newValues = { ...prevValues, [name]: checked };
      const stringifiedNewValues = JSON.stringify(newValues);

      localStorage.setItem(LOCAL_STORAGE.EVENT_FILTERS, stringifiedNewValues);
      return newValues;
    });
  };

  const getFilters = () =>
    filters.map((filter) => (
      <li key={filter}>
        <Checkbox
          label={filter}
          name={filter}
          className={styles.checkbox}
          checked={values[filter]}
          onChange={handleChange}
        />
      </li>
    ));

  const close = () => {
    setIsOpen(false);
  };

  const toggle = () => {
    setIsOpen((prevValue) => !prevValue);
  };

  const reset = () => {
    setValues(init.filterValues);
    localStorage.removeItem(LOCAL_STORAGE.EVENT_FILTERS);
    close();
  };

  const ref = useOutsideClick(close);
  const toggleButtonClassName = clsx(styles.button, styles.toggleButton);
  const resetButtonClassName = clsx(styles.button, styles.resetButton);

  return (
    <div className={styles.filters} ref={ref}>
      <button type="button" className={toggleButtonClassName} onClick={toggle}>
        <Sliders size={16} strokeWidth={3} />
      </button>
      {isOpen && (
        <div className={styles.body}>
          <ul className={styles.list}>{getFilters()}</ul>
          {isAnySelected && (
            <footer className={styles.footer}>
              <button type="button" className={resetButtonClassName} onClick={reset}>
                <X size={16} strokeWidth={3} className={styles.icon} />
                Clear filters
              </button>
            </footer>
          )}
        </div>
      )}
    </div>
  );
}
Example #21
Source File: Common.tsx    From goose-frontend-amm with GNU General Public License v3.0 5 votes vote down vote up
CloseIcon = styled(X)<{ onClick: () => void }>`
  cursor: pointer;
`
Example #22
Source File: VoteModal.tsx    From sybil-interface with GNU General Public License v3.0 5 votes vote down vote up
StyledClosed = styled(X)`
  :hover {
    cursor: pointer;
  }
`
Example #23
Source File: components.tsx    From forward.swaps with GNU General Public License v3.0 5 votes vote down vote up
CloseIcon = styled(X)<{ onClick: () => void }>`
  cursor: pointer;
`
Example #24
Source File: components.tsx    From sushiswap-exchange with GNU General Public License v3.0 5 votes vote down vote up
CloseIcon = styled(X)<{ onClick: () => void }>`
  cursor: pointer;
`
Example #25
Source File: URLWarning.tsx    From luaswap-interface with GNU General Public License v3.0 5 votes vote down vote up
StyledClose = styled(X)`
  :hover {
    cursor: pointer;
  }
`
Example #26
Source File: components.tsx    From cuiswap with GNU General Public License v3.0 5 votes vote down vote up
CloseIcon = styled(X)<{ onClick: () => void }>`
  cursor: pointer;
`
Example #27
Source File: SnackbarNotification.tsx    From firebase-react-typescript-project-template with MIT License 5 votes vote down vote up
SnackbarNotification = () => {
  const classes = useStyles({});
  const {
    isOpen,
    message,
    variant,
    closeNotification,
  } = useSnackbarNotification();

  return (
    <Snackbar
      anchorOrigin={{
        vertical: "bottom",
        horizontal: "center",
      }}
      TransitionComponent={SlideTransition}
      open={isOpen}
      autoHideDuration={5000}
      onClose={closeNotification}
      className={classes.root}
    >
      <SnackbarContent
        classes={{
          root: clsx(classes.snackbarContent, classes[variant]),
          message: classes.message,
        }}
        message={
          <>
            <Typography variant="body1" className={classes.messageText}>
              {message}
            </Typography>
            <IconButton
              key="close"
              color="inherit"
              onClick={closeNotification}
              className={classes.closeButton}
            >
              <X />
            </IconButton>
          </>
        }
      />
    </Snackbar>
  );
}
Example #28
Source File: DelegateModal.tsx    From luaswap-interface with GNU General Public License v3.0 5 votes vote down vote up
StyledClosed = styled(X)`
  :hover {
    cursor: pointer;
  }
`
Example #29
Source File: FeedSubpage.tsx    From bee-dashboard with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
export function FeedSubpage(): ReactElement {
  const { identities } = useContext(IdentityContext)
  const { uuid } = useParams()
  const { beeApi } = useContext(SettingsContext)
  const { status } = useContext(BeeContext)

  const navigate = useNavigate()

  const [available, setAvailable] = useState(false)

  const identity = identities.find(x => x.uuid === uuid)

  useEffect(() => {
    if (!identity || !identity.feedHash) {
      return
    }

    try {
      beeApi?.downloadData(identity.feedHash).then(() => setAvailable(true))
    } catch {
      setAvailable(false)
    }
  }, [beeApi, uuid, identity])

  if (!identity || !status.all) {
    navigate(ROUTES.FEEDS, { replace: true })

    return <></>
  }

  function onClose() {
    navigate(ROUTES.FEEDS)
  }

  return (
    <div>
      <HistoryHeader>{`${identity.name} Website`}</HistoryHeader>
      <UploadArea showHelp={false} uploadOrigin={{ origin: 'FEED', uuid }} />
      {available && identity.feedHash ? (
        <>
          <Box mb={0.25}>
            <ExpandableListItemKey label="Feed hash" value={identity.feedHash} />
          </Box>
          <Box mb={4}>
            <ExpandableListItemLink
              label="BZZ Link"
              value={`https://${swarmCid.encodeFeedReference(identity.feedHash)}.bzz.link`}
            />
          </Box>
        </>
      ) : (
        <Box mb={4}>
          <DocumentationText>
            This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the{' '}
            <a
              href="https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post"
              target="_blank"
              rel="noreferrer"
            >
              official Bee documentation
            </a>
            .
          </DocumentationText>
        </Box>
      )}
      <ExpandableListItemActions>
        <SwarmButton iconType={X} onClick={onClose} cancel>
          Close
        </SwarmButton>
      </ExpandableListItemActions>
    </div>
  )
}