Skip to content

Commit

Permalink
improvements to campaign grid (#1481)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhaniivanov authored Jul 12, 2023
1 parent fc7859d commit c9d7aa9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions public/locales/en/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,25 @@
"disabled": "Disabled",
"error": "Error",
"deleted": "Deleted"
},
"campaignTypesFields": {
"treatment": "Treatment and rehabilitation",
"transplatation": "Transplantation",
"cancer": "Cancer",
"leukemia": "Leukemia",
"geneticDiseases": "Genetic diseases",
"rehabilitation": "Rehabilitation",
"helping": "Helping the needy",
"kidsInRisk": "Kids in risk",
"thirdAge": "Third Age",
"homesForChildren": "Homes for children",
"nursingHomes": "Nursing homes",
"betterSociety": "Better society",
"education": "Education",
"culture": "Culture",
"nature": "Nature",
"humanRights": "Human rights",
"animals": "Animals",
"disasters": "Disasters"
}
}
4 changes: 3 additions & 1 deletion src/components/admin/campaigns/grid/CampaignGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function CampaignGrid() {
const [viewId, setViewId] = useState<string | undefined>()
const [deleteId, setDeleteId] = useState<string | undefined>()
const [paginationModel, setPaginationModel] = useState({
pageSize: 10,
pageSize: 20,
page: 0,
})
const selectedCampaign = useMemo(() => data.find((c) => c.id === viewId), [data, viewId])
Expand Down Expand Up @@ -156,6 +156,7 @@ export default function CampaignGrid() {
...commonProps,
align: 'left',
width: 250,
valueGetter: ({ value }) => value && t('campaigns:campaignTypesFields.' + value.name),
renderCell: (cellValues: GridRenderCellParams) => <>{cellValues.row.campaignType.name}</>,
},
{
Expand Down Expand Up @@ -312,6 +313,7 @@ export default function CampaignGrid() {
paginationModel={paginationModel}
onPaginationModelChange={setPaginationModel}
editMode="row"
pageSizeOptions={[20, 50, 100]}
/>
<Box>
{selectedCampaign && (
Expand Down

0 comments on commit c9d7aa9

Please sign in to comment.