Skip to content

Commit

Permalink
feat: update invite page and adjust cashback (#5364)
Browse files Browse the repository at this point in the history
* feat: update invite page and adjust cashback

* update
  • Loading branch information
zjy365 authored Feb 11, 2025
1 parent a6e8c9c commit 505eaa5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
8 changes: 4 additions & 4 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FROM deps AS builder
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED=1

# COPY --from=deps /app/packages ./packages

Expand All @@ -62,9 +62,9 @@ fi
# Production image, copy all the files and run next
FROM base AS runner

ENV NODE_ENV production
ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
Expand Down Expand Up @@ -96,7 +96,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/$path/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/$path/.next/static ./$path/.next/static
EXPOSE 3000

ENV PORT 3000
ENV PORT=3000

ENV launchpath=./${path}/server.js

Expand Down
9 changes: 5 additions & 4 deletions frontend/providers/invite/public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"Cumulative number of invitees": "Cumulative number of invitees",
"Earnings": "Earnings",
"Cashback Ratio": "Cashback Ratio",
"Every time a friend recharges": "Every time a friend recharges, you will receive a balance reward of {{amount}}",
"Cashback Ratio": "Cashback Rules",
"every_time_a_friend_recharges": "2. Every time a friend recharges, you will receive a rebate of TA's recharge amount <strong>{{amount}}</strong>",
"Invitation link": "Invitation link",
"Copy link": "Copy link",
"Time": "Time",
"Amount": "Amount",
"No invitation records": "No invitation records~"
}
"No invitation records": "No invitation records~",
"cashback_first_rule": "1. After a friend completes real-name authentication, you and TA will receive a <strong>{{amount}}</strong> yuan balance reward"
}
9 changes: 5 additions & 4 deletions frontend/providers/invite/public/locales/zh/common.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"Cumulative number of invitees": "累计邀请人数",
"Earnings": "收益",
"Cashback Ratio": "返现比例",
"Every time a friend recharges": "好友每次充值,您都获得 {{amount}} 的余额奖励",
"Cashback Ratio": "返现规则",
"every_time_a_friend_recharges": "2. 好友每次充值,您会获得TA的充值金额 <strong>{{amount}}</strong> 的返利",
"Invitation link": "邀请链接",
"Copy link": "复制链接",
"Time": "时间",
"Amount": "金额",
"No invitation records": "无邀请记录~"
}
"No invitation records": "无邀请记录~",
"cashback_first_rule": "1. 好友完成实名认证后,您和TA都将获得 <strong>{{amount}}</strong> 元余额奖励"
}
18 changes: 15 additions & 3 deletions frontend/providers/invite/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query';
import dayjs from 'dayjs';
import { useTranslation } from 'next-i18next';
import { useTranslation, Trans } from 'next-i18next';
import { useCallback } from 'react';

export default function Index({
Expand Down Expand Up @@ -79,10 +79,22 @@ export default function Index({
<Flex alignItems={'center'} justifyContent={'center'} flexDirection={'column'}>
<Box mb="4px">{t('Cashback Ratio')}</Box>
<Text fontSize={'12px'}>
{t('Every time a friend recharges', { amount: `${parseFloat(GIFT_RATIO) * 100}%` })}
<Trans
i18nKey="cashback_first_rule"
values={{
amount: 5
}}
/>
</Text>
<Text fontSize={'12px'}>
<Trans
i18nKey="every_time_a_friend_recharges"
values={{
amount: `${parseFloat(GIFT_RATIO) * 100}%`
}}
/>
</Text>
</Flex>
<Box {...titleStyles}>{parseFloat(GIFT_RATIO) * 100}%</Box>
</Box>
<Box {...statisticsStyles}>
<Flex alignItems={'center'} justifyContent={'center'}>
Expand Down

0 comments on commit 505eaa5

Please sign in to comment.