Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposals UI update #579

Merged
merged 9 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31,555 changes: 13,989 additions & 17,566 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/assets/img/chart-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/cycle-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/list-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/tezos-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/modules/creator/deployment/steps/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const CustomFormikTextField = withStyles({
"& .MuiInput-underline:after": {
borderBottom: "none !important"
}
}
},
disabled: {}
})(FormikTextField)

const CustomInputContainer = styled(Grid)(({ theme }) => ({
Expand Down
46 changes: 14 additions & 32 deletions src/modules/explorer/components/AllProposalsList.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { Collapse, Grid, IconButton, styled, Typography } from "@material-ui/core"
import { Collapse, Grid, styled, Theme, Typography } from "@material-ui/core"
import { ProposalItem } from "modules/explorer/pages/User"
import React, { useCallback, useEffect, useMemo, useState } from "react"
import React, { useCallback, useEffect, useState } from "react"
import { Link } from "react-router-dom"
import { Proposal, ProposalStatus } from "services/services/dao/mappers/proposal/types"
import { ContentContainer } from "./ContentContainer"
import { Dropdown } from "./Dropdown"
import { ProposalFilter } from "./ProposalsFilter"

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

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

const ProposalsFooter = styled(Grid)({
padding: "16px 46px",
Expand All @@ -31,13 +34,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 @@ -65,32 +68,11 @@ 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="body2" style={{ fontWeight: "500" }} color="textPrimary">
<Typography variant="body1" style={{ fontWeight: "500" }} color="textPrimary">
{title}
</Typography>
</Grid>
{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}
{proposals.length ? <ProposalFilter filterProposalByStatus={filterProposalByStatus} /> : null}
</TableHeader>
{filteredProposal.length ? (
<Grid
Expand Down
2 changes: 1 addition & 1 deletion src/modules/explorer/components/CodeCollapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const CodeCollapse: React.FC<Props> = ({ code }) => {
>
<ProposalCodeEditorInput
label=""
containerStyle={{ marginTop: "8px" }}
containerstyle={{ marginTop: "8px" }}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand Down
20 changes: 10 additions & 10 deletions src/modules/explorer/components/ConfigProposalFormLambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const CheckIcon = styled(CheckOutlined)({
fontSize: 169
})

const codeEditorContainerStyles = {
const codeEditorcontainerstyles = {
marginTop: "8px"
}

Expand Down 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 @@ -259,7 +259,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
<>
<ProposalCodeEditorInput
label="Implementation"
containerStyle={codeEditorContainerStyles}
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand All @@ -282,7 +282,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
</ProposalFormInput>
<ProposalCodeEditorInput
label="Implementation"
containerStyle={codeEditorContainerStyles}
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand All @@ -305,7 +305,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
</ProposalFormInput>
<ProposalCodeEditorInput
label="Implementation"
containerStyle={codeEditorContainerStyles}
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand All @@ -318,7 +318,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
/>
<ProposalCodeEditorInput
label="Lambda Arguments Code"
containerStyle={codeEditorContainerStyles}
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand All @@ -331,7 +331,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
/>
<ProposalCodeEditorInput
label="Lambda Params"
containerStyle={codeEditorContainerStyles}
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
tabSize={4}
Expand All @@ -352,7 +352,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
open={open}
onClose={handleClose}
title={ProposalAction[action] + " Lambda Proposal"}
template="lambda"
template="md"
>
{state === LambdaProposalState.write_action ? (
<>
Expand Down
6 changes: 0 additions & 6 deletions src/modules/explorer/components/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ 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