upd: project
Deskripsi: - load page project - pencarian project - filter group project - update label status pada project home No Issues
This commit is contained in:
@@ -6,20 +6,24 @@ import { Animated, View } from "react-native";
|
||||
type Props = {
|
||||
margin?: number
|
||||
value: number
|
||||
category: "page" | "carousel"
|
||||
}
|
||||
|
||||
export default function ProgressBar({ margin, value }: Props) {
|
||||
export default function ProgressBar({ margin, value, category }: Props) {
|
||||
const [progress, setProgress] = useState(new Animated.Value(0));
|
||||
const [totalProgress, setTotalProgress] = useState(category == 'carousel' ? 255 : 290);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Animated.timing(progress, {
|
||||
// 100% = 255
|
||||
toValue: value / 100 * 255,
|
||||
// carousel:: 100% = 255
|
||||
// page:: 100% = 290
|
||||
toValue: value / 100 * totalProgress,
|
||||
duration: 1000,
|
||||
useNativeDriver: false
|
||||
}).start();
|
||||
}, []);
|
||||
}, [value]);
|
||||
|
||||
|
||||
return (
|
||||
<View style={[Styles.contentItemCenter]}>
|
||||
|
||||
Reference in New Issue
Block a user