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

The following examples show how to use @fortawesome/free-solid-svg-icons#faMinus. 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 bad-cards-game with GNU Affero General Public License v3.0 6 votes vote down vote up
library.add(
  faDotCircle,
  faCircle,
  faBars,
  faTimes,
  faInfoCircle,
  faTrophy,
  faShareSquare,
  faHeart,
  faInstagram,
  faTwitter,
  faGithub,
  faFacebook,
  faHandPointRight,
  faEdit,
  faSave,
  faCamera,
  faPlus,
  faMinus,
  faRandom,
);
Example #2
Source File: tableColumns.tsx    From solo with MIT License 5 votes vote down vote up
createColumns: CreateColumns = () => [
  {
    Header: "Details",
    Cell: ({ row }) => (
      <span {...row.getToggleRowExpandedProps()}>
        <FontAwesomeIcon icon={row.isExpanded ? faMinus : faPlus} />
      </span>
    )
  },
  {
    Header: "SDN",
    accessor: "sdn"
  },
  {
    Header: "Service Request #",
    accessor: "serviceRequest",
    id: "service_request"
  },
  {
    Header: "Commodity",
    id: "suppadd__code",
    accessor: "commodityName"
  },
  {
    Header: "Status",
    disableSortBy: true,
    id: "currentStatus",
    accessor: ({ mostRecentStatusIdx, statuses }) =>
      statuses[mostRecentStatusIdx].dic
  },
  {
    Header: "Nomenclature",
    id: "part__nomen",
    accessor: "part.nomen"
  },
  {
    Header: "Last Updated",
    id: "statuses__status_date",
    disableSortBy: true,
    accessor: ({ mostRecentStatusIdx, statuses }) =>
      `${formatDistanceToNow(
        parseISO(statuses[mostRecentStatusIdx].status_date)
      )} ago`
  }
]
Example #3
Source File: ComplexList.example.tsx    From hacker-ui with MIT License 5 votes vote down vote up
function ComplexListExample(props: Props) {
  const { Root, styles } = useStyles(props);
  const [quantities, setQuantities] = useState({} as { [id: string]: number });

  return (
    <Root>
      <List className={styles.list}>
        {products.map(({ id, imgUrl, title, price }) => {
          const quantity = quantities[id] ?? 0;

          const handleDec = () => {
            setQuantities((quantities) => ({
              ...quantities,
              [id]: Math.max(0, quantity - 1),
            }));
          };
          const handleInc = () => {
            setQuantities((quantities) => ({
              ...quantities,
              [id]: quantity + 1,
            }));
          };

          return (
            <ListItem className={styles.listItem}>
              <img className={styles.img} src={imgUrl} alt={title} />
              <div className={styles.info}>
                <h3 className={styles.title}>{title}</h3>
                <p className={styles.subtitle}>
                  ${(price / 100).toLocaleString()}
                </p>
              </div>
              <div className={styles.buttonSection}>
                <div className={styles.buttons}>
                  <Button shape="icon" size="small" onClick={handleDec}>
                    <FontAwesomeIcon icon={faMinus} />
                  </Button>
                  <div className={styles.quantityCount}>{quantity}</div>
                  <Button shape="icon" size="small" onClick={handleInc}>
                    <FontAwesomeIcon icon={faPlus} />
                  </Button>
                </div>
                <div className={styles.subLabel}>Quantity</div>
              </div>
              <div className={styles.subtotalSection}>
                <div className={styles.subtotal}>
                  ${((quantity * price) / 100).toLocaleString()}
                </div>
                <div className={styles.subLabel}>Subtotal</div>
              </div>
            </ListItem>
          );
        })}
      </List>
    </Root>
  );
}