Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
8efaf00e
Commit
8efaf00e
authored
Oct 04, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add share link
parent
b4e999ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
CongratsStepContent.tsx
ui/rewards/steps/CongratsStepContent.tsx
+14
-4
No files found.
ui/rewards/steps/CongratsStepContent.tsx
View file @
8efaf00e
...
@@ -18,6 +18,10 @@ const CongratsStepContent = ({ isReferral }: Props) => {
...
@@ -18,6 +18,10 @@ const CongratsStepContent = ({ isReferral }: Props) => {
const
referralsQuery
=
useReferrals
();
const
referralsQuery
=
useReferrals
();
const
rewardsConfigQuery
=
useRewardsConfig
();
const
rewardsConfigQuery
=
useRewardsConfig
();
const
registrationReward
=
rewardsConfigQuery
.
data
?.
rewards
.
registration
;
const
referralReward
=
Number
(
rewardsConfigQuery
.
data
?.
rewards
.
registration_with_referral
)
-
Number
(
rewardsConfigQuery
.
data
?.
rewards
.
registration
);
const
refLink
=
`https://eth.blockscout.com?ref=
${
referralsQuery
.
data
?.
code
}
`;
const shareText = `
Just
signed
up
for
@
blockscoutcom
Merits
program
and
got
$
{
registrationReward
}
merits
!
\
n
\
nUse
my
referral
link
to
get
extra
$
{
referralReward
}
merits
:
$
{
refLink
}
`; // eslint-disable-line max-len
return (
return (
<>
<>
<Flex
<Flex
...
@@ -42,11 +46,11 @@ const CongratsStepContent = ({ isReferral }: Props) => {
...
@@ -42,11 +46,11 @@ const CongratsStepContent = ({ isReferral }: Props) => {
{ [
{ [
{
{
title: 'Registration',
title: 'Registration',
value
:
re
wardsConfigQuery
.
data
?.
rewards
.
registration
,
value: re
gistrationReward
,
},
},
{
{
title: 'Referral program',
title: 'Referral program',
value
:
Number
(
rewardsConfigQuery
.
data
?.
rewards
.
registration_with_referral
)
-
Number
(
rewardsConfigQuery
.
data
?.
rewards
.
registration
)
,
value:
referralReward
,
},
},
].map(({ title, value }) => (
].map(({ title, value }) => (
<Flex key={ title } alignItems="center">
<Flex key={ title } alignItems="center">
...
@@ -99,11 +103,17 @@ const CongratsStepContent = ({ isReferral }: Props) => {
...
@@ -99,11 +103,17 @@ const CongratsStepContent = ({ isReferral }: Props) => {
</Text>
</Text>
<CopyField
<CopyField
label="Referral link"
label="Referral link"
value=
{
`https://eth.blockscout.com?ref=${ referralsQuery.data?.code }`
}
value={
refLink
}
isLoading={ referralsQuery.isLoading }
isLoading={ referralsQuery.isLoading }
mt={ 3 }
mt={ 3 }
/>
/>
<
Button
mt=
{
6
}
isLoading=
{
referralsQuery
.
isLoading
}
>
<Button
as="a"
target="_blank"
mt={ 6 }
isLoading={ referralsQuery.isLoading }
href={ `
https
:
//x.com/intent/tweet?text=${ encodeURIComponent(shareText) }` }
>
Share
on
<
IconSvg
name
=
"
social/twitter
"
boxSize
=
{
6
}
ml
=
{
1
}
/
>
Share
on
<
IconSvg
name
=
"
social/twitter
"
boxSize
=
{
6
}
ml
=
{
1
}
/
>
<
/Button
>
<
/Button
>
<
/Flex
>
<
/Flex
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment