Skip to content

Commit

Permalink
Add tag for successfull camapign (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ani-kalpachka authored and dimitur2204 committed Nov 21, 2022
1 parent 8719bfe commit 6a13f45
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Binary file added public/img/successfull-campaign-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/campaigns/CampaignCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Favorite } from '@mui/icons-material'
import KeyboardDoubleArrowRightIcon from '@mui/icons-material/KeyboardDoubleArrowRight'
import { campaignListPictureUrl } from 'common/util/campaignImageUrls'
import Image from 'next/image'
import SuccessfullCampaignTag from './SuccessfullCampaignTag'

const PREFIX = 'CampaignCard'

Expand Down Expand Up @@ -116,6 +117,7 @@ export default function CampaignCard({ campaign }: Props) {
<div
style={{ position: 'relative', width: '100%', minHeight: '100%', maxHeight: '100%' }}>
<Image src={pictureUrl} layout="fill" objectFit="contain" />
{reached >= target ? <SuccessfullCampaignTag /> : ''}
</div>
</CardMedia>
<CardContent className={classes.cardContent}>
Expand Down
28 changes: 28 additions & 0 deletions src/components/campaigns/SuccessfullCampaignTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'

import Image from 'next/image'

import { Grid } from '@mui/material'

export default function SuccessfullCampaignTag() {
const successfullCampaignTagSource = '/img/successfull-campaign-tag.png'

return (
<Grid
sx={{
position: 'absolute',
right: 15,
bottom: 10,
zIndex: 20,
transform: 'rotate(335deg)',
opacity: 0.8,
}}>
<Image
alt="Successfull campaign tag"
src={successfullCampaignTagSource}
width="200px"
height="70px"
/>
</Grid>
)
}

0 comments on commit 6a13f45

Please sign in to comment.