@@ -16,139 +16,53 @@ import iconWithLabelImg from "./jwt-label.icon.png";
1616import { createUrlPath } from "@/libs/utils/path.utils" ;
1717import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config" ;
1818import { Button } from "react-aria-components" ;
19-
20- interface DownloadButtonProps {
21- asset : StaticImageData ;
22- filename : string ;
23- }
24-
25- const DownloadButton : React . FC < DownloadButtonProps > = ( { asset, filename } ) => {
26- const downloadSVG = useCallback (
27- ( image : StaticImageData , filename : string ) => {
28- const link = document . createElement ( "a" ) ;
29- link . href = image . src ;
30- link . download = filename ;
31- document . body . appendChild ( link ) ;
32- link . click ( ) ;
33- document . body . removeChild ( link ) ;
34- } ,
35- [ ] ,
36- ) ;
37-
38- return (
39- < Button
40- className = { styles . downloadButton }
41- onPress = { ( ) => {
42- setTimeout ( ( ) => {
43- downloadSVG ( asset , filename ) ;
44- } , 0 ) ;
45- } }
46- >
47- < DownloadIconComponent />
48- </ Button >
49- ) ;
50- } ;
19+ import { ArrowHeadIconComponent } from "@/features/common/assets/arrow-head-icon.component" ;
20+ import { Auth0DictionaryModel } from "@/features/localization/models/auth0-dictionary.model" ;
21+ import { Auth0CtaComponent } from "@/features/common/components/auth0-cta/auth0-cta.component" ;
5122
5223type AssetsComponentProps = {
5324 languageCode : string ;
54- dictionary : JwtDictionaryModel ;
25+ jwtDictionary : JwtDictionaryModel ;
26+ auth0Dictionary : Auth0DictionaryModel ;
5527} ;
5628
5729export const AssetsComponent : React . FC < AssetsComponentProps > = ( {
5830 languageCode,
59- dictionary,
31+ jwtDictionary,
32+ auth0Dictionary,
6033} ) => {
6134 const libraryLinkPath = createUrlPath ( [
6235 languageCode === DEFAULT_LANGUAGE_CODE ? "" : languageCode ,
63- dictionary . libraries . ctaButton . path
64- ? dictionary . libraries . ctaButton . path
36+ jwtDictionary . libraries . ctaButton . path
37+ ? jwtDictionary . libraries . ctaButton . path
6538 : "" ,
6639 ] ) ;
6740
6841 return (
69- < BoxComponent
70- containerClassName = { styles . container }
71- contentClassName = { styles . content }
72- >
42+ < div className = { styles . content } >
7343 < div className = { clsx ( styles . assets__column ) } >
7444 < h4
7545 className = { clsx (
7646 styles . assets__title ,
77- getLocalizedSecondaryFont ( languageCode ) ,
47+ getLocalizedSecondaryFont ( languageCode )
7848 ) }
7949 >
80- { dictionary . libraries . title }
50+ { jwtDictionary . libraries . title }
8151 </ h4 >
8252 < div className = { styles . assets__content } >
8353 < p className = { styles . assets__description } >
84- { dictionary . libraries . description }
54+ { jwtDictionary . libraries . description }
8555 </ p >
8656 < Link className = { styles . asset__link } href = { libraryLinkPath } >
87- { dictionary . libraries . ctaButton . label }
57+ { jwtDictionary . libraries . ctaButton . label }
58+ < ArrowHeadIconComponent />
8859 </ Link >
8960 </ div >
9061 </ div >
91- < div className = { clsx ( styles . assets__column ) } >
92- < h4
93- className = { clsx (
94- styles . assets__title ,
95- getLocalizedSecondaryFont ( languageCode ) ,
96- ) }
97- >
98- { dictionary . assets . badges . title }
99- </ h4 >
100- < div className = { styles . assets__content } >
101- < div className = { styles . card } >
102- < Image
103- { ...dictionary . assets . badges . images . viewOn }
104- alt = { dictionary . assets . badges . images . viewOn . alt }
105- />
106- < DownloadButton
107- filename = { "view-on-jwt.badge.png" }
108- asset = { viewOnImg }
109- />
110- </ div >
111- < div className = { styles . card } >
112- < Image
113- { ...dictionary . assets . badges . images . compatible }
114- alt = { dictionary . assets . badges . images . compatible . alt }
115- />
116- < DownloadButton
117- filename = { "jwt-compatible.badge.png" }
118- asset = { compatibleImg }
119- />
120- </ div >
121- </ div >
122- </ div >
123- < div className = { clsx ( styles . assets__column ) } >
124- < h4
125- className = { clsx (
126- styles . assets__title ,
127- getLocalizedSecondaryFont ( languageCode ) ,
128- ) }
129- >
130- { dictionary . assets . logotype . title }
131- </ h4 >
132- < div className = { styles . assets__content } >
133- < div className = { styles . card } >
134- < Image
135- { ...dictionary . assets . logotype . images . icon }
136- alt = { dictionary . assets . logotype . images . icon . alt }
137- />
138- < DownloadButton filename = { "jwt.icon.png" } asset = { iconImg } />
139- </ div >
140- < div className = { styles . card } >
141- < Image
142- { ...dictionary . assets . logotype . images . iconWithLabel }
143- alt = { dictionary . assets . logotype . images . iconWithLabel . alt }
144- />
145- < DownloadButton
146- filename = { "jwt-label.icon.png" }
147- asset = { iconWithLabelImg }
148- />
149- </ div >
150- </ div >
151- </ div >
152- </ BoxComponent >
62+ < Auth0CtaComponent
63+ languageCode = { languageCode }
64+ dictionary = { auth0Dictionary . banner }
65+ />
66+ </ div >
15367 ) ;
15468} ;
0 commit comments