Skip to content

Commit

Permalink
rm extraneous components, mv ListingCard comp.
Browse files Browse the repository at this point in the history
  • Loading branch information
kangarang committed Aug 8, 2018
1 parent 7f68308 commit 5db23c1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 356 deletions.
107 changes: 0 additions & 107 deletions src/containers/Listings/Pagination.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/containers/Listings/VisibleListings.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import styled from 'styled-components'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography'
import Card from '@material-ui/core/Card'
Expand All @@ -7,8 +8,7 @@ import Button from 'components/Button'
import Img from 'components/Img'
import Countdown from 'components/Countdown'

import styled from 'styled-components'
import { tsToMonthDate } from '../../utils/_datetime'
import { tsToMonthDate } from 'utils/_datetime'

const CardContent = styled.div`
padding: 1em;
Expand Down Expand Up @@ -49,7 +49,7 @@ function ListingCard(props) {
listingType,
updateTrigger,
revealTrigger,
openSidePanel,
openTxPanel,
claimRewardTrigger,
} = props

Expand Down Expand Up @@ -85,7 +85,7 @@ function ListingCard(props) {
<Countdown end={one.commitExpiry.date} />
<Button
methodName="commitVote"
onClick={e => openSidePanel(one, 'commitVote')}
onClick={e => openTxPanel(one, 'commitVote')}
color="primary"
>
{'Commit Vote'}
Expand All @@ -97,7 +97,7 @@ function ListingCard(props) {
<div>
<Countdown end={one.revealExpiry.date} />
<Button
onClick={e => openSidePanel(one, 'revealVote')}
onClick={e => openTxPanel(one, 'revealVote')}
color="primary"
methodName="revealVote"
>
Expand All @@ -112,7 +112,7 @@ function ListingCard(props) {
<Countdown end={one.appExpiry.date} />
<Button
wide
onClick={e => openSidePanel(one, 'challenge')}
onClick={e => openTxPanel(one, 'challenge')}
color="secondary"
methodName="challenge"
>
Expand All @@ -123,7 +123,7 @@ function ListingCard(props) {
{claimRewardTrigger && (
<Button
methodName="claimReward"
onClick={e => openSidePanel(one, 'claimReward')}
onClick={e => openTxPanel(one, 'claimReward')}
color="primary"
>
{'Claim Reward'}
Expand All @@ -132,7 +132,7 @@ function ListingCard(props) {
{updateTrigger && (
<Button
methodName="updateStatus"
onClick={e => openSidePanel(one, 'updateStatus')}
onClick={e => openTxPanel(one, 'updateStatus')}
color="primary"
wide
>
Expand Down
16 changes: 8 additions & 8 deletions src/containers/Listings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import styled from 'styled-components'
import { withStyles } from '@material-ui/core/styles'

import { colors } from 'global-styles'
import { selectSidePanelListing, selectSidePanelMethod } from 'modules/listings/selectors'
import { selectTxPanelListing, selectTxPanelMethod } from 'modules/transactions/selectors'
import * as actions from 'modules/transactions/actions'

import toJS from 'components/toJS'
import ListingCard from './ListingCard'
import ListingCard from './components/ListingCard'

const ListingsContainer = styled.div`
display: flex;
Expand All @@ -28,7 +28,7 @@ const styles = theme => ({
},
tableWrapper: {
// overflowX: 'auto',
padding: '0',
// padding: '0',
},
appBar: {
boxShadow: '0 0 0 0',
Expand All @@ -49,7 +49,7 @@ const styles = theme => ({

class Listings extends Component {
render() {
const { listingType, visibleListings, onOpenSidePanel } = this.props
const { listingType, visibleListings, onOpenTxPanel } = this.props

return (
<ListingsContainer>
Expand All @@ -58,7 +58,7 @@ class Listings extends Component {
<ListingCard
one={visibleListings[li]}
listingType={listingType}
openSidePanel={onOpenSidePanel}
openTxPanel={onOpenTxPanel}
updateTrigger={
listingType === 'faceoffs'
? visibleListings[li].revealExpiry.expired
Expand All @@ -81,14 +81,14 @@ class Listings extends Component {
}

const mapStateToProps = createStructuredSelector({
sidePanelListing: selectSidePanelListing,
sidePanelMethod: selectSidePanelMethod,
txPanelListing: selectTxPanelListing,
txPanelMethod: selectTxPanelMethod,
})

const withConnect = connect(
mapStateToProps,
{
onOpenSidePanel: actions.openSidePanel,
onOpenTxPanel: actions.openTxPanel,
}
)

Expand Down
Loading

0 comments on commit 5db23c1

Please sign in to comment.