made join button, made menu buttons
This commit is contained in:
@@ -17,7 +17,9 @@ import RunInfoNumeric from './components/run-info-num';
|
|||||||
|
|
||||||
import MapView from 'react-native-maps';
|
import MapView from 'react-native-maps';
|
||||||
import NewButton from "./components/new-button";
|
import NewButton from "./components/new-button";
|
||||||
|
import JoinButton from "./components/join-button";
|
||||||
import CapturedArea from "./components/captured-area";
|
import CapturedArea from "./components/captured-area";
|
||||||
|
import RoomInput from "./components/room-input";
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
ios: 'Press Cmd+R to reload,\n' +
|
ios: 'Press Cmd+R to reload,\n' +
|
||||||
'Cmd+D or shake for dev menu',
|
'Cmd+D or shake for dev menu',
|
||||||
@@ -93,7 +95,6 @@ export default class App extends Component<Props> {
|
|||||||
strokeWidth={5}
|
strokeWidth={5}
|
||||||
/>
|
/>
|
||||||
{this.state.captures.map((capture, i) => {
|
{this.state.captures.map((capture, i) => {
|
||||||
{console.log(capture);}
|
|
||||||
return <MapView.Polygon
|
return <MapView.Polygon
|
||||||
key={i}
|
key={i}
|
||||||
coordinates={capture.coordinates}
|
coordinates={capture.coordinates}
|
||||||
@@ -105,22 +106,23 @@ export default class App extends Component<Props> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
</MapView>
|
</MapView>
|
||||||
<View style={styles.infoWrapper}>
|
<RoomInput/>
|
||||||
|
<View style={styles.menu}>
|
||||||
|
|
||||||
|
<View style={styles.new}>
|
||||||
|
<NewButton erase={() => {this.setState({walkMarkers: []})}}/>
|
||||||
|
</View>
|
||||||
|
|
||||||
{/*<RunInfoNumeric title = "Distance"*/}
|
<View style={styles.infoWrapper}>
|
||||||
{/*unit="km"*/}
|
|
||||||
{/*ref={(info) => this.distanceInfo = info}*/}
|
<JoinButton join={() => {}}/>
|
||||||
{/*/>*/}
|
<JoinButton join={() => {}}/>
|
||||||
{/*<RunInfoNumeric title = "Speed"*/}
|
<JoinButton join={() => {}}/>
|
||||||
{/*unit="km/h"*/}
|
<JoinButton join={() => {}}/>
|
||||||
{/*ref={(info) => this.speedInfo = info}*/}
|
|
||||||
{/*/>*/}
|
|
||||||
{/*<RunInfo title = "Direction"*/}
|
</View>
|
||||||
{/*value = "NE"*/}
|
</View>
|
||||||
{/*ref={(info) => this.directionInfo = info}*/}
|
|
||||||
{/*/>*/}
|
|
||||||
<NewButton erase={() => {this.setState({walkMarkers: []})}}/>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -128,10 +130,29 @@ export default class App extends Component<Props> {
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
infoWrapper: {
|
infoWrapper: {
|
||||||
|
// position: 'absolute',
|
||||||
|
// left: 0,
|
||||||
|
// bottom: 0,
|
||||||
|
// right: 0,
|
||||||
|
paddingVertical: 0,
|
||||||
|
flexDirection: 'row',
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
menu: {
|
||||||
|
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
|
flexDirection: 'column',
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
new: {
|
||||||
|
// position: 'absolute',
|
||||||
|
// left: 0,
|
||||||
|
// bottom: 60,
|
||||||
|
// right: 0,
|
||||||
|
paddingHorizontal: 10,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flex: 1
|
flex: 1
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import sharedStyles from '../shared-styles';
|
||||||
|
import {
|
||||||
|
TouchableHighlight,
|
||||||
|
Platform,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
|
export default class JoinButton extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.join = this.props.join;
|
||||||
|
this.state = { value: this.props.value};
|
||||||
|
}
|
||||||
|
|
||||||
|
formatValue() {
|
||||||
|
return this.state.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<View style ={[sharedStyles.runInfoWrapper, {flex: 1}]}>
|
||||||
|
<TouchableHighlight
|
||||||
|
onPress= {() => this.join()}
|
||||||
|
// style={sharedStyles.new}
|
||||||
|
>
|
||||||
|
<Text style={{fontSize: 25, textAlign: 'center'}}>Join</Text>
|
||||||
|
</TouchableHighlight>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,12 +21,17 @@ export default class NewButton extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style ={[sharedStyles.runInfoWrapper, {flex: 1}]}>
|
<View style ={[{paddingVertical: 15}, {flex: 1}]}>
|
||||||
<TouchableHighlight
|
<TouchableHighlight
|
||||||
onPress= {() => this.erase()}
|
onPress= {() => this.erase()}
|
||||||
// style={sharedStyles.new}
|
// style={sharedStyles.new}
|
||||||
>
|
>
|
||||||
<Text style={{fontSize: 25, textAlign: 'center'}}>New</Text>
|
<Text style={{
|
||||||
|
paddingVertical: 10,
|
||||||
|
fontSize: 30,
|
||||||
|
backgroundColor: 'rgba(0,255,0,0.5)',
|
||||||
|
textAlign: 'center'}}>Start Capture</Text>
|
||||||
|
|
||||||
</TouchableHighlight>
|
</TouchableHighlight>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ import { StyleSheet} from 'react-native';
|
|||||||
|
|
||||||
export default StyleSheet.create({
|
export default StyleSheet.create({
|
||||||
runInfoWrapper: {
|
runInfoWrapper: {
|
||||||
backgroundColor: 'rgba(255,255,255,0.75)',
|
backgroundColor: 'rgba(255,255,255,1)',
|
||||||
paddingVertical: 15
|
paddingVertical: 15
|
||||||
},
|
},
|
||||||
runInfoTitle: {
|
runInfoTitle: {
|
||||||
|
|||||||
Reference in New Issue
Block a user