front:
Deskripsi: - progress - judul pada carousel paper No Issues
This commit is contained in:
@@ -6,18 +6,19 @@ import { Animated, View } from "react-native";
|
||||
type Props = {
|
||||
margin?: number
|
||||
value: number
|
||||
category: "page" | "carousel"
|
||||
category: "page" | "carousel" | "list"
|
||||
}
|
||||
|
||||
export default function ProgressBar({ margin, value, category }: Props) {
|
||||
const [progress, setProgress] = useState(new Animated.Value(0));
|
||||
const [totalProgress, setTotalProgress] = useState(category == 'carousel' ? 255 : 290);
|
||||
const [totalProgress, setTotalProgress] = useState(category == 'carousel' ? 232 : category == 'page' ? 245 : 290);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Animated.timing(progress, {
|
||||
// carousel:: 100% = 255
|
||||
// page:: 100% = 290
|
||||
// wrapbar :: 90%
|
||||
toValue: value / 100 * totalProgress,
|
||||
duration: 1000,
|
||||
useNativeDriver: false
|
||||
|
||||
Reference in New Issue
Block a user