Browse Source

Functional components

pull/1/head
Tim Glasgow 2 years ago
parent
commit
b54f379fec
  1. 34
      squarenotsquare/components/Game.js
  2. 34
      squarenotsquare/components/HighScore.js
  3. 34
      squarenotsquare/components/Home.js
  4. 34
      squarenotsquare/components/Settings.js
  5. 36
      squarenotsquare/components/Splash.js
  6. 18
      squarenotsquare/navigation/SquareStack.js

34
squarenotsquare/components/Game.js

@ -1,38 +1,14 @@
import React, { Component } from "react";
import React from "react";
import { Text, View } from "react-native";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { useState } from "react";
class Game extends Component {
constructor(props){
super(props)
this.state = {
function Game(props){
}
//props.someNavAction, 5000
//setTimeout(null, 5000);
}
render () {
return (
<View>
<Text>test</Text>
<Text style={{color: 'black'}}>test</Text>
</View>
);
};
}
function mapStateToProps(){
}
const mapDispatchToProps = (dispatch) => {
let actions = {
//...someActionsGroup
};
return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Game);
export default Game;

34
squarenotsquare/components/HighScore.js

@ -1,38 +1,14 @@
import React, { Component } from "react";
import React from "react";
import { Text, View } from "react-native";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { useState } from "react";
class HighScore extends Component {
constructor(props){
super(props)
this.state = {
function HighScore(props){
}
//props.someNavAction, 5000
//setTimeout(null, 5000);
}
render () {
return (
<View>
<Text>test</Text>
<Text style={{color: 'black'}}>test</Text>
</View>
);
};
}
function mapStateToProps(){
}
const mapDispatchToProps = (dispatch) => {
let actions = {
//...someActionsGroup
};
return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(HighScore);
export default HighScore;

34
squarenotsquare/components/Home.js

@ -1,38 +1,14 @@
import React, { Component } from "react";
import React from "react";
import { Text, View } from "react-native";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { useState } from "react";
class Home extends Component {
constructor(props){
super(props)
this.state = {
function Home(props){
}
//props.someNavAction, 5000
//setTimeout(null, 5000);
}
render () {
return (
<View>
<Text>test</Text>
<Text style={{color: 'black'}}>test</Text>
</View>
);
};
}
function mapStateToProps(){
}
const mapDispatchToProps = (dispatch) => {
let actions = {
//...someActionsGroup
};
return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Home);
export default Home;

34
squarenotsquare/components/Settings.js

@ -1,38 +1,14 @@
import React, { Component } from "react";
import React from "react";
import { Text, View } from "react-native";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { useState } from "react";
class Settings extends Component {
constructor(props){
super(props)
this.state = {
function Settings(props){
}
//props.someNavAction, 5000
//setTimeout(null, 5000);
}
render () {
return (
<View>
<Text>test</Text>
<Text style={{color: 'black'}}>test</Text>
</View>
);
};
}
function mapStateToProps(){
}
const mapDispatchToProps = (dispatch) => {
let actions = {
//...someActionsGroup
};
return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Settings);
export default Settings;

36
squarenotsquare/components/Splash.js

@ -1,40 +1,14 @@
import React, { Component } from "react";
import React from "react";
import { Text, View } from "react-native";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { useState } from "react";
class Splash extends Component {
constructor(props){
super(props)
this.state = {
function Splash(props){
}
//props.someNavAction, 5000
//setTimeout(null, 5000);
}
render () {
return (
<View>
<Text>test</Text>
<Text style={{color: 'black'}}>test</Text>
</View>
);
};
}
function mapStateToProps(){
return {
//system: state.system,
}
}
const mapDispatchToProps = (dispatch) => {
let actions = {
//...someActionsGroup
};
return bindActionCreators(actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Splash);
export default Splash;

18
squarenotsquare/navigation/SquareStack.js

@ -1,4 +1,4 @@
import React, {Component} from 'react';
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {connect} from 'react-redux';
@ -12,8 +12,7 @@ import Splash from '../components/Splash';
const SquareNav = createStackNavigator();
class SquareStack extends Component {
render() {
function SquareStack() {
let noHeader = {headerShown: false};
return (
@ -48,16 +47,5 @@ class SquareStack extends Component {
</NavigationContainer>
)
}
}
function mapStateToProps(state) {
return {
Navigation: state.Navigation
}
}
function mapDispatchToProps(dispatch) {
return {dispatch: dispatch};
}
export default connect(mapStateToProps, mapDispatchToProps)(SquareStack)
export default SquareStack;
Loading…
Cancel
Save