Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
punksta committed Apr 20, 2019
1 parent ea59c04 commit dc89ceb
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 29 deletions.
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export default class Root extends React.Component {
};

componentDidMount() {
initStore();
initNavigator();
this.setState({
loaded: true
});
initStore();
initNavigator();
this.setState({
loaded: true
});
}
render() {
return (
Expand Down
1 change: 0 additions & 1 deletion src/components/PreviewItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Image, View} from "react-native";
import React from "react";
import {onlyUpdateForKeys} from "recompose";


const GameItem = ({item, style}) => {
return <Image resizeMode={"contain"} source={item.resource} style={style} />;
};
Expand Down
2 changes: 1 addition & 1 deletion src/containers/GameBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class GameBoard<ItemT> extends React.Component<Props<ItemT>, State<ItemT>> {
const actionItems = props.gameSettings.uniqueItems
.map((item, index) => [item, index])
// $FlowFixMe
.filter(([item]) => item['action']);
.filter(([item]) => item["action"]);

[item, index] = actionItems[getRandomIndex(actionItems.length)];
} else {
Expand Down
7 changes: 6 additions & 1 deletion src/containers/GameScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@ const Connected = connect(
(state, ownProps) => {
const {gameSettings, level, levelIndex} =
ownProps.navigation?.state?.params || {};
return {gameSettings, level, levelIndex, isMusicEnabled: state.settings.isMusicEnabled};
return {
gameSettings,
level,
levelIndex,
isMusicEnabled: state.settings.isMusicEnabled
};
},
mapDispatchToProps
)(GameScreen);
Expand Down
3 changes: 1 addition & 2 deletions src/containers/MainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HomeScreenBackground from "../components/HomeScreenBackground";
import Info from "../components/Info";
import AppearOnMount from "../components/AppearOnMount";
import ConnectedUserDegree from "../components/ConnectedUserDegree";
import MusicController from "./MusicController"
import MusicController from "./MusicController";

import PopupDialog, {SlideAnimation} from "react-native-popup-dialog";

Expand Down Expand Up @@ -63,7 +63,6 @@ const MainScreen = ({
newGameClick={newGameClick}
/>
<MusicController />

</View>
</AppearOnMount>

Expand Down
18 changes: 9 additions & 9 deletions src/containers/TouchableFalling.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class TouchableFalling extends React.Component {
}
};

playDissapearAnimation = (onEnd) => {
playDissapearAnimation = onEnd => {
Animated.timing(this.dissapearAnimation, {
toValue: 1,
duration: 400,
easing: Easing.bezier(.17,.67,.89,.65),
easing: Easing.bezier(0.17, 0.67, 0.89, 0.65),
useNativeDriver: true,
onComplete: ({finished}) => finished && this.props.onAnimdationEnded()
}).start()
}
}).start();
};

startFallingAnimation = (delaySpin = 0) => {
const currentY = Math.abs(
Expand Down Expand Up @@ -95,7 +95,7 @@ class TouchableFalling extends React.Component {
return;
}
if (event.nativeEvent.state === State.BEGAN) {
this.touched= true;
this.touched = true;
this.props.onActionPerformed();
this.fallingAnimation?.stop();
this.playDissapearAnimation();
Expand All @@ -110,15 +110,15 @@ class TouchableFalling extends React.Component {
outputRange: ["0deg", "360deg", "720deg"]
});

const dissapearApha = this.dissapearAnimation.interpolate(({
const dissapearApha = this.dissapearAnimation.interpolate({
inputRange: [0, 0.7, 1],
outputRange: [1, 1, 0]
}))
});

const dissapearScale = this.dissapearAnimation.interpolate(({
const dissapearScale = this.dissapearAnimation.interpolate({
inputRange: [0, 1],
outputRange: [1, 1.2]
}))
});

const panStyle = {
opacity: dissapearApha,
Expand Down
15 changes: 5 additions & 10 deletions src/utils/music.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
const Sound = require('react-native-sound');
const Sound = require("react-native-sound");

const FailureCat = new Sound('angry_cat.mp3', Sound.MAIN_BUNDLE, (error) => {
const FailureCat = new Sound("angry_cat.mp3", Sound.MAIN_BUNDLE, error => {});

});

const FailureDog = new Sound('angry_dog.was', Sound.MAIN_BUNDLE, (error) => {

});
const FailureDog = new Sound("angry_dog.was", Sound.MAIN_BUNDLE, error => {});

export const playFailureCat = () => {
if (FailureCat.isPlaying) {
FailureCat.stop(() => FailureCat.play());
} else {
FailureCat.play();
}
}

};

export const playFailureDog = () => {
if (FailureDog.isPlaying) {
FailureDog.stop(() => FailureDog.play());
} else {
FailureDog.play();
}
}
};

0 comments on commit dc89ceb

Please sign in to comment.