-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f951cc
commit 9a73a34
Showing
6 changed files
with
171 additions
and
10 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, {Component} from 'react'; | ||
import { | ||
Text, | ||
View, | ||
registerComponent, | ||
StyleSheet, | ||
Dimensions, | ||
} from '../../react-ape/reactApeEntry'; | ||
|
||
import Spinner from './Spinner'; | ||
|
||
const {width, height} = Dimensions.get('screen'); | ||
|
||
// Create Custom Components | ||
const custom = { | ||
Spinner: registerComponent('Spinner', Spinner), | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
position: 'absolute', | ||
left: width / 2 - 40, | ||
top: height / 4, | ||
backgroundColor: '#1C1E21', | ||
} | ||
}); | ||
|
||
class Loader extends Component { | ||
_interval = null; | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
degrees: 0.0, | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
this._interval = setInterval(() => { | ||
const {degrees} = this.state; | ||
this.setState({degrees: degrees + 0.1}); | ||
}, 10); | ||
} | ||
|
||
componentWillUnmount() { | ||
clearInterval(this._interval); | ||
} | ||
|
||
render() { | ||
const {degrees} = this.state; | ||
return ( | ||
<View style={ styles.container }> | ||
<custom.Spinner degrees={degrees} style={{ top: height / 4 + 8, left: width / 2 - 60, color: 'white' }} /> | ||
<Text style={{ color: 'white' }}>Loading Store...</Text> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
export default Loader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, {Component} from 'react'; | ||
import { | ||
Text, | ||
View, | ||
registerComponent, | ||
StyleSheet, | ||
Dimensions, | ||
} from '../../react-ape/reactApeEntry'; | ||
|
||
const { width, height } = Dimensions.get('screen'); | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
position: 'absolute', | ||
left: 200, | ||
top: 0, | ||
height, | ||
width, | ||
backgroundColor: 'white', | ||
color: 'orange' | ||
} | ||
}); | ||
|
||
class Store extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
componentDidMount() { | ||
|
||
} | ||
|
||
render() { | ||
return ( | ||
<View style={ styles.container }> | ||
<Text>Store...</Text> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
export default Store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
export default [ | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
{ | ||
name: 'Suikoden 2', | ||
price: 18.9, | ||
imageSrc: 'suikoden-2.jpeg' | ||
}, | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function loadImage(url) { | ||
return new Promise(resolve => { | ||
const image = new Image(); | ||
image.addEventListener('load', () => { | ||
resolve(image); | ||
}); | ||
image.src = url; | ||
}); | ||
} | ||
|
||
export default loadImage; |