From 348782fe0b250be07124863f9e6e36c05036ba41 Mon Sep 17 00:00:00 2001 From: Katina Anachkova Date: Sun, 10 Nov 2024 12:42:08 +0200 Subject: [PATCH 1/5] switch admin related styles to sx and styled --- src/components/admin/AdminPage.tsx | 4 ++-- src/components/admin/DetailsDialog.tsx | 2 +- src/components/admin/InfoRequestGrid.tsx | 2 +- src/components/admin/affiliates/AffiliatesPage.tsx | 3 ++- .../admin/bank-transactions/grid/Filter.tsx | 8 ++------ src/components/admin/bank-transactions/grid/Grid.tsx | 2 +- .../grid/RenderEditBankDonationStatusCell.tsx | 11 +++-------- src/components/admin/styles/Admin.styled.tsx | 10 ++++++++++ src/components/client/campaigns/CampaignDetails.tsx | 2 +- 9 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 src/components/admin/styles/Admin.styled.tsx diff --git a/src/components/admin/AdminPage.tsx b/src/components/admin/AdminPage.tsx index 436f8d36c..056de36a4 100644 --- a/src/components/admin/AdminPage.tsx +++ b/src/components/admin/AdminPage.tsx @@ -78,7 +78,7 @@ export default function AdminPage() { }, border: '1px solid ' + `${colors[index % colors.length]}7A`, }}> -
router.push(href)} style={{ cursor: 'pointer' }}> + router.push(href)} sx={{ cursor: 'pointer' }}> @@ -87,7 +87,7 @@ export default function AdminPage() { {label} -
+ ))} diff --git a/src/components/admin/DetailsDialog.tsx b/src/components/admin/DetailsDialog.tsx index cd9b60292..4b6db678a 100644 --- a/src/components/admin/DetailsDialog.tsx +++ b/src/components/admin/DetailsDialog.tsx @@ -29,7 +29,7 @@ export default observer(function DetailsDialog({ modalStore, data }: Prop) { return ( - + {data.map((field) => ( diff --git a/src/components/admin/InfoRequestGrid.tsx b/src/components/admin/InfoRequestGrid.tsx index ad9e6a541..2ca40dd7a 100644 --- a/src/components/admin/InfoRequestGrid.tsx +++ b/src/components/admin/InfoRequestGrid.tsx @@ -43,7 +43,7 @@ export default function InfoRequestGrid() { return ( + {t(label)} Date: Mon, 11 Nov 2024 12:48:27 +0200 Subject: [PATCH 3/5] adjust donations grid filter stlye --- src/components/admin/donations/grid/Filter.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/admin/donations/grid/Filter.tsx b/src/components/admin/donations/grid/Filter.tsx index c6dc690f7..453e21511 100644 --- a/src/components/admin/donations/grid/Filter.tsx +++ b/src/components/admin/donations/grid/Filter.tsx @@ -37,8 +37,8 @@ export default function DropdownFilter(props: DropdownFilterProps) { const selectElementStyle = { minWidth: 115, - marginRight: 1, - marginLeft: 1, + mr: 0.125, + ml: 0.125, } const closeIconStyle = { From eaa87ed6a8ebf3242de975fc926ca1797835023b Mon Sep 17 00:00:00 2001 From: Katina Anachkova Date: Mon, 16 Dec 2024 10:50:02 +0200 Subject: [PATCH 4/5] refactor styles --- .../SupervisoryBoardSection.tsx | 6 +- .../client/auth/profile/MyCampaignsTable.tsx | 24 ++-- src/components/common/CookieConsentPopup.tsx | 68 ++++++----- src/components/common/LinkButton.tsx | 31 ++--- src/components/common/LinkMenuItem.tsx | 9 +- .../common/campaign-types/grid/Grid.tsx | 26 ++-- .../common/file-upload/FileUpload.tsx | 10 +- .../common/file-upload/UploadedFilesList.tsx | 51 ++++---- .../common/navigation/NestedMenu.tsx | 2 +- .../common/person/grid/Grid.styled.tsx | 56 +++++++++ src/components/common/person/grid/Grid.tsx | 111 ++++-------------- 11 files changed, 201 insertions(+), 193 deletions(-) create mode 100644 src/components/common/person/grid/Grid.styled.tsx diff --git a/src/components/client/about/sections/SupervisoryBoardSection/SupervisoryBoardSection.tsx b/src/components/client/about/sections/SupervisoryBoardSection/SupervisoryBoardSection.tsx index e34316c5f..875cd8575 100644 --- a/src/components/client/about/sections/SupervisoryBoardSection/SupervisoryBoardSection.tsx +++ b/src/components/client/about/sections/SupervisoryBoardSection/SupervisoryBoardSection.tsx @@ -22,6 +22,7 @@ import { export default function SupervisoryBoardSection() { const { t } = useTranslation('about') + console.log(data) return ( @@ -38,10 +39,7 @@ export default function SupervisoryBoardSection() { /> {teamMember.name} - + {t('about.linkedIn')} diff --git a/src/components/client/auth/profile/MyCampaignsTable.tsx b/src/components/client/auth/profile/MyCampaignsTable.tsx index 0da8bbd4d..fcd2888ae 100644 --- a/src/components/client/auth/profile/MyCampaignsTable.tsx +++ b/src/components/client/auth/profile/MyCampaignsTable.tsx @@ -2,6 +2,7 @@ import { useTranslation } from 'next-i18next' import { useState, useMemo } from 'react' import { DataGrid, GridColDef, GridRenderCellParams } from '@mui/x-data-grid' import { Tooltip, Button, Box, Typography } from '@mui/material' +import { styled } from '@mui/material/styles' import { getExactDateTime, getRelativeDate } from 'common/util/date' import { money } from 'common/util/money' @@ -43,6 +44,17 @@ export default function MyCampaingsTable() { width: 100, headerAlign: 'left', } + + const StyledDataGrid = styled(DataGrid)({ + background: theme.palette.common.white, + border: 'none', + width: 'calc(100% - 48px)', + left: '24px', + overflowY: 'auto', + overflowX: 'hidden', + borderRadius: '0 0 13px 13px', + }) + const columns: GridColDef[] = [ { field: 'actions', @@ -232,6 +244,7 @@ export default function MyCampaingsTable() { headerAlign: 'left', }, ] + return ( <> {campaigns.length !== 0 ? ( @@ -240,16 +253,7 @@ export default function MyCampaingsTable() { {t('profile:myCampaigns.history')} - { const { t } = useTranslation() + const containerStyle = { + backgroundColor: '#EAF4FC', + alignItems: 'center', + justifyContent: 'space-evenly', + padding: theme.spacing(2.5), + gap: theme.spacing(2.5), + } + + const contentStyle = { + fontSize: theme.typography.pxToRem(16), + color: theme.palette.common.black, + padding: theme.spacing(0, 2), + margin: 0, + maxWidth: theme.spacing(132.5), + } + + const buttonStyle = { + color: theme.palette.primary.main, + borderRadius: theme.borders.semiRound, + padding: theme.spacing(1.125, 1.5), + backgroundColor: theme.palette.common.white, + border: `1px solid ${theme.palette.primary.main}`, + margin: theme.spacing(0, 3.75), + } + + const declineBtnStyle = { + color: theme.palette.primary.main, + borderRadius: theme.borders.semiRound, + padding: theme.spacing(1, 1.5), + backgroundColor: theme.palette.common.white, + border: `1px solid ${theme.palette.primary.main}`, + margin: theme.spacing(0, 3.75, 0, 0), + } + return ( + style={containerStyle} + contentStyle={contentStyle} + buttonStyle={buttonStyle} + declineButtonStyle={declineBtnStyle}> {t('cookieConsent')} ) diff --git a/src/components/common/LinkButton.tsx b/src/components/common/LinkButton.tsx index 4ef53939a..f04d4fc03 100644 --- a/src/components/common/LinkButton.tsx +++ b/src/components/common/LinkButton.tsx @@ -1,6 +1,6 @@ import { Button, ButtonProps } from '@mui/material' import Link, { LinkProps } from 'next/link' -import { forwardRef, Ref } from 'react' +import { type CSSProperties, forwardRef, Ref } from 'react' export type LinkRef = HTMLButtonElement export type NextLinkProps = ButtonProps & @@ -9,18 +9,21 @@ export type NextLinkProps = ButtonProps & const LinkButton = ( { href, as, prefetch, legacyBehavior, locale, disabled, ...props }: NextLinkProps, ref: Ref, -) => ( - -