diff --git a/src/assets/images/hiddify-logo-noroz.png b/src/assets/images/hiddify-logo-noroz.png new file mode 100644 index 0000000..e662c81 Binary files /dev/null and b/src/assets/images/hiddify-logo-noroz.png differ diff --git a/src/pages/home/components/BrandAndLogo.tsx b/src/pages/home/components/BrandAndLogo.tsx index 2693956..bf2e8f4 100644 --- a/src/pages/home/components/BrandAndLogo.tsx +++ b/src/pages/home/components/BrandAndLogo.tsx @@ -1,6 +1,6 @@ import { Text } from "@designSystem/Text" import { CardMedia } from "@mui/material"; -import HLogo from '@assets/images/hiddify-logo.png' +import HLogo from '@assets/images/hiddify-logo-noroz.png' import { getWindowData } from "../../../utils/getWindowData"; import { useState } from "react"; diff --git a/src/pages/home/components/Header.tsx b/src/pages/home/components/Header.tsx index 47c6649..58871d2 100644 --- a/src/pages/home/components/Header.tsx +++ b/src/pages/home/components/Header.tsx @@ -3,7 +3,7 @@ import ShareIcon from '@mui/icons-material/Share'; import MenuDropdown from "./MenuDropdown"; import { Dispatch, FC, SetStateAction, useState } from "react"; import { Button, CardMedia, Tooltip } from "@mui/material"; -import HLogo from '@assets/images/hiddify-logo.png' +import HLogo from '@assets/images/hiddify-logo-noroz.png' import { Modal } from "../../../designSystem/Modal"; import ShareLinks from "./ShareLinks"; import DohContent from "./DohContent"; diff --git a/src/pages/home/components/PreLoading.tsx b/src/pages/home/components/PreLoading.tsx index 1ee99c9..fc66cf5 100644 --- a/src/pages/home/components/PreLoading.tsx +++ b/src/pages/home/components/PreLoading.tsx @@ -1,5 +1,5 @@ import { Text } from '../../../designSystem/Text' -import HLogoSvg from '@assets/svg/hiddify-logo.svg?react'; +import HLogoSvg from '@assets/images/hiddify-logo-noroz.png'; @@ -9,7 +9,7 @@ const PreLoading = () => {
- +
Hiddify Powered By Hiddify.com diff --git a/src/pages/home/components/RemainingTime.tsx b/src/pages/home/components/RemainingTime.tsx index 5e88dd0..78a0371 100644 --- a/src/pages/home/components/RemainingTime.tsx +++ b/src/pages/home/components/RemainingTime.tsx @@ -4,50 +4,19 @@ import AccessAlarmIcon from '@mui/icons-material/AccessAlarm'; import AllInclusiveIcon from '@mui/icons-material/AllInclusive'; import { ClickAwayListener, Tooltip } from '@mui/material'; import { useEffect, useState } from 'react'; +import moment from 'moment'; const RemainingTime = ({ remainingDays, resetIn }) => { const [showFullTime, setShowFullTime] = useState(false) - const [dateRepresentation, setDateRepresentation] = useState('-') const { t } = useTranslation(); - - const calculateRemainingTime = (days) => { - const years = Math.floor(days / 365); - const months = Math.floor((days % 365) / 30); - const daysLeft = days % 365 === 0 || days % 30 === 0 ? 0 : days % 30; - - return { years, months, days: daysLeft }; - }; - - const [timeRemaining, setTimeRemaining] = useState(calculateRemainingTime(remainingDays)); - useEffect(() => { - const remaining = calculateRemainingTime(remainingDays) - - setTimeRemaining(remaining) - - if (remaining.years > 0) { - setDateRepresentation(remaining.years + (remaining.years === 1 ? " " + t('Year') : " " + t('Years'))) - } else if (remaining.months > 0) { - setDateRepresentation(remaining.months + (remaining.months === 1 ? " " + t('Month') : " " + t('Months'))) - } else if (remaining.days > 0) { - setDateRepresentation(remaining.days + (remaining.days === 1 ? " " + t('Day') : " " + t('Days'))) - } - }, [remainingDays]); const tooltipContent = ( -
+ {t('Remaining time') + ': '} - {timeRemaining.years > 0 && ( - {timeRemaining.years} {timeRemaining.years === 1 ? t('Year') + ' ' : t('Years') + ' '} - )} - {timeRemaining.months > 0 && ( - {timeRemaining.months} {timeRemaining.months === 1 ? t('Month') + ' ' : t('Months') + ' '} - )} - {timeRemaining.days > 0 && ( - {timeRemaining.days} {timeRemaining.days === 1 ? t('Day') + ' ' : t('Days') + ' '} - )} -
+ {remainingDays ? remainingDays + ' ' + t('Days') : '-'} + ); return ( @@ -62,7 +31,7 @@ const RemainingTime = ({ remainingDays, resetIn }) => { {t('Remaining time')} - {remainingDays > 1000 ? : dateRepresentation ? dateRepresentation : '-'} + {remainingDays > 1000 ? : remainingDays ? remainingDays + ' ' + t('Days') : '-'}
diff --git a/src/pages/home/components/UsedTraffic.tsx b/src/pages/home/components/UsedTraffic.tsx index 5d781f2..cc53d51 100644 --- a/src/pages/home/components/UsedTraffic.tsx +++ b/src/pages/home/components/UsedTraffic.tsx @@ -20,7 +20,7 @@ const UsedTraffic = ({ current, total }) => { return ( setShowFullTraffic(false)}> - +
setShowFullTraffic(!showFullTraffic)} className="flex flex-col lg:flex-row items-center justify-center gap-2">