File tree Expand file tree Collapse file tree 5 files changed +48
-9
lines changed Expand file tree Collapse file tree 5 files changed +48
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,45 @@ export const viewportModes = {
19
19
} ,
20
20
}
21
21
22
+ export const langModes = {
23
+ en : {
24
+ locale : "en" ,
25
+ } ,
26
+ zh : {
27
+ locale : "zh" ,
28
+ } ,
29
+ ru : {
30
+ locale : "ru" ,
31
+ } ,
32
+ uk : {
33
+ locale : "uk" ,
34
+ } ,
35
+ }
36
+
37
+ type LangViewModeObj = {
38
+ [ key : string ] : { viewport : string ; locale : string }
39
+ }
40
+
41
+ export const langViewportModes = Object . entries (
42
+ viewportModes
43
+ ) . reduce < LangViewModeObj > ( ( arr , curr ) => {
44
+ const [ viewKey , viewVal ] = curr
45
+
46
+ const currLangViewObj = { } as LangViewModeObj
47
+
48
+ Object . entries ( langModes ) . forEach ( ( [ langKey , langVal ] ) => {
49
+ currLangViewObj [ `${ langKey } -${ viewKey } ` ] = {
50
+ viewport : viewVal . viewport ,
51
+ locale : langVal . locale ,
52
+ }
53
+ } )
54
+
55
+ return {
56
+ ...arr ,
57
+ ...currLangViewObj ,
58
+ }
59
+ } , { } )
60
+
22
61
export const allModes = {
23
- ...viewportModes ,
62
+ ...langViewportModes ,
24
63
}
Original file line number Diff line number Diff line change 1
1
import { useTranslation } from "next-i18next"
2
2
import { Meta , StoryObj } from "@storybook/react"
3
3
4
- import { viewportModes } from "../../../../.storybook/modes"
4
+ import { langViewportModes } from "../../../../.storybook/modes"
5
5
import contentHeroImg from "../../../../public/mainnet.png"
6
6
7
7
import ContentHeroComponent , { ContentHeroProps } from "."
@@ -15,7 +15,7 @@ const meta = {
15
15
layout : "none" ,
16
16
chromatic : {
17
17
modes : {
18
- ...viewportModes ,
18
+ ...langViewportModes ,
19
19
} ,
20
20
} ,
21
21
} ,
Original file line number Diff line number Diff line change 1
1
import * as React from "react"
2
2
import { Meta , StoryObj } from "@storybook/react"
3
3
4
- import { viewportModes } from "../../../../.storybook/modes"
4
+ import { langViewportModes } from "../../../../.storybook/modes"
5
5
import homeHeroImg from "../../../../public/home/hero.png"
6
6
7
7
import HomeHeroComponent from "."
@@ -15,7 +15,7 @@ const meta = {
15
15
layout : "none" ,
16
16
chromatic : {
17
17
modes : {
18
- ...viewportModes ,
18
+ ...langViewportModes ,
19
19
} ,
20
20
} ,
21
21
} ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useTranslation } from "next-i18next"
3
3
import { Box } from "@chakra-ui/react"
4
4
import { Meta , StoryObj } from "@storybook/react"
5
5
6
- import { viewportModes } from "../../../../.storybook/modes"
6
+ import { langViewportModes } from "../../../../.storybook/modes"
7
7
8
8
import HubHeroComponent from "./"
9
9
@@ -16,7 +16,7 @@ const meta = {
16
16
layout : "none" ,
17
17
chromatic : {
18
18
modes : {
19
- ...viewportModes ,
19
+ ...langViewportModes ,
20
20
} ,
21
21
} ,
22
22
} ,
Original file line number Diff line number Diff line change 1
1
import { HStack } from "@chakra-ui/react"
2
2
import { Meta , StoryObj } from "@storybook/react"
3
3
4
- import { viewportModes } from "../../../../.storybook/modes"
4
+ import { langViewportModes } from "../../../../.storybook/modes"
5
5
6
6
import MdxHeroComponent from "./"
7
7
@@ -13,7 +13,7 @@ const meta = {
13
13
layout : "none" ,
14
14
chromatic : {
15
15
modes : {
16
- ...viewportModes ,
16
+ ...langViewportModes ,
17
17
} ,
18
18
} ,
19
19
} ,
You can’t perform that action at this time.
0 commit comments