-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display suggested proposal params changes [web-desmos] (#1311)
## Description Closes: #XXXX <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist _All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues._ I have... - [x] ran linting via `yarn lint` - [x] wrote tests where necessary - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] targeted the correct branch - [x] provided a link to the relevant issue or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed - [x] added a changeset via [`yarn && yarn changeset`](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
- Loading branch information
Showing
4 changed files
with
165 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'web-desmos': major | ||
'ui': major | ||
--- | ||
|
||
display suggested proposal params changes on proposal page |
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
77 changes: 77 additions & 0 deletions
77
apps/web-desmos/src/screens/proposal_details/components/overview/styles.ts
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,77 @@ | ||
import { makeStyles } from 'tss-react/mui'; | ||
|
||
const useStyles = makeStyles()((theme) => ({ | ||
root: { | ||
'& .label': { | ||
color: theme.palette.custom.fonts.fontThree, | ||
}, | ||
'& .content': { | ||
marginBottom: theme.spacing(2), | ||
display: 'block', | ||
[theme.breakpoints.up('lg')]: { | ||
display: 'flex', | ||
}, | ||
}, | ||
'& .recipient': { | ||
marginBottom: theme.spacing(2), | ||
[theme.breakpoints.up('lg')]: { | ||
display: 'block', | ||
}, | ||
}, | ||
'& .amountRequested': { | ||
marginBottom: theme.spacing(2), | ||
display: 'block', | ||
padding: '0', | ||
[theme.breakpoints.up('lg')]: { | ||
display: 'block', | ||
paddingLeft: '30px', | ||
}, | ||
}, | ||
'& .accordion': { | ||
background: '#151519', | ||
}, | ||
}, | ||
content: { | ||
marginTop: theme.spacing(2), | ||
display: 'grid', | ||
p: { | ||
lineHeight: 1.8, | ||
}, | ||
'& ul': { | ||
padding: '0.25rem 0.5rem', | ||
[theme.breakpoints.up('lg')]: { | ||
padding: '0.5rem 1rem', | ||
}, | ||
}, | ||
'& li': { | ||
padding: '0.25rem 0.5rem', | ||
[theme.breakpoints.up('lg')]: { | ||
padding: '0.5rem 1rem', | ||
}, | ||
}, | ||
'& > *': { | ||
marginBottom: theme.spacing(1), | ||
[theme.breakpoints.up('lg')]: { | ||
marginBottom: theme.spacing(2), | ||
}, | ||
}, | ||
[theme.breakpoints.up('lg')]: { | ||
gridTemplateColumns: '200px auto', | ||
}, | ||
}, | ||
time: { | ||
marginTop: theme.spacing(2), | ||
display: 'grid', | ||
'& > *': { | ||
marginBottom: theme.spacing(1), | ||
[theme.breakpoints.up('md')]: { | ||
marginBottom: theme.spacing(2), | ||
}, | ||
}, | ||
[theme.breakpoints.up('md')]: { | ||
gridTemplateColumns: 'repeat(2, 1fr)', | ||
}, | ||
}, | ||
})); | ||
|
||
export default useStyles; |
42 changes: 42 additions & 0 deletions
42
...es/ui/src/screens/proposal_details/components/overview/components/update_params/index.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,42 @@ | ||
import useAppTranslation from '@/hooks/useAppTranslation'; | ||
import { FC } from 'react'; | ||
import Accordion from '@mui/material/Accordion'; | ||
import AccordionSummary from '@mui/material/AccordionSummary'; | ||
import AccordionDetails from '@mui/material/AccordionDetails'; | ||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
type UpdateParamsProps = { | ||
changes: { params: JSON; type: string }; | ||
className?: string; | ||
}; | ||
|
||
const UpdateParams: FC<UpdateParamsProps> = ({ changes, className }) => { | ||
const { t } = useAppTranslation('proposals'); | ||
|
||
return ( | ||
<> | ||
<Typography variant="body1" className="label"> | ||
{t('changes')} | ||
</Typography> | ||
<Accordion className={className}> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreIcon />} | ||
aria-controls="panel1a-content" | ||
id="panel1a-header" | ||
> | ||
<Typography variant="body1" className="value"> | ||
{JSON.stringify(changes.type, null, 2).replace(/['"]+/g, '')} | ||
</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails> | ||
<Typography variant="body1" className="value"> | ||
{JSON.stringify(changes.params, null, 2)} | ||
</Typography> | ||
</AccordionDetails> | ||
</Accordion> | ||
</> | ||
); | ||
}; | ||
|
||
export default UpdateParams; |
e749a3b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cosmos – ./
cosmos-bigdipper.vercel.app
bigdipper.vercel.app
cosmos-git-main-bigdipper.vercel.app