mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
web: remove progress-bar component
This commit is contained in:
committed by
Abdullah Atta
parent
87402251a5
commit
08480188fa
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
This file is part of the Notesnook project (https://notesnook.com/)
|
||||
|
||||
Copyright (C) 2023 Streetwriters (Private) Limited
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { useAnimation } from "framer-motion";
|
||||
import { useEffect } from "react";
|
||||
import { Flex } from "@theme-ui/components";
|
||||
import { AnimatedBox } from "../animated";
|
||||
|
||||
function ProgressBar(props) {
|
||||
const { width, progress, duration = 1, onLoadingEnd, sx } = props;
|
||||
const animation = useAnimation();
|
||||
useEffect(() => {
|
||||
animation.start({ width: `${progress}%`, transition: { duration } });
|
||||
}, [animation, progress, duration]);
|
||||
|
||||
return (
|
||||
<Flex sx={{ ...sx, width: width, overflow: "hidden" }}>
|
||||
<AnimatedBox
|
||||
height={5}
|
||||
initial={{ width: "0%" }}
|
||||
animate={animation}
|
||||
bg="primary"
|
||||
sx={{ borderRadius: "default" }}
|
||||
onAnimationComplete={onLoadingEnd}
|
||||
/>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
|
||||
export default ProgressBar;
|
||||
@@ -21,7 +21,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import ListContainer from "../components/list-container";
|
||||
import { db } from "../common/db";
|
||||
import SearchBox from "../components/search";
|
||||
import ProgressBar from "../components/progress-bar";
|
||||
import { useStore as useNoteStore } from "../stores/note-store";
|
||||
import { Flex, Text } from "@theme-ui/components";
|
||||
import { showToast } from "../utils/toast";
|
||||
@@ -195,12 +194,6 @@ function Search({ type }) {
|
||||
context="search"
|
||||
text={`Searching in ${searchState.totalItems} ${type}...`}
|
||||
/>
|
||||
<ProgressBar
|
||||
progress={100}
|
||||
width={"60%"}
|
||||
duration={3}
|
||||
sx={{ mt: 2 }}
|
||||
/>
|
||||
</Flex>
|
||||
) : (
|
||||
<ListContainer
|
||||
|
||||
Reference in New Issue
Block a user