@@ -3,7 +3,7 @@ import { useRouter } from "next/router"
3
3
import { useTranslation } from "next-i18next"
4
4
import { FaDiscord , FaGithub , FaXTwitter } from "react-icons/fa6"
5
5
6
- import type { EventCardProps , Lang } from "@/lib/types"
6
+ import type { EventCardProps } from "@/lib/types"
7
7
import type { CodeExample } from "@/lib/interfaces"
8
8
9
9
import { useBentoBox } from "@/components/Homepage/useBentoBox"
@@ -16,8 +16,8 @@ import TryAppsIcon from "@/components/icons/phone-homescreen.svg"
16
16
import RoadmapSign from "@/components/icons/roadmap-sign.svg"
17
17
import Whitepaper from "@/components/icons/whitepaper.svg"
18
18
19
+ import { cn } from "@/lib/utils/cn"
19
20
import { isValidDate } from "@/lib/utils/date"
20
- import { isLangRightToLeft } from "@/lib/utils/translations"
21
21
22
22
import events from "@/data/community-events.json"
23
23
import CreateWalletContent from "@/data/CreateWallet"
@@ -27,6 +27,7 @@ import { GITHUB_REPO_URL } from "@/lib/constants"
27
27
import SimpleDomainRegistryContent from "!!raw-loader!@/data/SimpleDomainRegistry.sol"
28
28
import SimpleTokenContent from "!!raw-loader!@/data/SimpleToken.sol"
29
29
import SimpleWalletContent from "!!raw-loader!@/data/SimpleWallet.sol"
30
+ import { useRtlFlip } from "@/hooks/useRtlFlip"
30
31
31
32
export const useHome = ( ) => {
32
33
const { t } = useTranslation ( [ "common" , "page-index" ] )
@@ -37,7 +38,7 @@ export const useHome = () => {
37
38
38
39
const bentoItems = useBentoBox ( )
39
40
40
- const dir = isLangRightToLeft ( locale as Lang ) ? "rtl" : "ltr"
41
+ const { direction , isRtl } = useRtlFlip ( )
41
42
42
43
const toggleCodeExample = ( id : number ) : void => {
43
44
setActiveCode ( id )
@@ -106,7 +107,10 @@ export const useHome = () => {
106
107
description : t ( "page-index:page-index-cta-dapps-description" ) ,
107
108
href : "/dapps/" ,
108
109
Svg : TryAppsIcon ,
109
- className : "text-accent-c hover:text-accent-c-hover" ,
110
+ className : cn (
111
+ "text-accent-c hover:text-accent-c-hover" ,
112
+ isRtl && "[&_svg]:-scale-x-100"
113
+ ) ,
110
114
} ,
111
115
]
112
116
@@ -129,11 +133,13 @@ export const useHome = () => {
129
133
{
130
134
label : t ( "page-index:page-index-popular-topics-whitepaper" ) ,
131
135
Svg : Whitepaper ,
136
+ className : cn ( isRtl && "[&_svg]:-scale-x-100" ) ,
132
137
href : "/whitepaper/" ,
133
138
} ,
134
139
{
135
140
label : t ( "page-index:page-index-popular-topics-roadmap" ) ,
136
141
Svg : RoadmapSign ,
142
+ className : cn ( isRtl && "[&_svg]:-scale-x-100" ) ,
137
143
href : "/roadmap/" ,
138
144
} ,
139
145
]
@@ -188,7 +194,7 @@ export const useHome = () => {
188
194
t,
189
195
locale,
190
196
asPath,
191
- dir,
197
+ dir : direction ,
192
198
isModalOpen,
193
199
setModalOpen,
194
200
activeCode,
0 commit comments