Skip to content

Commit

Permalink
fix: renamed SkiaSkottieView -> Skottie
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Renamed view
  • Loading branch information
hannojg committed Dec 14, 2023
1 parent 306d05a commit d1cae7f
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 245 deletions.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@ yarn add react-native-skottie
```tsx
import * as React from 'react';

import { StyleSheet, SafeAreaView } from 'react-native';
import { SkiaSkottieView } from 'react-native-skottie';
import { SafeAreaView } from 'react-native';
import { Skottie } from 'react-native-skottie';
import HandsLottie from './Hands.json';

export default function App() {
return (
<SafeAreaView style={styles.flex1}>
<Skottie style={styles.flex1}>
<SkiaSkottieView style={styles.flex1} source={HandsLottie} />
</SafeAreaView>
</Skottie>
);
}

const styles = StyleSheet.create({
flex1: {
flex: 1,
},
});
```

## Contributing
Expand Down
18 changes: 7 additions & 11 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
Switch,
} from 'react-native';
import {
SkiaSkottieView,
Skottie,
AnimationObject,
type SkiaSkottieViewRef,
type SkottieViewRef,
SkottieAPI,
} from 'react-native-skottie';
import * as Animations from './animations';
Expand All @@ -32,7 +32,7 @@ const animations = {

function SkottieAnimation({ source }: { source: AnimationObject }) {
return (
<SkiaSkottieView
<Skottie
resizeMode="contain"
style={styles.flex1}
source={source}
Expand All @@ -55,7 +55,7 @@ function LottieAnimation({ source }: { source: AnimationObject }) {
}

function SkottieImperativeAPI({ source }: { source: AnimationObject }) {
const skottieRef = React.useRef<SkiaSkottieViewRef>(null);
const skottieRef = React.useRef<SkottieViewRef>(null);

return (
<View style={styles.flex1}>
Expand All @@ -77,7 +77,7 @@ function SkottieImperativeAPI({ source }: { source: AnimationObject }) {
skottieRef.current?.reset();
}}
/>
<SkiaSkottieView
<Skottie
ref={skottieRef}
resizeMode="contain"
style={styles.flex1}
Expand Down Expand Up @@ -167,7 +167,7 @@ function SkottiePropsAPI({ source }: { source: AnimationObject }) {
setSpeed((p) => p + 1);
}}
/>
<SkiaSkottieView
<Skottie
resizeMode="contain"
style={styles.flex1}
source={source}
Expand Down Expand Up @@ -203,11 +203,7 @@ function SkottieProgressAPI({ source }: { source: AnimationObject }) {
return (
<View style={styles.flex1}>
<Text style={styles.heading}>Progress controlled example</Text>
<SkiaSkottieView
source={animation}
progress={progress}
style={styles.flex1}
/>
<Skottie source={animation} progress={progress} style={styles.flex1} />
</View>
);
}
Expand Down
223 changes: 0 additions & 223 deletions src/SkiaSkottieView.tsx

This file was deleted.

Loading

0 comments on commit d1cae7f

Please sign in to comment.