Skip to content

Commit

Permalink
Revert "Proposals UI update (#556)" (#575)
Browse files Browse the repository at this point in the history
This reverts commit 96cfaae.

Co-authored-by: Manank Patni <manank321@gmail.com>
  • Loading branch information
EightRice and Man-Jain authored May 24, 2023
1 parent 96cfaae commit 39bf678
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 756 deletions.
3 changes: 0 additions & 3 deletions src/assets/img/chart-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/img/cycle-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/img/list-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/img/tezos-icon.svg

This file was deleted.

12 changes: 0 additions & 12 deletions src/models/Choice.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/models/Community.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/models/Polls.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/models/Proposal.ts

This file was deleted.

48 changes: 33 additions & 15 deletions src/modules/explorer/components/AllProposalsList.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import { Collapse, Grid, Theme, Typography } from "@material-ui/core"
import { Collapse, Grid, IconButton, Typography } from "@material-ui/core"
import { styled } from "@material-ui/styles"
import { ProposalItem } from "modules/explorer/pages/User"
import React, { useCallback, useEffect, useState } from "react"
import React, { useCallback, useEffect, useMemo, useState } from "react"
import { Link } from "react-router-dom"
import { Proposal } from "services/indexer/dao/mappers/proposal/types"
import { Proposal, ProposalStatus } from "services/indexer/dao/mappers/proposal/types"
import { ContentContainer } from "./ContentContainer"
import { ProposalFilter } from "./ProposalsFilter"
import { Dropdown } from "./Dropdown"

const TableContainer = styled(ContentContainer)({
width: "100%"
})

const TableHeader = styled(Grid)(({ theme }: { theme: Theme }) => ({
const TableHeader = styled(Grid)({
padding: "16px 46px",
minHeight: 34,
[theme.breakpoints.down("sm")]: {
gap: 10
}
}))
minHeight: 34
})

const ProposalsFooter = styled(Grid)({
padding: "16px 46px",
Expand All @@ -35,13 +32,13 @@ interface Props {

export const AllProposalsList: React.FC<Props> = ({ currentLevel, proposals, title, showFooter, rightItem }) => {
const [filteredProposal, setFilteredProposals] = useState(proposals)
const [filter, setFilter] = useState("all")
const [filter, setFilter] = useState("All")

const filterProposals = useCallback(
(status?: any) => {
if (status === "all") {
if (status === "All") {
return setFilteredProposals(proposals)
} else if (status !== "all" && status !== undefined) {
} else if (status !== "All" && status !== undefined) {
const filtered = proposals.filter(proposal => proposal["cachedStatus"]?.status === status)
setFilteredProposals(filtered)
} else {
Expand Down Expand Up @@ -69,11 +66,32 @@ export const AllProposalsList: React.FC<Props> = ({ currentLevel, proposals, tit
<Grid container direction="column" wrap={"nowrap"}>
<TableHeader item container justifyContent="space-between" alignItems="center">
<Grid item>
<Typography variant="body1" style={{ fontWeight: "500" }} color="textPrimary">
<Typography variant="body2" style={{ fontWeight: "500" }} color="textPrimary">
{title}
</Typography>
</Grid>
{proposals.length ? <ProposalFilter filterProposalByStatus={filterProposalByStatus} /> : null}
{proposals.length ? (
<Grid item>
<IconButton aria-label="expand row" size="small">
<Dropdown
options={[
{ name: "All", value: "All" },
{ name: ProposalStatus.ACTIVE, value: ProposalStatus.ACTIVE },
{ name: ProposalStatus.DROPPED, value: ProposalStatus.DROPPED },
{ name: ProposalStatus.EXECUTABLE, value: ProposalStatus.EXECUTABLE },
{ name: ProposalStatus.EXECUTED, value: ProposalStatus.EXECUTED },
{ name: ProposalStatus.EXPIRED, value: ProposalStatus.EXPIRED },
{ name: ProposalStatus.NO_QUORUM, value: ProposalStatus.NO_QUORUM },
{ name: ProposalStatus.PASSED, value: ProposalStatus.PASSED },
{ name: ProposalStatus.PENDING, value: ProposalStatus.PENDING },
{ name: ProposalStatus.REJECTED, value: ProposalStatus.REJECTED }
]}
value={"All"}
onSelected={filterProposalByStatus}
/>{" "}
</IconButton>
</Grid>
) : null}
</TableHeader>
{filteredProposal.length ? (
<Grid
Expand Down
8 changes: 4 additions & 4 deletions src/modules/explorer/components/ConfigProposalFormLambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum LambdaProposalState {
const codeEditorPlaceholder = {
addLambda: `Write Michelson Code for Lambda's Implementation
Eg:-
Eg:-
(Left (Left (Pair (Pair { DROP ;
NIL operation ;
Expand All @@ -102,7 +102,7 @@ Eg:-
`,
lambdaExecuteArgumentsCode: `Write Michelson Code for the input Paramerers of your Lambda
Eg:-
Eg:-
{
"prim": "pair",
Expand All @@ -127,7 +127,7 @@ Eg:-
`,
lambdaExecuteParams: `Enter the values for the given params in a JSON/JavaScript Object format.
Eg:-
Eg:-
{
xtz_transfer_type: {
Expand Down Expand Up @@ -352,7 +352,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
open={open}
onClose={handleClose}
title={ProposalAction[action] + " Lambda Proposal"}
template="md"
template="lambda"
>
{state === LambdaProposalState.write_action ? (
<>
Expand Down
6 changes: 6 additions & 0 deletions src/modules/explorer/components/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ const getPages = (daoId: string): Page[] => [
name: "User",
icon: UserIcon,
href: `/explorer/dao/${daoId}/user`
},
{
pathId: "config",
name: "Config",
icon: ConfigIcon,
href: `/explorer/dao/${daoId}/config`
}
]

Expand Down
Loading

0 comments on commit 39bf678

Please sign in to comment.