- more tweaks and fixes.... still not running

This commit is contained in:
2019-08-09 02:01:39 -04:00
parent e07a4cb2b9
commit e6a4eeaeb1
9 changed files with 34 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
import { List } from 'immutable'; import { List } from 'immutable';
import { fetchAuctionStatus as fetchActionStatusApi } from '../api/actionStatus.js'; import { fetchAuctionStatus as fetchActionStatusApi } from '../api/auctionStatus.js';
import { AUCTIONS_UPDATED } from '../constants/actionTypes.js'; import { AUCTIONS_UPDATED } from '../constants/actionTypes.js';
import { getActiveEventId } from '../selectors/activeEvent.js'; import { getActiveEventId } from '../selectors/activeEvent.js';
import { getAuthToken } from '../selectors/auth.js'; import { getAuthToken } from '../selectors/auth.js';

View File

@@ -38,7 +38,7 @@ UserProfileButton.propTypes = {
isRegisteredAccount: PropTypes.bool, isRegisteredAccount: PropTypes.bool,
}; };
UserProfileButton.propTypes = { UserProfileButton.defaultProps = {
avatarUrl: null, avatarUrl: null,
initials: null, initials: null,
isRegisteredAccount: false, isRegisteredAccount: false,

View File

@@ -1,11 +1,11 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getProfile } from '../../selectors/profile.js'; 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'; import EditProfile from './EditProfile.js';
const matchStateToProps = (state) => { const matchStateToProps = (state) => {
const commonProps = commonProfileStateToProps(state); const commonProps = matchCommonStateProps(state);
const profile = getProfile(state); const profile = getProfile(state);
return { return {

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Button, Text, TextInput, View } from 'react-native'; import { Button, Text, TextInput, View } from 'react-native';
import { Avatar } from 'react-native-elements'; 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 EditNomDeBid from './EditNomDeBid.js';
import styles from './Profile.styles.js'; import styles from './Profile.styles.js';

View File

@@ -1,24 +1,9 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getProfile, isGeneratedNomDeBid } from '../selectors/profile.js'; import { matchStateToProps } from './Profile.stateProps.js';
import Profile from './Profile.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( export default connect(
commonProfileStateToProps, matchStateToProps,
null, null,
)(Profile); )(Profile);

View 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'),
};
};

View File

@@ -1,13 +1,13 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { getProfile } from '../../selectors/profile.js'; 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 { isRegisteredAccount } from '../../selectors/profile.js';
import ViewProfile from './ViewProfile.js'; import ViewProfile from './ViewProfile.js';
const matchStateToProps = (state) => { const matchStateToProps = (state) => {
const commonProps = commonProfileStateToProps(state); const commonProps = matchCommonStateProps(state);
const profile = getProfile(state); const profile = getProfile(state);
return { return {

View File

@@ -6,10 +6,9 @@ import { getEventsAsList } from '../selectors/events.js';
import Events from './Events.js'; import Events from './Events.js';
const matchStateToProps = (state) => { const matchStateToProps = (state) => ({
const events = getEventsAsList(state); events: getEventsAsList(state),
return { events }; });
};
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({
fetchEvents: () => dispatch(fetchEvents()), fetchEvents: () => dispatch(fetchEvents()),

View File

@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import { FlatList, StyleSheet, View } from 'react-native'; import { FlatList, StyleSheet, View } from 'react-native';
import EventListItem from '../components/Events/EventListItem.js'; import EventListItem from '../containers/Events/EventListItem.js';
export default class Events extends Component { export default class Events extends Component {
static get propTypes() { static get propTypes() {
@@ -17,20 +17,15 @@ export default class Events extends Component {
static get defaultProps() { static get defaultProps() {
return { return {
events: new List(), events: [],
}; };
} }
constructor(props) { constructor(props) {
super(props); super(props);
this._setActiveEvent = this.setActiveEvent.bind(this); this._setActiveEvent = this.setActiveEvent.bind(this);
} }
componentDidMount() {
this.props.fetchEvents();
}
setActiveEvent(eventId) { setActiveEvent(eventId) {
this.props.setActiveEvent(eventId); this.props.setActiveEvent(eventId);
} }
@@ -38,7 +33,7 @@ export default class Events extends Component {
_keyExtractor = (event, index) => `${event.id}_${index}`; _keyExtractor = (event, index) => `${event.id}_${index}`;
_renderEventListItem = ({ event }) => ( _renderEventListItem = ({ event }) => (
<EventListItem {...event} setActiveEvent={this.setActiveEvent} /> <EventListItem event={event} setActiveEvent={this.setActiveEvent} />
); );
render() { render() {
@@ -67,5 +62,8 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
backgroundColor: '#F5FCFF', backgroundColor: '#F5FCFF',
}, },
eventListContentContainer: {}, eventListContentContainer: {
alignItems: 'stretch',
justifyContent: 'flex-start',
},
}); });