Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
carina-akaia committed Jan 17, 2025
2 parents 50d3188 + b798cd2 commit b16350e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 24 deletions.
32 changes: 23 additions & 9 deletions src/features/donation/components/DonationSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,34 @@ export const DonationSuccess = ({ form, transactionHash, closeModal }: DonationS

const profile: any = recipient?.near_social_profile_data;

const singlePorject = profile
? profile.linktree?.twitter
let PROJECT_TWITTER_ACCOUNT = recipient.id;

if (profile) {
PROJECT_TWITTER_ACCOUNT = profile.linktree?.twitter
? `@${profile.linktree.twitter}`
: profile.name
: recipient.id;
: profile.name;
}

const tag = `${PROJECT_TWITTER_ACCOUNT}`;

let potlockUrl = `https://alpha.potlock.org${routesPath.PROFILE}/${recipient.id}/donations`;
let potlockHomeUrl = "https://alpha.potlock.org";

const tag = `${singlePorject}`;
let text = `🎉 Just supported ${tag} (${PROJECT_TWITTER_ACCOUNT}) through @${PLATFORM_TWITTER_ACCOUNT_ID}!
💝 Making an impact by funding public goods that shape our future.
🤝 Join me in supporting amazing projects:\n`;

let url = `https://alpha.potlock.io${routesPath.PROFILE}/${recipient.id}/funding-raised`;
let text = `I just donated to ${tag} on @${PLATFORM_TWITTER_ACCOUNT_ID}! Support public goods at `;
text = encodeURIComponent(text);
url = encodeURIComponent(url);
potlockUrl = encodeURIComponent(potlockUrl);
potlockHomeUrl = encodeURIComponent(potlockHomeUrl);
return (
twitterIntentBase + text + `&url=${url}` + `&hashtags=${DEFAULT_SHARE_HASHTAGS.join(",")}`
twitterIntentBase +
text +
`&url=${potlockUrl}` +
`&related=${potlockHomeUrl}` +
`&hashtags=${DEFAULT_SHARE_HASHTAGS.join(",")}`
);
}, [recipient?.id, recipient?.near_social_profile_data]);

Expand Down
31 changes: 17 additions & 14 deletions src/features/profile-setup/components/ProjectEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,24 @@ export const ProjectEditor = () => {
/>
)}
/>

<FormField
control={form.control}
name="publicGoodReason"
render={({ field }) => (
<CustomTextForm
showHint
label="Why do you consider yourself a public good? *"
placeholder="Type the reason"
error={errors.publicGoodReason?.message}
field={field}
currentText={projectTemplate.publicGoodReason}
<>
{projectTemplate.categories?.includes("Public Good") ? (
<FormField
control={form.control}
name="publicGoodReason"
render={({ field }) => (
<CustomTextForm
showHint
label="Why do you consider yourself a public good?"
placeholder="Type the reason"
error={errors.publicGoodReason?.message}
field={field}
currentText={projectTemplate.publicGoodReason}
/>
)}
/>
)}
/>
) : null}
</>
</Row>

<SubHeader title="Smart contracts" className="mt-16" />
Expand Down
3 changes: 2 additions & 1 deletion src/features/profile-setup/models/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const projectEditorSchema = object({

publicGoodReason: string()
.min(20, "Must contain at least 20 characters")
.max(500, "Must be less 500 characters long"),
.max(500, "Must be less 500 characters long")
.optional(),

smartContracts: array(array(string())).optional(),

Expand Down

1 comment on commit b16350e

@vercel
Copy link

@vercel vercel bot commented on b16350e Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.