react-icons/ai#AiOutlineClear JavaScript Examples

The following examples show how to use react-icons/ai#AiOutlineClear. 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: Divider.js    From fokus with GNU General Public License v3.0 6 votes vote down vote up
export default function Divider() {
    const [showActionBtn, setShowActionBtn] = useState(false);
    const showCompletedTasks = useSelector((s) => s.tasks.meta.showCompletedTasks);
    const completedTasksCount = useSelector((s)=>s.tasks.meta.completedTasksCount);
    const dispatch = useDispatch();
    return (
        <Flipped flipId={`-1`}>
            <DoneTasksDivider>
                <DividerLine />
                <DividerIcon showCompletedTasks={showCompletedTasks} onMouseEnter={() => setShowActionBtn(true)} onMouseLeave={() => setShowActionBtn(false)}>
                    {showActionBtn ? (
                        <DividerActionDiv>
                            {showCompletedTasks ? (
                                <BiHide onClick={() => dispatch(toggleShowCompletedTasks())} />
                            ) : (
                                <BiShow onClick={() => dispatch(toggleShowCompletedTasks())} />
                            )}
                            <AiOutlineClear onClick={() => dispatch(clearCompletedTasks())} />
                        </DividerActionDiv>
                    ) : (
                        <p>{showCompletedTasks?"DONE":`DONE(${completedTasksCount})`}</p>
                        
                    )}
                </DividerIcon>
                <DividerLine />
            </DoneTasksDivider>
        </Flipped>
    );
}