Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/shared/src/components/cores/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ export const coresFAQItems: FAQItem[] = [
description:
'Cores are non-refundable once purchased. Please double-check your selected bundle before completing the transaction. If you run into any issues, you can always reach out to support@daily.dev and we’ll do our best to help.',
},
{
title: 'Can I convert Cores into real money?',
description:
'We’re currently experimenting with monetization. In some cases, eligible users may request withdrawals once they meet minimum thresholds. This feature may require identity verification, isn’t available in all countries, and is subject to platform policies and changes.',
},
{
title: 'Are Cores included in the daily.dev Plus subscription?',
description:
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ export const DeletedPostId = '404';
export const BROADCAST_CHANNEL_NAME = 'dailydev_broadcast';
export const broadcastChannel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);

export const withdrawLink = 'https://r.daily.dev/withdraw';

export const coresDocsLink = 'https://r.daily.dev/cores';

export const webFunnelPrefix = '/helloworld';
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/src/lib/transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,4 @@ export const getTransactionLabel = ({
return type.toUpperCase();
};

export const minCoresEarningsThreshold = 100_000;

export const coreApproxValueUSD = 100;
82 changes: 1 addition & 81 deletions packages/webapp/pages/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ import {
} from '@dailydotdev/shared/src/components/buttons/Button';
import {
Typography,
TypographyColor,
TypographyType,
} from '@dailydotdev/shared/src/components/typography/Typography';
import {
coresDocsLink,
creatorsTermsOfService,
onboardingUrl,
webappUrl,
withdrawLink,
} from '@dailydotdev/shared/src/lib/constants';
import {
CoreIcon,
Expand All @@ -34,22 +32,15 @@ import { WidgetContainer } from '@dailydotdev/shared/src/components/widgets/comm
import { IconSize } from '@dailydotdev/shared/src/components/Icon';
import classNames from 'classnames';
import classed from '@dailydotdev/shared/src/lib/classed';
import { ProgressBar } from '@dailydotdev/shared/src/components/fields/ProgressBar';

import { LogEvent, Origin } from '@dailydotdev/shared/src/lib/log';
import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext';
import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext';
import {
formatCoresCurrency,
formatCurrency,
} from '@dailydotdev/shared/src/lib/utils';
import { formatCoresCurrency } from '@dailydotdev/shared/src/lib/utils';
import {
getTransactionType,
getTransactionLabel,
coreApproxValueUSD,
minCoresEarningsThreshold,
} from '@dailydotdev/shared/src/lib/transaction';
import { anchorDefaultRel } from '@dailydotdev/shared/src/lib/strings';
import { useInfiniteQuery, useQuery } from '@tanstack/react-query';
import {
generateQueryKey,
Expand Down Expand Up @@ -192,10 +183,6 @@ const Wallet = (): ReactElement => {
return null;
}

const earningsProgressPercentage =
user.balance.amount / (minCoresEarningsThreshold / 100);
const coresValueUSD = minCoresEarningsThreshold / coreApproxValueUSD;

return (
<ProtectedPage>
<div className="m-auto flex w-full max-w-screen-laptop flex-col pb-12 tablet:pb-0 laptop:min-h-page laptop:flex-row laptop:border-l laptop:border-r laptop:border-border-subtlest-tertiary laptop:pb-6 laptopL:pb-0">
Expand Down Expand Up @@ -261,73 +248,6 @@ const Wallet = (): ReactElement => {
/>
</section>
<Divider />
<section className="flex w-full flex-col gap-6">
<div className="flex flex-col gap-1">
<Typography type={TypographyType.Body}>
<strong>Earn with daily.dev</strong> (beta)
</Typography>
<Typography
type={TypographyType.Callout}
color={TypographyColor.Tertiary}
>
Earn income by engaging with the daily.dev community,
contributing valuable content, and receiving Cores from
others. Once you reach{' '}
{formatCurrency(minCoresEarningsThreshold, {
minimumFractionDigits: 0,
})}{' '}
Cores, you can request a withdrawal. Monetization is still in
beta, so additional eligibility steps and requirements may
apply.
</Typography>
</div>
<div className="flex gap-2">
<CoreIcon />
<div className="flex flex-1 flex-col gap-1.5">
<ProgressBar
shouldShowBg
percentage={earningsProgressPercentage}
className={{
wrapper: 'h-2 rounded-8',
bar: 'h-full rounded-8',
barColor: 'bg-accent-bun-default',
}}
/>
<Typography type={TypographyType.Callout}>
{formatCurrency(user.balance.amount, {
minimumFractionDigits: 0,
})}{' '}
/{' '}
<strong>
{formatCurrency(minCoresEarningsThreshold, {
minimumFractionDigits: 0,
})}
</strong>{' '}
Cores (≈ USD $
{formatCurrency(coresValueUSD, {
minimumFractionDigits: 0,
})}
)
</Typography>
</div>
</div>
<Button
tag="a"
variant={
earningsProgressPercentage < 100
? ButtonVariant.Secondary
: ButtonVariant.Primary
}
className="mr-auto"
disabled={earningsProgressPercentage < 100}
href={withdrawLink}
target="_blank"
rel={anchorDefaultRel}
>
Withdraw
</Button>
</section>
<Divider />
<section className="flex w-full flex-col gap-6">
<Typography type={TypographyType.Body} bold>
Transaction history
Expand Down