Skip to content

Commit

Permalink
trans
Browse files Browse the repository at this point in the history
  • Loading branch information
noobskies committed May 4, 2024
1 parent 0c57910 commit e38238d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/src/components/ClaimTokensButton/ClaimTokensButton.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import { FaRegThumbsUp, FaSpinner } from 'react-icons/fa';
import { useLocalize } from '~/hooks';

const ClaimTokensButton = ({ refetchBalance }) => {
const localize = useLocalize();
const [isActive, setIsActive] = useState(false);
const [countdown, setCountdown] = useState(0);
const [isSuccess, setIsSuccess] = useState(false);
Expand Down Expand Up @@ -90,12 +92,17 @@ const ClaimTokensButton = ({ refetchBalance }) => {
{isLoading ? (
<span className="flex items-center">
<FaSpinner className="mr-2 animate-spin" />
Loading...
</span>
) : (
<>
<span className={`${isSuccess ? 'invisible' : ''}`}>
{isActive ? 'Claim 20K Tokens' : `Claim in ${formatTime(countdown)}`}
{isActive ? (
localize('claim_active')
) : (
<>
{localize('claim_inactive')} {formatTime(countdown)}
</>
)}
</span>
{isSuccess && (
<span className="absolute inset-0 flex items-center justify-center animate-in fade-in">
Expand Down
2 changes: 2 additions & 0 deletions client/src/localization/languages/Eng.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,6 @@ export default {
home_feature_4: '• All your favorite AI models under one roof',
home_feature_5: '• Flexibility to purchase additional tokens as needed',
home_feature_6: '• User-friendly experience tailored to your requirements',
claim_active: 'Claim 20K Tokens',
claim_inactive: 'Claim in',
};
2 changes: 2 additions & 0 deletions client/src/localization/languages/Zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,6 @@ export default {
home_feature_4: '• 多款热门 AI 模型,一站即可体验',
home_feature_5: '• 根据需要灵活购买额外的算力',
home_feature_6: '• 根据您的需求量身定制的用户友好体验',
claim_active: '领取 20k 算力',
claim_inactive: '领取倒计时',
};

0 comments on commit e38238d

Please sign in to comment.