Skip to content

Commit

Permalink
fix: timer & translation Capital letter problem & tele popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Salvatore committed Feb 7, 2024
1 parent 9d52b41 commit d45e0bb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
12 changes: 6 additions & 6 deletions public/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"Welcome": "Welcome",
"Remaining Traffic": "Remaining Traffic",
"Remaining time": "Remaining time",
"year": "Year",
"years": "Years",
"month": "Month",
"months": "Months",
"Year": "Year",
"Years": "Years",
"Month": "Month",
"Months": "Months",
"Support": "Support",
"Join our Telegram channel in case you have any questions on how to use the links.": "Join our Telegram channel in case you have any questions on how to use the links.",
"Name": "Name",
Expand Down Expand Up @@ -67,8 +67,8 @@
"Portuguese": "Portuguese",
"Configs": "Configs",
"Choose your preferred language:": "Choose your preferred Language:",
"day": "Day",
"days": "Days",
"Day": "Day",
"Days": "Days",
"Used Traffic": "Used Traffic",
"Please connect your Telegram account to the panel to know the latest status of your subscription": "Please connect your Telegram account to the panel to know the latest status of your subscription",
"Connect To Telegram": "Connect To Telegram"
Expand Down
12 changes: 6 additions & 6 deletions public/i18n/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"Welcome": "خوش آمدی",
"Remaining Traffic": "ترافیک باقی مانده",
"Remaining time": "زمان باقی مانده",
"year": "سال",
"years": "سال",
"month": "ماه",
"months": "ماه",
"Year": "سال",
"Years": "سال",
"Month": "ماه",
"Months": "ماه",
"Support": "پشتیبانی",
"Join our Telegram channel in case you have any questions on how to use the links.": "در صورتی که در مورد نحوه استفاده از لینک ها سوالی دارید به کانال تلگرام ما بپیوندید.",
"Name": "نام",
Expand Down Expand Up @@ -59,8 +59,8 @@
"Farsi": "فارسی",
"Configs": "تنظیمات",
"Choose your preferred language:": "زبان مورد نظر خود را انتخاب کنید",
"day": "روز",
"days": "روز",
"Day": "روز",
"Days": "روز",
"Used Traffic": "ترافیک مصرف شده",
"Please connect your Telegram account to the panel to know the latest status of your subscription": "لطفا اکانت تلگرام خود را به پنل متصل کنید تا از آخرین وضعیت اشتراک خودتان مطلع شوید",
"Connect To Telegram": "اتصال به تلگرام"
Expand Down
18 changes: 16 additions & 2 deletions src/pages/home/components/MainBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,22 @@ const MainBody = () => {


useEffect(() => {
if(getInfo.data && !getInfo.data?.telegram_id && getInfo.data?.telegram_bot_url){
setIsModalOpen(true)
if(getInfo.data){
const hasTeleId = (
getInfo.data?.telegram_id !== 0 ||
getInfo.data?.telegram_id !== undefined ||
getInfo.data?.telegram_id !== null ||
getInfo.data?.telegram_id !== '')

const hasTeleBotUrl = (
getInfo.data?.telegram_bot_url !== '' &&
getInfo.data?.telegram_bot_url !== null &&
getInfo.data?.telegram_bot_url !== undefined
)

if(hasTeleBotUrl && !hasTeleId){
setIsModalOpen(true)
}
}
}, [getInfo.data])

Expand Down
8 changes: 3 additions & 5 deletions src/pages/home/components/ShareLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ const ShareLinks: React.FC<propsTypes> = ({ isModalOpen }) => {
style: { resize: "both" },
endAdornment: (
<InputAdornment position="end">
<div className='flex items-center gap-1'>
{getShortLink.isLoading ?
<CircularProgress size={20} thickness={4}/>
:
<>
<div className='flex flex-col justify-center items-center'>
<AvTimerIcon fontSize='small' />
<Text fontSize='xs' fontWeight='regular' className='text-[#6C757D]'>
<Countdown
onComplete={() => getShortLink.refetch()}
Expand All @@ -142,10 +142,8 @@ const ShareLinks: React.FC<propsTypes> = ({ isModalOpen }) => {
date={new Date().setSeconds(new Date().getSeconds() + getShortLink.data?.expire_in )}
/>
</Text>
<AvTimerIcon />
</>
</div>
}
</div>
</InputAdornment>
)
}}
Expand Down

0 comments on commit d45e0bb

Please sign in to comment.