Skip to content

Commit

Permalink
chips added,bug fixes (#1577)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhaniivanov authored Sep 1, 2023
1 parent 40ceb9b commit 55eecae
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
4 changes: 3 additions & 1 deletion public/locales/bg/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@
"end-date": "Крайна дата:",
"indefinite": "Безсрочна",
"tag": "Таг:",
"date": "Дата:"
"date": "Дата:",
"news": "Новини",
"wishes": "Пожелания"
},
"info-graphics": {
"donation-title": "100% от дарението отива при нуждаещите се",
Expand Down
4 changes: 3 additions & 1 deletion public/locales/en/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@
"start-date": "Start date:",
"end-date": "End date:",
"tag": "Tag:",
"date": "Date:"
"date": "Date:",
"news": "News",
"wishes": "Wishes"
},
"info-graphics": {
"donation-title": "100% of the donation goes to those in need",
Expand Down
4 changes: 2 additions & 2 deletions src/components/client/campaigns/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
[theme.breakpoints.up('md')]: {
fontSize: theme.typography.pxToRem(45),
marginTop: 0,
marginBottom: theme.spacing(7),
marginBottom: theme.spacing(1),
},
},

Expand Down Expand Up @@ -157,7 +157,7 @@ export default function CampaignDetails({ campaign }: Props) {
''
)}
<CampaignNewsSection campaign={campaign} canCreateArticle={canEditCampaign} />
<Grid item xs={12}>
<Grid item xs={12} id="wishes">
<DonationWishes campaignId={campaign?.id} />
</Grid>
<Grid container item xs={12}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,3 @@ export const StatusLabel = styled(Typography)(() => ({
export const StatusText = styled('span')(() => ({
fontSize: theme.typography.pxToRem(14),
}))

export const ExpensesButton = styled(Button)(() => ({
fontSize: theme.typography.pxToRem(14),
justifyContent: 'left',
marginBottom: theme.spacing(1),
}))
4 changes: 2 additions & 2 deletions src/components/client/campaigns/CampaignInfo/CampaignInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ type Props = {
showExpensesLink: boolean
}

export default function CampaignInfo({ campaign }: Props) {
export default function CampaignInfo({ campaign, showExpensesLink }: Props) {
return (
<Grid mb={5}>
<CampaignInfoStatus showExpensesLink campaign={campaign} />
<CampaignInfoStatus showExpensesLink={showExpensesLink} campaign={campaign} />
<BeneficiaryOrganizerWrapper>
<CampaignInfoBeneficiary campaign={campaign} />
<CampaignInfoOrganizer campaign={campaign} />
Expand Down
48 changes: 34 additions & 14 deletions src/components/client/campaigns/CampaignInfo/CampaignInfoStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ import { CampaignResponse } from 'gql/campaigns'
import { useTranslation } from 'next-i18next'

import { bg, enUS } from 'date-fns/locale'
import { Grid } from '@mui/material'
import { Assessment } from '@mui/icons-material'
import { Box, Chip, Grid } from '@mui/material'

import { getExactDate } from 'common/util/date'

import {
StatusText,
StatusLabel,
RowWrapper,
InfoStatusWrapper,
ExpensesButton,
} from './CampaignInfo.styled'
import { StatusText, StatusLabel, RowWrapper, InfoStatusWrapper } from './CampaignInfo.styled'

type Props = {
campaign: CampaignResponse
Expand All @@ -27,11 +20,38 @@ export default function CampaignInfoStatus({ campaign, showExpensesLink }: Props

return (
<Grid>
{showExpensesLink && (
<ExpensesButton startIcon={<Assessment />} href={'#expenses'}>
{t('campaigns:campaign.financial-report')}
</ExpensesButton>
)}
<Box component="span" display="flex" alignItems="center" sx={{ gap: '5px' }}>
{showExpensesLink && (
<Chip
component="a"
label={t('campaigns:campaign.financial-report')}
href="#expenses"
clickable
variant="outlined"
color="primary"
size="small"
/>
)}
<Chip
component="a"
label={t('campaigns:campaign.news')}
href="#news"
clickable
color="primary"
variant="outlined"
size="small"
/>

<Chip
component="a"
label={t('campaigns:campaign.wishes')}
href="#wishes"
clickable
variant="outlined"
color="primary"
size="small"
/>
</Box>
<InfoStatusWrapper>
<Grid item xs={12} md={6}>
<StatusLabel>{campaign.campaignType.name}</StatusLabel>
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/campaigns/CampaignNewsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default function CampaignNewsSection({ campaign, canCreateArticle }: Prop
const [isExpanded, expandContent] = useShowMoreContent()

return (
<Grid container item xs={12} spacing={1}>
<Grid container item xs={12} spacing={1} id="news">
<Grid container item flexDirection={'column'}>
<Typography component={'h3'} fontSize={25} color="#000000">
{t('news')}
Expand Down

0 comments on commit 55eecae

Please sign in to comment.