1
1
"use client" ;
2
2
3
- import React , { FC , useState } from "react" ;
3
+ import React , { FC } from "react" ;
4
4
import { BrandDictionaryModel } from "@/features/localization/models/brand-dictionary.model" ;
5
5
import styles from "./context-menu.module.scss" ;
6
6
import jwtLogoString from "@/public/img/jwt-logo.svg?raw" ;
7
7
import jwtSymbolString from "@/public/img/jwt-symbol.svg?raw" ;
8
- import jwtWordmark from "@/public/img/jwt-wordmark.svg?raw" ;
8
+ import jwtWordmarkString from "@/public/img/jwt-wordmark.svg?raw" ;
9
+ import { Button } from "react-aria-components" ;
9
10
10
11
interface ContextMenuProps {
11
12
dictionary : BrandDictionaryModel ;
12
13
position : { x : number ; y : number } | null ;
13
14
setIsCopied : ( value : React . SetStateAction < boolean > ) => void ;
14
15
}
15
16
16
- const ContextMenu : FC < ContextMenuProps > = ( { dictionary, position, setIsCopied } ) => {
17
+ const ContextMenu : FC < ContextMenuProps > = ( {
18
+ dictionary,
19
+ position,
20
+ setIsCopied,
21
+ } ) => {
17
22
if ( ! position ) return null ;
18
23
19
24
const handleIconCopy = async ( svgString : string ) => {
@@ -35,29 +40,53 @@ const ContextMenu: FC<ContextMenuProps> = ({ dictionary, position, setIsCopied }
35
40
style = { { top : position . y , left : position . x } }
36
41
>
37
42
< div className = { styles . groupLabel } > { dictionary . menu . brand . label } </ div >
38
- < ul className = { styles . list } >
39
- < li
43
+ < div className = { styles . list } >
44
+ < Button
40
45
className = { styles . menuItem }
41
- onClick = { ( ) => handleIconCopy ( jwtLogoString ) }
46
+ onPress = { ( ) => handleIconCopy ( jwtLogoString ) }
42
47
>
43
48
< div > icon</ div >
44
49
< span > { dictionary . menu . brand . svg . copyLabel } </ span >
45
- </ li >
46
- < li
50
+ </ Button >
51
+ < a
47
52
className = { styles . menuItem }
48
- onClick = { ( ) => handleIconCopy ( jwtSymbolString ) }
53
+ href = "/img/jwt-logo.svg"
54
+ download = "jwt-logo.svg"
55
+ >
56
+ < div > icon</ div >
57
+ { dictionary . menu . brand . svg . downloadLabel }
58
+ </ a >
59
+ < Button
60
+ className = { styles . menuItem }
61
+ onPress = { ( ) => handleIconCopy ( jwtSymbolString ) }
49
62
>
50
63
< div > icon</ div >
51
64
< span > { dictionary . menu . brand . symbol . copyLabel } </ span >
52
- </ li >
53
- < li
65
+ </ Button >
66
+ < a
54
67
className = { styles . menuItem }
55
- onClick = { ( ) => handleIconCopy ( jwtWordmark ) }
68
+ href = "/img/jwt-symbol.svg"
69
+ download = "jwt-symbol.svg"
70
+ >
71
+ < div > icon</ div >
72
+ { dictionary . menu . brand . symbol . downloadLabel }
73
+ </ a >
74
+ < Button
75
+ className = { styles . menuItem }
76
+ onPress = { ( ) => handleIconCopy ( jwtWordmarkString ) }
56
77
>
57
78
< div > icon</ div >
58
79
< span > { dictionary . menu . brand . wordmark . copyLabel } </ span >
59
- </ li >
60
- </ ul >
80
+ </ Button >
81
+ < a
82
+ className = { styles . menuItem }
83
+ href = "/img/jwt-wordmark.svg"
84
+ download = "jwt-wordmark.svg"
85
+ >
86
+ < div > icon</ div >
87
+ { dictionary . menu . brand . wordmark . downloadLabel }
88
+ </ a >
89
+ </ div >
61
90
</ div >
62
91
) ;
63
92
} ;
0 commit comments