-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
48 lines (45 loc) · 1.26 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { useState, useEffect } from "react";
import { Asset } from "expo-asset";
import { StatusBar } from "react-native";
import { AppLoading } from "expo";
import Album from "./components/Album";
import { Album as AlbumModel } from "./components/Model";
const album: AlbumModel = {
name: "Remote Control",
artist: "Jan Blomqvist",
release: 2016,
// eslint-disable-next-line global-require
cover: require("./assets/Jan-Blomqvist.jpg"),
tracks: [
{ name: "Stories Over" },
{ name: "More", artist: "Jan Blomqvist, Elena Pitoulis" },
{ name: "Empty Floor" },
{ name: "Her Great Escape" },
{ name: "Dark Noise" },
{ name: "Drift", artist: "Jan Blomqvist, Aparde" },
{ name: "Same Mistake" },
{ name: "Dancing People Are Never Wrong", artist: "Jan Blomqvist, The Bianca Story" },
{ name: "Back in the Taxi" },
{ name: "Ghosttrack" },
{ name: "Just OK" },
{ name: "The End" },
],
};
export default () => {
const [ready, setReady] = useState(false);
useEffect(() => {
(async () => {
await Asset.loadAsync(album.cover);
setReady(true);
})();
});
if (!ready) {
return <AppLoading />;
}
return (
<>
<StatusBar barStyle="light-content" />
<Album {...{ album }} />
</>
);
};