LottieDelayViewで不必要と思われるPropsを削除
This commit is contained in:
parent
8a8af6f5a3
commit
ab8de7a8c0
@ -1,17 +1,11 @@
|
||||
import React, { CSSProperties, FC, useEffect, useState } from "react";
|
||||
import LottieView, { AnimationObject } from "lottie-react-native";
|
||||
import { ViewStyle } from "react-native";
|
||||
import React, { FC, useEffect, useRef, useState } from "react";
|
||||
import LottieView from "lottie-react-native";
|
||||
|
||||
type Props = {
|
||||
progress: number;
|
||||
speed: number;
|
||||
style: ViewStyle;
|
||||
source: AnimationObject;
|
||||
lottieRef: React.RefObject<LottieView>;
|
||||
loop: boolean;
|
||||
};
|
||||
export const LottieDelayView: FC<Props> = (props) => {
|
||||
const { progress, speed, style, source, lottieRef, loop } = props;
|
||||
export const LottieDelayView: FC<Props> = ({ progress }) => {
|
||||
const lottieRef = useRef<LottieView>();
|
||||
const [progressState, setProgressState] = useState(undefined);
|
||||
useEffect(() => {
|
||||
if (progress == 0) {
|
||||
@ -23,11 +17,11 @@ export const LottieDelayView: FC<Props> = (props) => {
|
||||
return (
|
||||
<LottieView
|
||||
progress={progressState}
|
||||
speed={speed}
|
||||
style={style}
|
||||
source={source}
|
||||
speed={1.4}
|
||||
style={{ width: 80, height: 80 }}
|
||||
loop={false}
|
||||
source={require("../../assets/939-star.json")}
|
||||
ref={lottieRef}
|
||||
loop={loop}
|
||||
onAnimationFinish={(isCanceled) => {
|
||||
setProgressState(progress);
|
||||
}}
|
||||
|
@ -97,7 +97,6 @@ export default function Sign(props) {
|
||||
setPreStation(returnData[0]);
|
||||
setNexStation(returnData[1]);
|
||||
};
|
||||
const lottieRef = useRef();
|
||||
const isMatsuyama = currentStation[0].StationNumber == "Y55";
|
||||
//const isMatsuyama = true;
|
||||
const favoliteChanger = () => {
|
||||
@ -133,18 +132,12 @@ export default function Sign(props) {
|
||||
backgroundColor: "#fff",
|
||||
}}
|
||||
source={{
|
||||
uri: "https://cdn.lottielab.com/l/D4m3dmEqsjVN77.json?s",
|
||||
uri: "https://cdn.lottielab.com/l/D4m3dmEqsjVN77.json",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<StationNumberMaker
|
||||
currentStation={currentStation}
|
||||
isMatsuyama={isMatsuyama}
|
||||
/>
|
||||
<StationNameArea
|
||||
currentStation={currentStation}
|
||||
isMatsuyama={isMatsuyama}
|
||||
/>
|
||||
<StationNumberMaker {...{ currentStation, isMatsuyama }} />
|
||||
<StationNameArea {...{ currentStation, isMatsuyama }} />
|
||||
{isCurrentStation ? (
|
||||
<View style={{ position: "absolute", right: 0, top: 0 }}>
|
||||
<MaterialCommunityIcons
|
||||
@ -159,14 +152,7 @@ export default function Sign(props) {
|
||||
style={{ position: "absolute", right: -15, top: -20 }}
|
||||
onPress={favoliteChanger}
|
||||
>
|
||||
<LottieDelayView
|
||||
progress={testButtonStatus ? 1 : 0}
|
||||
speed={1.4}
|
||||
style={{ width: 80, height: 80 }}
|
||||
source={require("../../assets/939-star.json")}
|
||||
lottieRef={lottieRef}
|
||||
loop={false}
|
||||
/>
|
||||
<LottieDelayView progress={testButtonStatus ? 1 : 0} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
@ -179,7 +165,6 @@ export default function Sign(props) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const styleSheet = {
|
||||
外枠: {
|
||||
width: wp("80%"),
|
||||
|
Loading…
Reference in New Issue
Block a user