react-icons/fa#FaTrashAlt JavaScript Examples

The following examples show how to use react-icons/fa#FaTrashAlt. 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: TodoItem.js    From react-todo-app with MIT License 6 votes vote down vote up
function TodoItem(props) {
  let textDecorationClass = props.todo.completed
    ? "line-through"
    : "no-underline";
  let textColorClass = props.todo.completed
    ? "text-pink-600"
    : "text-gray-800";

  return (
    <li
      className={`flex items-center space-x-1 py-2.5 px-2.5 border-b border-gray-300 transition duration-300 ease-in ${textDecorationClass} ${textColorClass}`}
      data-testid="todo-item"
    >
      <input
        name="completed-checkbox"
        type="checkbox"
        className="form-checkbox rounded text-pink-600 shadow-none focus:shadow-none focus:ring-0 focus:ring-offset-0 focus:outline-none"
        checked={props.todo.completed}
        value={props.todo.completed}
        onChange={() => props.markComplete(props.todo.id)}
        data-testid="task-completed-checkbox"
      />
      <span className="flex-1 px-2 min-w-0 break-words">
        {props.todo.title}
      </span>
      <button
        onClick={() => props.delTodo(props.todo.id)}
        className="transition duration-200 ease-in-out text-gray-400 hover:text-pink-500 focus:outline-none"
        data-testid="delete-task-btn"
      >
        <FaTrashAlt />
      </button>
    </li>
  );
}
Example #2
Source File: Toolbar.js    From dm2 with Apache License 2.0 6 votes vote down vote up
LSFOperations = observer(({ history }) => {
  useShortcut("lsf.undo", () => history?.undo(), {}, [history]);
  useShortcut("lsf.redo", () => history?.redo(), {}, [history]);

  return history ? (
    <Button.Group>
      <Button
        icon={<Icon icon={FaUndo} />}
        disabled={!history.canUndo}
        onClick={() => history.undo()}
      />
      <Button
        icon={<Icon icon={FaRedo} />}
        disabled={!history.canRedo}
        onClick={() => history.redo()}
      />
      <Button
        icon={<Icon icon={FaTrashAlt} />}
        disabled={!history.canUndo}
        onClick={() => history.reset()}
      />
    </Button.Group>
  ) : null;
})
Example #3
Source File: SongItem.js    From kalimba-tabs with MIT License 6 votes vote down vote up
render() {
    return (
      <div
        style={styles.songItemContainer}
        onDoubleClick={() => {
          this.props.onClick();
        }}
        onMouseEnter={() => {
          this.setState({ hovered: true });
        }}
        onMouseLeave={() => {
          this.setState({ hovered: false });
        }}
      >
        {/* DELETE BUTTON */}
        {this.state.hovered && (
          <div
            style={styles.deleteButton}
            onClick={() => {
              this.props.onDeleteClicked();
            }}
          >
            <FaTrashAlt size={20} />
          </div>
        )}

        {this.props.title.replace(".kal", "")}
      </div>
    );
  }
Example #4
Source File: index.js    From gatsby-shopify-course with BSD Zero Clause License 6 votes vote down vote up
export function RemoveLineItem({ lineItemId }) {
  const { removeLineItem } = React.useContext(CartContext);

  const handleClick = () => {
    removeLineItem(lineItemId);
  };

  return (
    <Icon onClick={handleClick}>
      <FaTrashAlt />
    </Icon>
  );
}