- Reorg andf cleanup. Maintainability.
This commit is contained in:
@@ -39,7 +39,6 @@ HeaderContentLeft.propTypes = {
|
||||
activeRoute: PropTypes.string.isRequired,
|
||||
hasActiveEvent: PropTypes.bool,
|
||||
hasMultipleEvents: PropTypes.bool,
|
||||
navigation: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
HeaderContentLeft.defaultProps = {
|
||||
|
||||
@@ -50,7 +50,6 @@ HeaderTitle.propTypes = {
|
||||
activeRoute: PropTypes.string.isRequired,
|
||||
hasActiveEvent: PropTypes.bool,
|
||||
hasMultipleEvents: PropTypes.bool.isRequired,
|
||||
navigation: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
HeaderTitle.defaultProps = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { TouchableOpacity } from 'react-native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
import Icon from 'react-native-vector-icons';
|
||||
|
||||
export default function BackIcon({ action }) {
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ import { TouchableOpacity } from 'react-native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
|
||||
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) {
|
||||
return <TouchableOpacity onPress={action}>{renderEventsIcon()}</TouchableOpacity>;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
|
||||
import { placeBid } from '../../actions/auction.js';
|
||||
|
||||
import AuctionListItem from '../../components/Auction/AuctionListItem.js';
|
||||
import AuctionListItem from './AuctionListItem.js';
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
const { item } = ownProps;
|
||||
@@ -27,5 +27,5 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
null,
|
||||
mapDispatchToProps,
|
||||
)(AuctionListItem);
|
||||
@@ -5,8 +5,8 @@ import { StyleSheet, TouchableOpacity, Text, Image, View } from 'react-native';
|
||||
|
||||
import GallerySwiper from 'react-native-gallery-swiper';
|
||||
|
||||
import AuctionPriceAndBidCount from '../../containers/Auction/AuctionPriceAndBidCount.js';
|
||||
import BidStatus from '../../containers/Auction/BidStatus.js';
|
||||
import AuctionPriceAndBidCount from './AuctionPriceAndBidCount.container.js';
|
||||
import BidStatus from './BidStatus.container.js';
|
||||
|
||||
import { ITEM_TYPES } from '../../constants/constants.js';
|
||||
import { formatPrice, getAuctionTime } from '../../library/helpers.js';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
|
||||
import { getItemBidCount, getItemPrice } from '../../selectors/auctions.js';
|
||||
|
||||
import AuctionPriceAndBidCount from '../../components/Auction/AuctionPriceAndBidCount.js';
|
||||
import AuctionPriceAndBidCount from './AuctionPriceAndBidCount.js';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
const { itemId } = ownProps;
|
||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
|
||||
import { isBiddingItem, isWinningItem } from '../../selectors/auctions.js';
|
||||
|
||||
import AuctionPriceAndBidCount from '../../components/Auction/BidStatus.js';
|
||||
import AuctionPriceAndBidCount from './BidStatus.js';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
const { itemId } = ownProps;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { setActiveEvent } from '../../actions/events.js';
|
||||
import EventListItem from '../../components/Events/EventListItem.js';
|
||||
import EventListItem from './EventListItem.js';
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
const { event } = ownProps;
|
||||
@@ -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);
|
||||
@@ -145,7 +145,7 @@ export const Tabs = createBottomTabNavigator({
|
||||
navigationOptions: {
|
||||
tabBarLabel: 'Profile',
|
||||
tabBarIcon: ({ tintColor }) => (
|
||||
<Icon name="ios-person" type="font-awesome" size={28} color={tintColor} />
|
||||
<Icon name="user" type="evilicon" size={28} color={tintColor} />
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FlatList, Text, View } from 'react-native';
|
||||
import { SORT_MODES, AUCTION_VIEW_MODES } from '../constants/constants.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';
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import { List } from 'immutable';
|
||||
import React, { Component } from 'react';
|
||||
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 {
|
||||
static get propTypes() {
|
||||
@@ -41,7 +41,7 @@ export default class Events extends Component {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{events.size > 0 && (
|
||||
{events.size > 0 ? (
|
||||
<FlatList
|
||||
data={events}
|
||||
keyExtractor={this._keyExtractor}
|
||||
@@ -49,6 +49,8 @@ export default class Events extends Component {
|
||||
contentContainerStyle={styles.eventListContentContainer}
|
||||
style={styles.eventList}
|
||||
/>
|
||||
) : (
|
||||
<ActivityIndicator animating={true} />
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user