This repository has been archived by the owner on Nov 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
37a108d
commit 2586a41
Showing
6 changed files
with
210 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,71 @@ | ||
import React from 'react'; | ||
import { TouchableOpacity, Text, View, } from 'react-native'; | ||
import Modal from 'react-native-modal'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { darktheme } from '../../data/color'; | ||
import { ModalStyles } from './styles'; | ||
|
||
import { GameConfig } from '../../utils/types'; | ||
|
||
interface ModalProps { | ||
onSaveGame: () => void, | ||
onNewGame: () => void, | ||
score: number, | ||
highestTile: number, | ||
open: boolean, | ||
} | ||
|
||
class BoardView extends React.Component<ModalProps> { | ||
|
||
render() { | ||
return ( | ||
<Modal | ||
backdropOpacity={0.9} | ||
isVisible={this.props.open} | ||
> | ||
<View style={ModalStyles.modalRoot}> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.textColor }}> | ||
<Text style={{ color: darktheme.accentColor }}>G A M E</Text> O V E R | ||
</Text> | ||
<View style={ModalStyles.statsContainer}> | ||
<View style={ModalStyles.statsRow}> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.accentColor }}> | ||
Score : | ||
</Text> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.textColor }}> | ||
{this.props.score} | ||
</Text> | ||
</View> | ||
<View style={ModalStyles.statsRow}> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.accentColor }}> | ||
Highest Tile : | ||
</Text> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.textColor }}> | ||
{this.props.highestTile} | ||
</Text> | ||
</View> | ||
</View> | ||
<View style={ModalStyles.optionBar}> | ||
<TouchableOpacity onPress={this.props.onSaveGame}> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.accentColor }}> | ||
SAVE RECORD | ||
</Text> | ||
</TouchableOpacity> | ||
<TouchableOpacity onPress={this.props.onNewGame}> | ||
<Text style={{ ...ModalStyles.text, color: darktheme.textColor }}> | ||
NEW GAME | ||
</Text> | ||
</TouchableOpacity> | ||
</View> | ||
</View> | ||
</Modal> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = state => ({ | ||
|
||
}); | ||
|
||
export default connect(mapStateToProps)(BoardView); |
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,37 @@ | ||
import { Dimensions, StyleSheet } from 'react-native'; | ||
|
||
const screenWidth = Dimensions.get('screen').width; | ||
|
||
export const ModalStyles = StyleSheet.create({ | ||
modalRoot: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
height: 300, | ||
}, | ||
text: { | ||
fontSize: 20, | ||
}, | ||
statsContainer: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
height: 70, | ||
}, | ||
statsRow: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
width: screenWidth * 0.7 | ||
}, | ||
optionBar: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
width: screenWidth * 0.7 | ||
} | ||
}); |