- Reorg andf cleanup. Maintainability.

This commit is contained in:
2019-08-09 02:52:31 -04:00
parent e6a4eeaeb1
commit 0f618fdd78
13 changed files with 16 additions and 38 deletions

View File

@@ -39,7 +39,6 @@ HeaderContentLeft.propTypes = {
activeRoute: PropTypes.string.isRequired, activeRoute: PropTypes.string.isRequired,
hasActiveEvent: PropTypes.bool, hasActiveEvent: PropTypes.bool,
hasMultipleEvents: PropTypes.bool, hasMultipleEvents: PropTypes.bool,
navigation: PropTypes.func.isRequired,
}; };
HeaderContentLeft.defaultProps = { HeaderContentLeft.defaultProps = {

View File

@@ -50,7 +50,6 @@ HeaderTitle.propTypes = {
activeRoute: PropTypes.string.isRequired, activeRoute: PropTypes.string.isRequired,
hasActiveEvent: PropTypes.bool, hasActiveEvent: PropTypes.bool,
hasMultipleEvents: PropTypes.bool.isRequired, hasMultipleEvents: PropTypes.bool.isRequired,
navigation: PropTypes.func.isRequired,
}; };
HeaderTitle.defaultProps = { HeaderTitle.defaultProps = {

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { TouchableOpacity } from 'react-native'; import { TouchableOpacity } from 'react-native';
import { Icon } from 'react-native-elements'; import Icon from 'react-native-vector-icons';
export default function BackIcon({ action }) { export default function BackIcon({ action }) {
return ( return (

View File

@@ -5,7 +5,7 @@ import { TouchableOpacity } from 'react-native';
import { Icon } from 'react-native-elements'; import { Icon } from 'react-native-elements';
export default function EventsIcon({ action }) { export default function EventsIcon({ action }) {
const renderEventsIcon = () => <Icon name="ei-calendar" type="evilicons" size={28} />; const renderEventsIcon = () => <Icon name="calendar" type="evilicon" size={28} />;
if (action) { if (action) {
return <TouchableOpacity onPress={action}>{renderEventsIcon()}</TouchableOpacity>; return <TouchableOpacity onPress={action}>{renderEventsIcon()}</TouchableOpacity>;

View File

@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
import { placeBid } from '../../actions/auction.js'; import { placeBid } from '../../actions/auction.js';
import AuctionListItem from '../../components/Auction/AuctionListItem.js'; import AuctionListItem from './AuctionListItem.js';
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
const { item } = ownProps; const { item } = ownProps;
@@ -27,5 +27,5 @@ const mapDispatchToProps = (dispatch) => ({
export default connect( export default connect(
mapStateToProps, mapStateToProps,
null, mapDispatchToProps,
)(AuctionListItem); )(AuctionListItem);

View File

@@ -5,8 +5,8 @@ import { StyleSheet, TouchableOpacity, Text, Image, View } from 'react-native';
import GallerySwiper from 'react-native-gallery-swiper'; import GallerySwiper from 'react-native-gallery-swiper';
import AuctionPriceAndBidCount from '../../containers/Auction/AuctionPriceAndBidCount.js'; import AuctionPriceAndBidCount from './AuctionPriceAndBidCount.container.js';
import BidStatus from '../../containers/Auction/BidStatus.js'; import BidStatus from './BidStatus.container.js';
import { ITEM_TYPES } from '../../constants/constants.js'; import { ITEM_TYPES } from '../../constants/constants.js';
import { formatPrice, getAuctionTime } from '../../library/helpers.js'; import { formatPrice, getAuctionTime } from '../../library/helpers.js';

View File

@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
import { getItemBidCount, getItemPrice } from '../../selectors/auctions.js'; import { getItemBidCount, getItemPrice } from '../../selectors/auctions.js';
import AuctionPriceAndBidCount from '../../components/Auction/AuctionPriceAndBidCount.js'; import AuctionPriceAndBidCount from './AuctionPriceAndBidCount.js';
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const { itemId } = ownProps; const { itemId } = ownProps;

View File

@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
import { isBiddingItem, isWinningItem } from '../../selectors/auctions.js'; import { isBiddingItem, isWinningItem } from '../../selectors/auctions.js';
import AuctionPriceAndBidCount from '../../components/Auction/BidStatus.js'; import AuctionPriceAndBidCount from './BidStatus.js';
function mapStateToProps(state, ownProps) { function mapStateToProps(state, ownProps) {
const { itemId } = ownProps; const { itemId } = ownProps;

View File

@@ -1,7 +1,7 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { setActiveEvent } from '../../actions/events.js'; import { setActiveEvent } from '../../actions/events.js';
import EventListItem from '../../components/Events/EventListItem.js'; import EventListItem from './EventListItem.js';
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
const { event } = ownProps; const { event } = ownProps;

View File

@@ -1,22 +0,0 @@
import { connect } from 'react-redux';
import { fetchEvents } from '../actions/events.js';
import { getEventsAsList } from '../selectors/events.js';
import Events from '../screens/Events.js';
const matchStateToProps = (state) => {
const events = getEventsAsList(state);
console.log('events:', events);
return { events };
};
const mapDispatchToProps = (dispatch) => ({
fetchEvents: () => dispatch(fetchEvents(dispatch)),
});
export default connect(
matchStateToProps,
mapDispatchToProps,
)(Events);

View File

@@ -145,7 +145,7 @@ export const Tabs = createBottomTabNavigator({
navigationOptions: { navigationOptions: {
tabBarLabel: 'Profile', tabBarLabel: 'Profile',
tabBarIcon: ({ tintColor }) => ( tabBarIcon: ({ tintColor }) => (
<Icon name="ios-person" type="font-awesome" size={28} color={tintColor} /> <Icon name="user" type="evilicon" size={28} color={tintColor} />
), ),
}, },
}, },

View File

@@ -7,7 +7,7 @@ import { FlatList, Text, View } from 'react-native';
import { SORT_MODES, AUCTION_VIEW_MODES } from '../constants/constants.js'; import { SORT_MODES, AUCTION_VIEW_MODES } from '../constants/constants.js';
import FilterBar from '../components/Auction/FilterBar.js'; import FilterBar from '../components/Auction/FilterBar.js';
import AuctionListItem from '../containers/Auction/AuctionListItem.js'; import AuctionListItem from '../components/Auction/AuctionListItem.container.js';
import styles from './Auction.styles.js'; import styles from './Auction.styles.js';

View File

@@ -2,9 +2,9 @@ import { List } from 'immutable';
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { FlatList, StyleSheet, View } from 'react-native'; import { ActivityIndicator, FlatList, StyleSheet, View } from 'react-native';
import EventListItem from '../containers/Events/EventListItem.js'; import EventListItem from '../components/Events/EventListItem.container.js';
export default class Events extends Component { export default class Events extends Component {
static get propTypes() { static get propTypes() {
@@ -41,7 +41,7 @@ export default class Events extends Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
{events.size > 0 && ( {events.size > 0 ? (
<FlatList <FlatList
data={events} data={events}
keyExtractor={this._keyExtractor} keyExtractor={this._keyExtractor}
@@ -49,6 +49,8 @@ export default class Events extends Component {
contentContainerStyle={styles.eventListContentContainer} contentContainerStyle={styles.eventListContentContainer}
style={styles.eventList} style={styles.eventList}
/> />
) : (
<ActivityIndicator animating={true} />
)} )}
</View> </View>
); );