@fortawesome/free-solid-svg-icons#faTh TypeScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faTh. 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: BoardList.tsx    From knboard with MIT License 5 votes vote down vote up
BoardList = () => {
  const dispatch = useDispatch();
  const loading = useSelector((state: RootState) => state.board.fetchLoading);
  const boards = useSelector((state: RootState) => state.board.all);
  const userId = useSelector((state: RootState) => state.auth.user?.id);

  React.useEffect(() => {
    dispatch(fetchAllBoards());

    const handleKeydown = (e: KeyboardEvent) => {
      if (e.key === "b" && e.metaKey) {
        dispatch(setCreateDialogOpen(true));
      }
    };

    document.addEventListener("keydown", (e) => handleKeydown(e));
    return () => document.removeEventListener("keydown", handleKeydown);
  }, []);

  if (loading && boards.length === 0) {
    return <Spinner loading={loading} />;
  }

  return (
    <Container maxWidth="sm">
      <SEO title="Boards" />
      <BoardsSection>
        <Title>
          <FontAwesomeIcon icon={faTh} />
          <TitleText>All Boards</TitleText>
        </Title>
        <Cards>
          <Grid container spacing={2}>
            {boards.map((board) => {
              return (
                <Card
                  key={board.id}
                  cardCss={boardCardStyles}
                  to={`/b/${board.id}`}
                  isOwner={board.owner === userId}
                >
                  {board.name}
                </Card>
              );
            })}
            <Grid item xs={6} sm={4} key="new-board">
              <NewBoardDialog />
            </Grid>
          </Grid>
        </Cards>
      </BoardsSection>
    </Container>
  );
}