moved deck stuff away from app
This commit is contained in:
parent
66ae1bd758
commit
5d254ee0e1
17
src/App.tsx
17
src/App.tsx
@ -11,26 +11,15 @@
|
||||
import React from 'react';
|
||||
import {SafeAreaView, StatusBar} from 'react-native';
|
||||
import Deck from './components/Deck';
|
||||
import DeckButton from './components/DeckButton';
|
||||
|
||||
declare const global: {HermesInternal: null | {}};
|
||||
|
||||
const App = () => {
|
||||
const buttons = [];
|
||||
|
||||
for (let i = 0; i < 21; i++) {
|
||||
let text = 'btn' + i;
|
||||
buttons.push(<DeckButton text={text} key={i} />);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<>
|
||||
<StatusBar hidden={true} />
|
||||
<SafeAreaView>
|
||||
<Deck>{buttons}</Deck>
|
||||
<Deck />
|
||||
</SafeAreaView>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
}
|
||||
|
@ -1,14 +1,23 @@
|
||||
import React, {PropsWithChildren, useEffect} from 'react';
|
||||
import React, {useEffect} from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
import Orientation from 'react-native-orientation-locker';
|
||||
import DeckButton from './DeckButton';
|
||||
|
||||
export default function Deck(props: PropsWithChildren<{}>) {
|
||||
export default function Deck() {
|
||||
useEffect(() => {
|
||||
Orientation.lockToPortrait();
|
||||
});
|
||||
|
||||
const buttons = [];
|
||||
|
||||
for (let i = 0; i < 21; i++) {
|
||||
let text = 'btn' + i;
|
||||
buttons.push(<DeckButton text={text} key={i} />);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<View style={style.view}>{props.children}</View>
|
||||
<View style={style.view}>{buttons}</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user