-
Notifications
You must be signed in to change notification settings - Fork 0
/
App1.js
29 lines (20 loc) · 958 Bytes
/
App1.js
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
import React, { useState } from 'react';
import { Dimensions, View, StyleSheet, TouchableWithoutFeedback, BackHandler, Text } from 'react-native';
import Player from './client/routes/Player.js';
import Playlist from './client/Playlist.js';
import UserMessage from './client/UserMessage.js';
import { palette, messages } from './client/SharedUtilities.js';
const { black } = palette;
export default function App() {
const [windowW, setW] = useState(Dimensions.get('window').width);
const [windowH, setH] = useState(Dimensions.get('window').height);
Dimensions.addEventListener('change', change => {
setW(change.window.width);
setH(change.window.height);
});
const [userMessage, setUserMessage] = useState(null);
Object.keys(require('./server/musicData.json')).forEach(({title}) => Playlist.add(title))
return (
<Player window={{width: windowW, height: windowH}} Playlist={Playlist} setUserMessage={setUserMessage}/>
);
}