-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Governance b&t notifications (#536)
* feat: new B&T notifications * fix: prettier
- Loading branch information
Showing
8 changed files
with
319 additions
and
1 deletion.
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,35 @@ | ||
import React from 'react' | ||
|
||
const PitchIcon = (props: React.SVGAttributes<SVGElement>) => { | ||
return ( | ||
<svg | ||
width="48" | ||
height="48" | ||
viewBox="0 0 48 48" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<circle cx="24" cy="24" r="24" fill="url(#paint0_linear_2576_13)" /> | ||
<path | ||
d="M16.6961 21.9922L13 28.3259V16.6668C13 15.1959 14.1959 14 15.6668 14H20.563C21.2714 14 21.9506 14.2792 22.4506 14.7792L23.5549 15.8835C24.0549 16.3835 24.7341 16.6627 25.4425 16.6627H30.3345C31.8054 16.6627 33.0013 17.8586 33.0013 19.3295V20.6629H19.0004C18.0503 20.6629 17.1753 21.1671 16.6961 21.988V21.9922ZM17.8461 22.6631C18.0878 22.2505 18.5254 22.0005 19.0004 22.0005H35.6681C36.1473 22.0005 36.5849 22.2547 36.8224 22.6714C37.0599 23.0881 37.0599 23.5965 36.8182 24.009L32.1512 32.0095C31.9137 32.4179 31.4762 32.6679 31.0012 32.6679H14.3334C13.8542 32.6679 13.4167 32.4137 13.1792 31.997C12.9417 31.5803 12.9417 31.0719 13.1833 30.6594L17.8503 22.6589L17.8461 22.6631Z" | ||
fill="white" | ||
/> | ||
<defs> | ||
<linearGradient | ||
id="paint0_linear_2576_13" | ||
x1="0" | ||
y1="0" | ||
x2="48" | ||
y2="48" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<stop stop-color="#D80027" /> | ||
<stop offset="1" stop-color="#720015" /> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
) | ||
} | ||
|
||
export default PitchIcon |
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,35 @@ | ||
import React from 'react' | ||
|
||
const TenderIcon = (props: React.SVGAttributes<SVGElement>) => { | ||
return ( | ||
<svg | ||
width="48" | ||
height="48" | ||
viewBox="0 0 48 48" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<circle cx="24" cy="24" r="24" fill="url(#paint0_linear_2576_13)" /> | ||
<path | ||
d="M14.6667 14.3333C14.6667 13.5958 14.0708 13 13.3333 13C12.5958 13 12 13.5958 12 14.3333V18.3333V29C12 30.4708 13.1958 31.6667 14.6667 31.6667H22.6667V29H14.6667V19.6667H22.6667V17H14.6667V14.3333ZM24 21C24 21.7375 24.5958 22.3333 25.3333 22.3333H34.6667C35.4042 22.3333 36 21.7375 36 21V15.6667C36 14.9292 35.4042 14.3333 34.6667 14.3333H30.5542C30.2 14.3333 29.8625 14.1917 29.6125 13.9417L29.0583 13.3917C28.8083 13.1417 28.4708 13 28.1167 13H25.3333C24.5958 13 24 13.5958 24 14.3333V21ZM24 33C24 33.7375 24.5958 34.3333 25.3333 34.3333H34.6667C35.4042 34.3333 36 33.7375 36 33V27.6667C36 26.9292 35.4042 26.3333 34.6667 26.3333H30.5542C30.2 26.3333 29.8625 26.1917 29.6125 25.9417L29.0583 25.3875C28.8083 25.1375 28.4708 24.9958 28.1167 24.9958H25.3333C24.5958 24.9958 24 25.5917 24 26.3292V33Z" | ||
fill="white" | ||
/> | ||
<defs> | ||
<linearGradient | ||
id="paint0_linear_2576_13" | ||
x1="0" | ||
y1="0" | ||
x2="48" | ||
y2="48" | ||
gradientUnits="userSpaceOnUse" | ||
> | ||
<stop stop-color="#D80027" /> | ||
<stop offset="1" stop-color="#720015" /> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
) | ||
} | ||
|
||
export default TenderIcon |
91 changes: 91 additions & 0 deletions
91
...mponents/Notifications/NotificationTypes/Governance/GovernancePitchPassedNotification.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,91 @@ | ||
import React from 'react' | ||
import { | ||
CommonNotificationProps, | ||
GovernancePitchPassedNotification | ||
} from '../../types' | ||
import NotificationItem from '../../NotificationItem' | ||
import PitchIcon from '../../../Icons/Notifications/PitchIcon' | ||
|
||
const i18N = { | ||
en: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
Help to advance this idea by proposing potential solutions{' '} | ||
<a href={link} className="dcl notification-link"> | ||
here | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
The Pitch " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" can now receive Tenders | ||
</> | ||
) | ||
}, | ||
es: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
Ayuda a avanzar esta idea proponiendo soluciones potenciales{' '} | ||
<a href={link} className="dcl notification-link"> | ||
aquí | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
La Convocatoria " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" ahora puede recibir licitaciones | ||
</> | ||
) | ||
}, | ||
zh: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
通过提出可能的解决方案来帮助推进这个想法{' '} | ||
<a href={link} className="dcl notification-link"> | ||
这里 | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
投标邀请 " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" 现在可以接收投标 | ||
</> | ||
) | ||
} | ||
} | ||
|
||
const GovernancePitchPassedNotification = ({ | ||
notification, | ||
locale | ||
}: CommonNotificationProps<GovernancePitchPassedNotification>) => ( | ||
<NotificationItem | ||
image={{ image: <PitchIcon width="48" height="48" /> }} | ||
timestamp={notification.timestamp} | ||
isNew={!notification.read} | ||
locale={locale} | ||
> | ||
<p className="dcl notification-item__content-title"> | ||
{i18N[locale].title(notification.metadata.proposalTitle)} | ||
</p> | ||
<p className="dcl notification-item__content-description"> | ||
{i18N[locale].description(notification.metadata.link)} | ||
</p> | ||
</NotificationItem> | ||
) | ||
|
||
export default GovernancePitchPassedNotification |
93 changes: 93 additions & 0 deletions
93
...ponents/Notifications/NotificationTypes/Governance/GovernanceTenderPassedNotification.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,93 @@ | ||
import React from 'react' | ||
import { | ||
CommonNotificationProps, | ||
GovernanceTenderPassedNotification | ||
} from '../../types' | ||
import NotificationItem from '../../NotificationItem' | ||
import TenderIcon from '../../../Icons/Notifications/TenderIcon' | ||
|
||
const i18N = { | ||
en: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
If think you can tackle this solution, propose a Project and get funding | ||
from the DAO{' '} | ||
<a href={link} className="dcl notification-link"> | ||
here | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
The Tender " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" can now receive Bid Projects | ||
</> | ||
) | ||
}, | ||
es: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
Si crees que puedes abordar esta solución, propón un proyecto y obtén | ||
financiación del DAO{' '} | ||
<a href={link} className="dcl notification-link"> | ||
aquí | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
La Licitación " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" ahora puede recibir Proyectos de Oferta | ||
</> | ||
) | ||
}, | ||
zh: { | ||
description: (link: string): React.ReactNode => ( | ||
<> | ||
如果你认为可以解决这个问题,提出一个项目并从DAO获得资金支持{' '} | ||
<a href={link} className="dcl notification-link"> | ||
这里 | ||
</a> | ||
. | ||
</> | ||
), | ||
title: (proposalTitle: string): React.ReactNode => ( | ||
<> | ||
投标 " | ||
<span className="dcl notification-text-highlighted"> | ||
{proposalTitle} | ||
</span> | ||
" 现在可以接收项目投标 | ||
</> | ||
) | ||
} | ||
} | ||
|
||
const GovernanceTenderPassedNotification = ({ | ||
notification, | ||
locale | ||
}: CommonNotificationProps<GovernanceTenderPassedNotification>) => ( | ||
<NotificationItem | ||
image={{ image: <TenderIcon width="48" height="48" /> }} | ||
timestamp={notification.timestamp} | ||
isNew={!notification.read} | ||
locale={locale} | ||
> | ||
<p className="dcl notification-item__content-title"> | ||
{i18N[locale].title(notification.metadata.proposalTitle)} | ||
</p> | ||
<p className="dcl notification-item__content-description"> | ||
{i18N[locale].description(notification.metadata.link)} | ||
</p> | ||
</NotificationItem> | ||
) | ||
|
||
export default GovernanceTenderPassedNotification |
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
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
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
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