Skip to content
Snippets Groups Projects
Commit 2ef0e142 authored by Wietse Kuipers's avatar Wietse Kuipers
Browse files

Basis profile-view

parent 145e2f42
Branches profile-view
No related tags found
No related merge requests found
......@@ -6,3 +6,7 @@ export const LOGINSUCCESS = 'LOGINSUCCESS';
export const LOGINFAILURE = 'LOGINFAILURE';
export const LOGOUT = 'LOGOUT';
export const OPENDRAWER = 'OPENDRAWER';
export const PROFILEINIT = 'PROFILEINIT';
export const PROFILEPROGRESS = 'PROFILEPROGRESS';
export const PROFILESUCCESS = 'PROFILESUCCESS';
export const PROFILEFAILURE = 'PROFILEFAILURE';
import * as types from './actionTypes';
export function profileInit() {
return {
type: types.PROFILEINIT,
};
}
export function profileProgress() {
return {
type: types.PROFILEPROGRESS,
};
}
import React from 'react';
import { View, Text } from 'react-native';
import { View, Text, Button } from 'react-native';
import { connect } from 'react-redux';
import { logout } from '../actions/login';
import { profileInit } from '../actions/profile';
const Welcome = props =>
const Profile = props =>
<View>
<Text>Profielen en shit</Text>
<Button title="wauw" onPress={() => props.init()} />
</View>;
Welcome.propTypes = {
logout: React.PropTypes.func.isRequired,
Profile.propTypes = {
init: React.PropTypes.func.isRequired,
};
const mapStateToProps = state => ({
username: state.login.username,
token: state.login.token,
});
const mapDispatchToProps = dispatch => ({
logout: () => dispatch(logout()),
init: () => dispatch(profileInit()),
});
export default connect(() => ({}), mapDispatchToProps)(Welcome);
export default connect(mapStateToProps, mapDispatchToProps)(Profile);
import login from './login';
import navigation from './navigation';
import profile from './profile';
export {
login,
navigation,
profile,
};
import * as types from '../actions/actionTypes';
const initialState = {
name: '',
birthday: '',
starting_year: '',
programme: '',
};
export default function profile(state = initialState, action = {}) {
switch (action.type) {
case types.PROFILEINIT:
return state;
default:
return state;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment