Skip to content

Commit

Permalink
Merge pull request #4739 from Giveth/4679_modify_givback_change_to_be…
Browse files Browse the repository at this point in the history
…_compatible_With_raffle

pull givsbacks raffle changes into de verification text
  • Loading branch information
divine-comedian authored Sep 16, 2024
2 parents c5e8710 + 9343a9d commit 5591923
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 66 deletions.
12 changes: 6 additions & 6 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"label.drag_and_drop_an_image_or": "Drag & drop an image here or,",
"label.drag_to_allocate": "Drag to allocate",
"label.duration_ago": "{duration} ago",
"label.each_givbacks_round_lasts_two_weeks": "Each GIVbacks round lasts two weeks. After the End Date, the GIV Allocated to that round is distributed to Givers who donated to GIVbacks eligible projects during the round. Projects must apply for GIVbacks eligibility at least 1 week prior to the Start Date in order to be included in the round.",
"label.each_givbacks_round_lasts_two_weeks": "Each GIVbacks round lasts two weeks. The GIVbacks Rewards available depends on the amount donated at in the round, to a maximum amount of 1 million GIV. After the End Date, the GIVbacks Rewards for the round go to the eligible donors.",
"label.earn": "Earn",
"label.earn_a_yield": "Earn a Yield",
"label.earn_giv_tokens_for_each_donation_made_through_your_link": "Earn GIV tokens for each donation made through your link",
Expand Down Expand Up @@ -433,8 +433,8 @@
"label.givbacks_is_only_available_on_gnosis": "GIVbacks is only available on Gnosis Chain.",
"label.givbacks_program": "GIVbacks program",
"label.givbacks_rewards": "GIVbacks Rewards",
"label.givbacks_rewards_corresponding_to_the_current_round": "GIVbacks rewards corresponding to the current round become available after the round ends. If you donated to a GIVbacks eligible project and do not yet have rewards to claim, it is likely that GIVbacks have not yet been distributed for that round, or that you claimed your GIVbacks rewards already.",
"label.givbacks_rewards_donors_to_verified_projects": "GIVbacks rewards donors to GIVbacks eligible projects with GIV, super-charging Giveth as a donor-driven force for good.",
"label.givbacks_rewards_corresponding_to_the_current_round": "GIVbacks rewards corresponding to the current round become available after the round ends. If you donated to a verified project and do not yet have rewards to claim, it is likely that GIVbacks have not yet been distributed for that round, or that you claimed your GIVbacks rewards already.",
"label.givbacks_rewards_donors_to_verified_projects": "When you make a donation of $5 or more to a GIVbacks eligible project you qualify to get GIV!",
"label.givback_distributed_after_round": "GIV rewards from the GIVbacks program will be distributed after the end of the current round.",
"label.give": "Give",
"label.giveconomy": "GIVeconomy",
Expand Down Expand Up @@ -479,7 +479,7 @@
"label.givstream_rewards": "GIVstream Rewards",
"label.givstream_source": "GIVstream Source",
"label.givtoken_holders_influence_the_treasyry": "GIV token holders influence the treasury, roadmap and mission of the Giveth ecosystem. By voting in the GIVgarden you earn rewards on your staked GIV!",
"label.giv_allocated_to_round": "GIV Allocated to Round",
"label.giv_allocated_to_round": "GIVbacks Rewards",
"label.giv_fuels_and_directs": "GIV fuels and directs the Future of Giving, inspiring people to become Givers and participate in an ecosystem of collective support, abundance, and value-creation.",
"label.giv_staking_is_available_on_gnosis_chain": "GIV staking is available on Gnosis Chain. Please bridge your GIV to Gnosis Chain, then switch network and stake to earn rewards.",
"label.global_impact": "Global Impact",
Expand Down Expand Up @@ -1150,8 +1150,8 @@
"label.when_others_give_you_earn": "When others give, you earn",
"label.when_someone_donates_using_your_link": "When someone donates to a GIVbacks eligible project via your link, you’ll earn GIV!",
"label.when_you_allocate_a_percentage_of_your_total_givpower": "When you allocate a percentage of your total GIVpower to this project, the GIVpower you have on other projects will decrease proportionally.",
"label.when_you_donate_to_Verified_projects": "When you donate to GIVbacks eligible projects you qualify to receive GIV tokens. Through GIVbacks, GIV empowers donors with governance rights via the GIVgarden.",
"label.when_you_giv_you_get_giv_back": "When you give you get GIV back!",
"label.when_you_donate_to_Verified_projects": "When you donate to verified projects you qualify to receive GIV tokens. Through GIVbacks, GIV empowers donors with governance rights via the GIVgarden.",
"label.when_you_giv_you_get_giv_back": "Give and get GIV back!",
"label.when_you_harvest": "When you harvest {tokenSymbol} rewards, all liquid {tokenSymbol} allocated to you on that chain is sent to your wallet. Your {tokenSymbol}stream flowrate may also increase. Below is the breakdown of rewards you will get when you harvest.",
"label.when_you_lock_your_tokens_midround": "When you lock your tokens mid-round, they will be locked for the remainder of the current round + the numbers of rounds you select.",
"label.where?": "Where?",
Expand Down
12 changes: 12 additions & 0 deletions src/apollo/gql/gqlGivbacks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { gql } from '@apollo/client';

export const FETCH_ALLOCATED_GIVBACKS = gql`
query allocatedGivbacks($refreshCache: Boolean) {
allocatedGivbacks(refreshCache: $refreshCache) {
usdValueSentAmountInPowerRound
allocatedGivTokens
givPrice
date
}
}
`;
85 changes: 27 additions & 58 deletions src/components/GIVeconomyPages/GIVbacks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
GIVbackRewardCard,
GBSubtitle,
GBTitle,
GbDataBlock,
GbButton,
GIVBackCard,
RoundSection,
RoundTitle,
Expand All @@ -46,6 +44,8 @@ import links from '@/lib/constants/links';
import Routes from '@/lib/constants/Routes';
import { SubgraphDataHelper } from '@/lib/subgraph/subgraphDataHelper';
import { fetchSubgraphData } from '@/services/subgraph.service';
import { FETCH_ALLOCATED_GIVBACKS } from '@/apollo/gql/gqlGivbacks';
import { client } from '@/apollo/apolloClient';

export const TabGIVbacksTop = () => {
const { formatMessage } = useIntl();
Expand Down Expand Up @@ -107,14 +107,6 @@ export const TabGIVbacksTop = () => {
actionCb={() => {
setShowHarvestModal(true);
}}
subButtonLabel={
givbackLiquidPart === 0n
? formatMessage({
id: 'label.why_dont_i_have_givbacks',
})
: undefined
}
subButtonCb={() => setShowGivBackExplain(true)}
network={chain?.id}
targetNetworks={[
{
Expand Down Expand Up @@ -157,6 +149,27 @@ export const TabGIVbacksBottom = () => {
const [round, setRound] = useState(0);
const [roundStarTime, setRoundStarTime] = useState(new Date());
const [roundEndTime, setRoundEndTime] = useState(new Date());
// Define an interface for the type of givbackAllocations
interface GivbackAllocations {
usdValueSentAmountInPowerRound: number;
allocatedGivTokens: number;
givPrice: number;
date: string;
}
const [givbackAllocations, setGivbackAllocations] =
useState<GivbackAllocations | null>(null);

useEffect(() => {
async function fetchAllocatedGivbacks() {
const { data } = await client.query({
query: FETCH_ALLOCATED_GIVBACKS,
fetchPolicy: 'no-cache',
});
setGivbackAllocations(data?.allocatedGivbacks);
}
fetchAllocatedGivbacks();
}, []);

const { givTokenDistroHelper, isLoaded } = useGIVTokenDistroHelper();
useEffect(() => {
if (
Expand Down Expand Up @@ -185,51 +198,6 @@ export const TabGIVbacksBottom = () => {
return (
<GIVbacksBottomContainer>
<Container>
<Row>
<Col xs={12} sm={6}>
<GbDataBlock
title={formatMessage({ id: 'label.donor_rewards' })}
button={
<Link href={Routes.AllProjects}>
<GbButton
label={formatMessage({
id: 'label.donate_to_earn_giv',
})}
linkType='secondary'
size='large'
/>
</Link>
}
>
{formatMessage({
id: 'label.when_you_donate_to_Verified_projects',
})}
</GbDataBlock>
</Col>
<Col xs={12} sm={6}>
<GbDataBlock
title={formatMessage({
id: 'label.project_verification',
})}
button={
<GbButton
isExternal
label={formatMessage({
id: 'label.verify_your_project',
})}
linkType='secondary'
size='large'
href={links.VERIFICATION_DOCS}
target='_blank'
/>
}
>
{formatMessage({
id: 'label.great_projects_make_the_giveconomy_thrive',
})}
</GbDataBlock>
</Col>
</Row>
<GIVBackCard>
<Row>
<Col xs={12} md={8}>
Expand Down Expand Up @@ -303,9 +271,10 @@ export const TabGIVbacksBottom = () => {
</P>
<GivAllocated>
<NoWrap>
{formatMessage({
id: 'label.one_million_giv',
})}
{givbackAllocations &&
givbackAllocations.allocatedGivTokens
? `${givbackAllocations.allocatedGivTokens} GIV`
: '?'}
</NoWrap>
</GivAllocated>
</RoundInfoTallRow>
Expand Down
4 changes: 2 additions & 2 deletions src/content/metatags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const projectsMetatags = {
};

export const givbacksMetatags = {
title: 'GIVbacks: Get rewarded for donating to GIVbacks eligible projects',
desc: 'GIVbacks rewards donors to GIVbacks eligible projects with GIV, super-charging Giveth as a donor-driven force for good.',
title: 'GIVbacks: Get rewarded for donating to verified projects',
desc: 'When you make a donation of $5 or more to a GIVbacks eligible project you qualify to get GIV!',
image: 'https://i.ibb.co/HTbdCdd/Thumbnail.png',
url: 'https://giveth.io/givbacks',
};
Expand Down

0 comments on commit 5591923

Please sign in to comment.