-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding sub-tabs for listings in progress, fixing bug in core related …
…to can challenge be resolved removing logs running prettier
- Loading branch information
1 parent
3256213
commit e053451
Showing
6 changed files
with
118 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
packages/dapp/src/components/listinglist/ListingsInProgress.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import * as React from "react"; | ||
import { Set } from "immutable"; | ||
import { Tabs } from "../tabs/Tabs"; | ||
import { Tab } from "../tabs/Tab"; | ||
|
||
import ListingList from "./ListingList"; | ||
import { connect } from "react-redux"; | ||
import { State } from "../../reducers"; | ||
|
||
export interface ListingProps { | ||
applications: Set<string>; | ||
readyToWhitelistListings: Set<string>; | ||
inChallengeCommitListings: Set<string>; | ||
inChallengeRevealListings: Set<string>; | ||
awaitingAppealRequestListings: Set<string>; | ||
awaitingAppealJudgmentListings: Set<string>; | ||
awaitingAppealChallengeListings: Set<string>; | ||
appealChallengeCommitPhaseListings: Set<string>; | ||
appealChallengeRevealPhaseListings: Set<string>; | ||
resolveChallengeListings: Set<string>; | ||
resolveAppealListings: Set<string>; | ||
} | ||
|
||
class ListingsInProgress extends React.Component<ListingProps> { | ||
public render(): JSX.Element { | ||
const applications = this.props.applications; | ||
const beingChallenged = this.props.inChallengeCommitListings | ||
.merge(this.props.inChallengeRevealListings) | ||
.merge(this.props.awaitingAppealRequestListings); | ||
const consideringAppeal = this.props.awaitingAppealJudgmentListings.merge( | ||
this.props.awaitingAppealChallengeListings, | ||
); | ||
const appealChallenge = this.props.appealChallengeCommitPhaseListings.merge( | ||
this.props.appealChallengeRevealPhaseListings, | ||
); | ||
const readyToUpdate = this.props.readyToWhitelistListings | ||
.merge(this.props.resolveChallengeListings) | ||
.merge(this.props.resolveAppealListings); | ||
return ( | ||
<Tabs> | ||
<Tab tabText={"Applications (" + applications.count() + ")"}> | ||
<ListingList listings={applications} /> | ||
</Tab> | ||
<Tab tabText={"Being Challenged (" + beingChallenged.count() + ")"}> | ||
<ListingList listings={beingChallenged} /> | ||
</Tab> | ||
<Tab tabText={"Appeal Being Considered (" + consideringAppeal.count() + ")"}> | ||
<ListingList listings={consideringAppeal} /> | ||
</Tab> | ||
<Tab tabText={"Appeal Being Challenged (" + appealChallenge.count() + ")"}> | ||
<ListingList listings={appealChallenge} /> | ||
</Tab> | ||
<Tab tabText={"Ready to Update (" + readyToUpdate.count() + ")"}> | ||
<ListingList listings={readyToUpdate} /> | ||
</Tab> | ||
</Tabs> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state: State): ListingProps => { | ||
const { | ||
applications, | ||
readyToWhitelistListings, | ||
inChallengeCommitListings, | ||
inChallengeRevealListings, | ||
awaitingAppealRequestListings, | ||
awaitingAppealJudgmentListings, | ||
awaitingAppealChallengeListings, | ||
appealChallengeCommitPhaseListings, | ||
appealChallengeRevealPhaseListings, | ||
resolveChallengeListings, | ||
resolveAppealListings, | ||
} = state; | ||
|
||
return { | ||
applications, | ||
readyToWhitelistListings, | ||
inChallengeCommitListings, | ||
inChallengeRevealListings, | ||
awaitingAppealRequestListings, | ||
awaitingAppealJudgmentListings, | ||
awaitingAppealChallengeListings, | ||
appealChallengeCommitPhaseListings, | ||
appealChallengeRevealPhaseListings, | ||
resolveChallengeListings, | ||
resolveAppealListings, | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps)(ListingsInProgress); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters