Skip to content

Commit

Permalink
Merge pull request #4729 from Giveth/verified-migration
Browse files Browse the repository at this point in the history
Decentralized Verification: Moving from verified to vouches
  • Loading branch information
mateodaza authored Sep 17, 2024
2 parents f172380 + 395de5d commit fc54246
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 23 deletions.
9 changes: 7 additions & 2 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,8 @@
"label.verification_rejected": "Verificació rebutjada",
"label.verification_status": "Estat de verificació",
"label.verified": "Verificat",
"label.vouched": "Avalat",
"label.isGivbackEligible": "Apte per a Givbacks",
"label.verified_projects": "Projectes verificats",
"label.verified_status_for": "Elegibilitat per a GIVbacks per a",
"label.verify_email_address": "Verificar correu electrònic",
Expand Down Expand Up @@ -1302,7 +1304,7 @@
"label.passport_connected": "Passaport connectat",
"label.increase_passport_score": "Augmenta la puntuació del passaport",
"label.project_owner_address_detected": "Adreça del propietari del projecte detectada",
"label.project_owner_cant_donate_to_own_project": "No pots donar a un projecte del qual ets propietari. Hi ha milers de projectes a Giveth que busquen el teu suport! Si us plau, tria un altre projecte per donar.",
"label.project_owner_cant_donate_to_own_project": "No pots donar a un projecte del qual ets propietari. Hi ha milers de projectes a Giveth que busquen el teu suport! Si us plau, tria un altre projecte per donar.",
"label.qf_donor_eligibility.banner.check_eligibility": "Fes que les teves donacions es igualin! Verifica la teva unicitat amb un clic.",
"label.qf_donor_eligibility.banner.recheck_eligibility": "Fes que les teves donacions es igualin! Augmenta la teva puntuació de Gitcoin Passport abans de",
"label.qf_donor_eligibility.banner.more_info_needed": "Necessitem una mica més d'informació per verificar la teva elegibilitat per QF!",
Expand Down Expand Up @@ -1627,7 +1629,9 @@
"project.givback_toast.description.non_verified_public": "Actualment, els GIVbacks només s'atorguen per donacions fetes a projectes elegibles per a GIVbacks a Ethereum. La teva contribució segueix sent important, fins i tot si no genera GIVbacks!",
"project.givback_toast.description.verified_owner": "Impulsa el teu projecte per augmentar la quantitat de GIVbacks que reben els teus donants a Ethereum i augmentar la seva visibilitat entre altres projectes.",
"project.givback_toast.description.verified_owner.note": "Com a propietari d'aquest projecte, no rebràs GIVbacks per donar-hi.",
"project.givback_toast.description.verified_public": "Les donacions a Ethereum a projectes elegibles per a GIVbacks són recompensades amb GIV. Impulsa aquest projecte per augmentar el seu percentatge de recompenses i fer-lo més visible a la pàgina de projectes!", "project.givback_toast.title.non_verified_owner": "El teu projecte està creant o donant suport a béns públics?",
"project.givback_toast.description.verified_public": "Les donacions a Ethereum a projectes elegibles per a GIVbacks són recompensades amb GIV. Impulsa aquest projecte per augmentar el seu percentatge de recompenses i fer-lo més visible a la pàgina de projectes!",
"project.givback_toast.title.non_verified_owner": "El teu projecte està creant o donant suport a béns públics?",
"project.givback_toast.description.verified_public_not_eligible": "Bloqueja i assegura els teus tokens GIV per obtenir GIVpower. Impulsa aquest projecte per fer-lo més visible a la pàgina de projectes! Tingues en compte que, tot i que aquest projecte és elegible per ser impulsat amb GIVpower, no generarà GIVbacks per als seus donants.",
"project.givback_toast.title.non_verified_owner_cancelled": "Estat Cancel·lat",
"project.givback_toast.title.non_verified_owner_deactive": "Mode Desactivat",
"project.givback_toast.title.non_verified_owner_draft": "Publica el teu projecte avui!",
Expand All @@ -1639,6 +1643,7 @@
"project.givback_toast.title.verified_owner_2": " del valor de la donació!",
"project.givback_toast.title.verified_public_1": "Rep recompenses de fins a ",
"project.givback_toast.title.verified_public_2": " del valor de la teva donació!",
"project.givback_toast.title.verified_public_not_eligible": "Impulsa aquest projecte amb GIVpower!",
"projects_all": "Tots els Projectes",
"projects_all_desc": "SUPORT A PROJECTES GLOBALS DE BÉS PÚBLICS, SOSTENIBILITAT I REGENERACIÓ AMB CRYPTODONACIONS",
"projects_art-and-culture": "Art i Cultura",
Expand Down
8 changes: 6 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,10 @@
"label.verification_process": "GIVbacks Eligibility process",
"label.verification_rejected": "Verification Rejected",
"label.verification_status": "GIVbacks Eligibility status",
"label.verified": "GIVbacks Eligible",
"label.verified_projects": "GIVbacks eligible projects",
"label.verified": "Verified",
"label.vouched": "Vouched",
"label.isGivbackEligible": "Givbacks Eligible",
"label.verified_projects": "Verified projects",
"label.verified_status_for": "GIVbacks Eligibility for",
"label.verify_email_address": "Verify email address",
"label.verify_your_project": "GIVbacks Eligibility Form",
Expand Down Expand Up @@ -1633,6 +1635,7 @@
"project.givback_toast.description.verified_owner": "Boost your project to increase the amount of GIVbacks your donors on Ethereum receive and increase its visibility among other projects!",
"project.givback_toast.description.verified_owner.note": "As the owner of this project, you won’t get GIVbacks for donating to it.",
"project.givback_toast.description.verified_public": "Ethereum donations to GIVbacks Eligible projects are rewarded with GIV. Boost this project to increase its rewards percentage and make it more visible on the projects page!",
"project.givback_toast.description.verified_public_not_eligible": "Stake and lock your GIV tokens to get GIVpower. Boost this project make it more visible on the projects page! Note that while this project is eligible to be boosted with GIVpower, it will not yield GIVbacks to it's donors.",
"project.givback_toast.title.non_verified_owner": "Is your project creating or supporting public goods?",
"project.givback_toast.title.non_verified_owner_cancelled": "Project Cancelled",
"project.givback_toast.title.non_verified_owner_deactive": "Project Deactivated",
Expand All @@ -1641,6 +1644,7 @@
"project.givback_toast.title.non_verified_owner_rejected": "We couldn't approve your project as GIVbacks eligible",
"project.givback_toast.title.non_verified_owner_submitted": "Application submitted",
"project.givback_toast.title.non_verified_public": "Why no GIVbacks?",
"project.givback_toast.title.verified_public_not_eligible": "Boost this project with GIVpower!",
"project.givback_toast.title.verified_owner_1": "Donors get rewarded with up to ",
"project.givback_toast.title.verified_owner_2": " of the donation value!",
"project.givback_toast.title.verified_public_1": "Get rewarded with up to ",
Expand Down
4 changes: 4 additions & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,8 @@
"label.verification_rejected": "Verificación rechazada",
"label.verification_status": "Estado de verificación",
"label.verified": "Verificado",
"label.vouched": "Avalado",
"label.isGivbackEligible": "Elegible para GIVbacks",
"label.verified_projects": "Proyectos verificados",
"label.verified_status_for": "Elegibilidad para GIVbacks para",
"label.verify_email_address": "Verificar email",
Expand Down Expand Up @@ -1628,6 +1630,7 @@
"project.givback_toast.description.verified_owner": "Impulsa tu proyecto para aumentar la cantidad de GIVbacks que reciben tus donantes en Ethereum y aumentar su visibilidad entre otros proyectos.",
"project.givback_toast.description.verified_owner.note": "Como propietario de este proyecto, no recibirás GIVbacks por donar a él.",
"project.givback_toast.description.verified_public": "Las donaciones en Ethereum a proyectos elegibles para GIVbacks son recompensadas con GIV. ¡Impulsa este proyecto para aumentar su porcentaje de recompensas y hacerlo más visible en la página de proyectos!",
"project.givback_toast.description.verified_public_not_eligible": "Haz stake y bloquea tus GIV tokens para obtener GIVpower. ¡Impulsa este proyecto para hacerlo más visible en la página de proyectos! Ten en cuenta que aunque este proyecto es elegible para ser impulsado con GIVpower, no generará GIVbacks para sus donantes.",
"project.givback_toast.title.non_verified_owner": "¿Tu proyecto está creando o apoyando bienes públicos?",
"project.givback_toast.title.non_verified_owner_cancelled": "Estado Cancelado",
"project.givback_toast.title.non_verified_owner_deactive": "Modo Desactivado",
Expand All @@ -1636,6 +1639,7 @@
"project.givback_toast.title.non_verified_owner_rejected": "No pudimos verificar tu proyecto como un bien público",
"project.givback_toast.title.non_verified_owner_submitted": "Solicitud enviada",
"project.givback_toast.title.non_verified_public": "¿Por qué no GIVbacks?",
"project.givback_toast.title.verified_public_not_eligible": "Boostea este proyecto con GIVpower!",
"project.givback_toast.title.verified_owner_1": "Los donantes reciben recompensas de hasta ",
"project.givback_toast.title.verified_owner_2": " del valor de la donación.",
"project.givback_toast.title.verified_public_1": "¡Recibe recompensas de hasta ",
Expand Down
4 changes: 4 additions & 0 deletions src/apollo/gql/gqlProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const PROJECT_CORE_FIELDS = gql`
image
slug
verified
isGivbackEligible
totalDonations
qfRounds {
id
Expand Down Expand Up @@ -142,6 +143,7 @@ export const FETCH_PROJECT_BY_SLUG_DONATION = gql`
slug
descriptionSummary
verified
isGivbackEligible
totalDonations
sumDonationValueUsdForActiveQfRound
countUniqueDonorsForActiveQfRound
Expand Down Expand Up @@ -211,6 +213,7 @@ export const FETCH_PROJECT_BY_SLUG_SINGLE_PROJECT = gql`
image
slug
verified
isGivbackEligible
totalDonations
description
addresses {
Expand Down Expand Up @@ -595,6 +598,7 @@ export const ADD_RECIPIENT_ADDRESS_TO_PROJECT = gql`
listed
reviewStatus
verified
isGivbackEligible
slugHistory
creationDate
adminUserId
Expand Down
1 change: 1 addition & 0 deletions src/apollo/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface IProject {
impactLocation?: string;
qualityScore?: number;
verified?: boolean;
isGivbackEligible?: boolean;
verificationStatus?: EProjectVerificationStatus;
listed?: boolean | null;
categories: ICategory[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/DonateSocialBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ISocialBox {
const DonateSocialBox: FC<ISocialBox> = props => {
const [showModal, setShowModal] = useState<boolean>(false);
const { project, isDonateFooter } = props;
const { slug, verified } = project;
const { slug } = project;
const { isMobile } = useDetectDevice();
const { formatMessage } = useIntl();
const { isActive } = useProjectContext();
Expand Down
36 changes: 36 additions & 0 deletions src/components/badges/GivBackBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
Overline,
FlexCenter,
brandColors,
IconGIVBack,
} from '@giveth/ui-design-system';
import styled from 'styled-components';
import { useIntl } from 'react-intl';

export const GivBackBadge = () => {
const { formatMessage } = useIntl();
return (
<Wrapper>
<IconGIVBack color='white' />
<TextBadge $styleType='Small'>
{formatMessage({ id: 'label.isGivbackEligible' })}
</TextBadge>
</Wrapper>
);
};

const Wrapper = styled(FlexCenter)`
height: 30px;
background: ${brandColors.giv[500]};
border-radius: 56px;
color: white;
padding: 2px 12px 0 10px;
justify-content: center;
margin-right: 8px;
`;

const TextBadge = styled(Overline)`
padding-left: 0.5rem;
margin-right: 5px;
text-transform: uppercase;
`;
2 changes: 1 addition & 1 deletion src/components/badges/VerifiedBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const VerifiedBadge = () => {
<Wrapper>
<IconVerifiedBadge />
<TextBadge $styleType='Small'>
{formatMessage({ id: 'label.verified' })}
{formatMessage({ id: 'label.vouched' })}
</TextBadge>
</Wrapper>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/menu/FilterMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IFilterMenuProps {

const projectsFeatures = [
{
label: { id: 'label.verified' },
label: { id: 'label.vouched' },
value: EProjectsFilter.VERIFIED,
},
];
Expand Down
20 changes: 19 additions & 1 deletion src/components/project-card/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
H5,
Flex,
IconHelpFilled16,
IconGIVBack16,
} from '@giveth/ui-design-system';
import Link from 'next/link';
import { useIntl } from 'react-intl';
Expand Down Expand Up @@ -61,6 +62,7 @@ interface IRecurringDonation {
}
const ProjectCard = (props: IProjectCard) => {
const { project, className } = props;

const {
id,
title,
Expand All @@ -72,6 +74,7 @@ const ProjectCard = (props: IProjectCard) => {
sumDonationValueUsdForActiveQfRound,
organization,
verified,
isGivbackEligible,
latestUpdateCreationDate,
countUniqueDonors,
qfRounds,
Expand Down Expand Up @@ -338,14 +341,24 @@ const ProjectCard = (props: IProjectCard) => {
<Hr />
<PaddedRow $justifyContent='space-between'>
<Flex gap='16px'>
{isGivbackEligible && (
<Flex $alignItems='center' gap='4px'>
<IconGIVBack16
color={brandColors.giv[500]}
/>
<GivbackEligibleText>
GIVbacks
</GivbackEligibleText>
</Flex>
)}
{verified && (
<Flex $alignItems='center' gap='4px'>
<IconVerifiedBadge16
color={semanticColors.jade[500]}
/>
<VerifiedText>
{formatMessage({
id: 'label.verified',
id: 'label.vouched',
})}
</VerifiedText>
</Flex>
Expand Down Expand Up @@ -424,6 +437,11 @@ const VerifiedText = styled(Subline)`
color: ${semanticColors.jade[500]};
`;

const GivbackEligibleText = styled(Subline)`
text-transform: uppercase;
color: ${brandColors.giv[500]};
`;

const LastUpdatedContainer = styled(Subline)<{ $isHover?: boolean }>`
position: absolute;
bottom: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/donate/DonateIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const DonateIndex: FC = () => {
],
givBackEligible:
isTokenEligibleForGivback &&
project.verified &&
project.isGivbackEligible &&
isSignedIn &&
isEnabled,
chainId: config.STELLAR_NETWORK_NUMBER,
Expand Down
6 changes: 6 additions & 0 deletions src/components/views/donate/DonatePageProjectDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { slugToProjectView } from '@/lib/routeCreators';
import { ProjectCardUserName } from '@/components/project-card/ProjectCardUserName';
import { ORGANIZATION } from '@/lib/constants/organizations';
import { useDonateData } from '@/context/donate.context';
import { GivBackBadge } from '@/components/badges/GivBackBadge';

interface IDonatePageProjectDescriptionProps {
projectData?: IProject;
Expand Down Expand Up @@ -48,6 +49,11 @@ export const DonatePageProjectDescription: FC<

return (
<DonationSectionWrapper gap='16px'>
{projectData?.isGivbackEligible && (
<Flex>
<GivBackBadge />
</Flex>
)}
{projectData?.verified && (
<Flex>
<VerifiedBadge />
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/donate/OnTime/OneTimeDonationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const CryptoDonation: FC<{
const dispatch = useAppDispatch();

const {
verified,
isGivbackEligible,
id: projectId,
status,
addresses,
Expand Down Expand Up @@ -139,7 +139,7 @@ const CryptoDonation: FC<{
});

const tokenDecimals = selectedOneTimeToken?.decimals || 18;
const projectIsGivBackEligible = !!verified;
const projectIsGivBackEligible = !!isGivbackEligible;
const { activeStartedRound } = getActiveRound(project.qfRounds);
const networkId = (chain as Chain)?.id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const RecurringDonationCard = () => {
? semanticColors.punch
: brandColors.giv;

const projectIsGivBackEligible = !!project.verified;
const projectIsGivBackEligible = !!project.isGivbackEligible;

const handleDonate = () => {
if (anchorContractAddress) {
Expand Down
17 changes: 15 additions & 2 deletions src/components/views/project/ProjectBadges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
neutralColors,
semanticColors,
Flex,
IconGIVBack16,
} from '@giveth/ui-design-system';
import styled from 'styled-components';
import { useIntl } from 'react-intl';
Expand All @@ -15,7 +16,8 @@ import { hasActiveRound } from '@/helpers/qf';
const ProjectBadges = () => {
const { projectData } = useProjectContext();

const { verified, qfRounds, campaigns } = projectData || {};
const { verified, isGivbackEligible, qfRounds, campaigns } =
projectData || {};
const { formatMessage } = useIntl();
const isQF = hasActiveRound(qfRounds);

Expand All @@ -28,12 +30,23 @@ const ProjectBadges = () => {
{verified && (
<ProjectBadge
badgeText={formatMessage({
id: 'label.verified',
id: 'label.vouched',
})}
wrapperColor={semanticColors.jade[700]}
BadgeIcon={<IconVerifiedBadge16 />}
/>
)}
{isGivbackEligible && (
<ProjectBadge
badgeText={formatMessage({
id: 'label.isGivbackEligible',
})}
textColor={brandColors.giv[500]}
wrapperColor={'white'}
BadgeIcon={<IconGIVBack16 color={brandColors.giv[500]} />}
/>
)}

{isQF && (
<ProjectBadge
badgeText={formatMessage({
Expand Down
Loading

0 comments on commit fc54246

Please sign in to comment.