- more tweaks and fixes.... still not running
This commit is contained in:
@@ -38,7 +38,7 @@ UserProfileButton.propTypes = {
|
||||
isRegisteredAccount: PropTypes.bool,
|
||||
};
|
||||
|
||||
UserProfileButton.propTypes = {
|
||||
UserProfileButton.defaultProps = {
|
||||
avatarUrl: null,
|
||||
initials: null,
|
||||
isRegisteredAccount: false,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { getProfile } from '../../selectors/profile.js';
|
||||
import { commonProfileStateToProps } from './Profile.container.js';
|
||||
import { matchStateToProps as matchCommonStateProps } from './Profile.stateProps.js';
|
||||
import EditProfile from './EditProfile.js';
|
||||
|
||||
const matchStateToProps = (state) => {
|
||||
const commonProps = commonProfileStateToProps(state);
|
||||
const commonProps = matchCommonStateProps(state);
|
||||
const profile = getProfile(state);
|
||||
|
||||
return {
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { Button, Text, TextInput, View } from 'react-native';
|
||||
import { Avatar } from 'react-native-elements';
|
||||
|
||||
import { getEmailAvailability, getNomAvailability } from '../api/profile.js';
|
||||
import { getEmailAvailability, getNomAvailability } from '../../api/profile.js';
|
||||
|
||||
import EditNomDeBid from './EditNomDeBid.js';
|
||||
import styles from './Profile.styles.js';
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { getProfile, isGeneratedNomDeBid } from '../selectors/profile.js';
|
||||
|
||||
import { matchStateToProps } from './Profile.stateProps.js';
|
||||
import Profile from './Profile.js';
|
||||
|
||||
export const commonProfileStateToProps = (state) => {
|
||||
const profile = getProfile(state);
|
||||
|
||||
return {
|
||||
addresses: profile.get('addresses').toArray(),
|
||||
avatar: profile.get('avatar'),
|
||||
email: profile.get('email'),
|
||||
initials: profile.get('initials'),
|
||||
isGeneratedNomDeBid: isGeneratedNomDeBid(state),
|
||||
nomDeBid: profile.get('nomDeBid'),
|
||||
phones: profile.get('phones'),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(
|
||||
commonProfileStateToProps,
|
||||
matchStateToProps,
|
||||
null,
|
||||
)(Profile);
|
||||
|
||||
15
app/components/Profile/Profile.stateProps.js
Normal file
15
app/components/Profile/Profile.stateProps.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getProfile, isGeneratedNomDeBid } from '../../selectors/profile.js';
|
||||
|
||||
export const matchStateToProps = (state) => {
|
||||
const profile = getProfile(state);
|
||||
|
||||
return {
|
||||
addresses: profile.get('addresses').toArray(),
|
||||
avatar: profile.get('avatar'),
|
||||
email: profile.get('email'),
|
||||
initials: profile.get('initials'),
|
||||
isGeneratedNomDeBid: isGeneratedNomDeBid(state),
|
||||
nomDeBid: profile.get('nomDeBid'),
|
||||
phones: profile.get('phones'),
|
||||
};
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { getProfile } from '../../selectors/profile.js';
|
||||
import { commonProfileStateToProps } from './Profile.container.js';
|
||||
import { matchStateToProps as matchCommonStateProps } from './Profile.stateProps.js';
|
||||
import { isRegisteredAccount } from '../../selectors/profile.js';
|
||||
|
||||
import ViewProfile from './ViewProfile.js';
|
||||
|
||||
const matchStateToProps = (state) => {
|
||||
const commonProps = commonProfileStateToProps(state);
|
||||
const commonProps = matchCommonStateProps(state);
|
||||
const profile = getProfile(state);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user