@@ -14,12 +14,14 @@ import { validateTwitterData, extractTargetFiles } from '../../_components/Uploa
1414import Image from 'next/image' ;
1515import seaBackground from '../../../public/sea.svg'
1616import { plex } from '../../fonts/plex' ;
17- import logoHQX from '../../../../public/logoxHQX/HQX-rose-FR.svg'
1817import { motion } from 'framer-motion' ;
18+ import { AlertCircle } from 'lucide-react' ;
1919import boat1 from '../../../public/boats/boat-1.svg'
2020import Footer from "@/app/_components/Footer" ;
2121import LoadingIndicator from '@/app/_components/LoadingIndicator' ;
22-
22+ import SupportModal from '../../_components/SupportModale' ;
23+ import logoHQXFR from '../../../../public/logoxHQX/HQX-rose-FR.svg' ;
24+ import logoHQXEN from '../../../../public/logoxHQX/HQX-pink-UK.svg' ;
2325
2426const UploadButton = dynamic ( ( ) => import ( '../../_components/UploadButton' ) , {
2527 loading : ( ) => < div className = "animate-pulse bg-gray-200 h-12 w-48 rounded-lg" > </ div > ,
@@ -43,7 +45,11 @@ export default function UploadPage() {
4345 const [ isUploading , setIsUploading ] = useState ( false ) ;
4446 const [ isLoading , setIsLoading ] = useState ( true ) ;
4547 const [ showHelpModal , setShowHelpModal ] = useState ( false ) ;
48+ const [ showSupportModal , setShowSupportModal ] = useState ( false ) ;
4649 const t = useTranslations ( 'upload' ) ;
50+ const tSupport = useTranslations ( 'support' ) ;
51+ const locale = params . locale as string ;
52+ const logoHQX = locale === 'fr' ? logoHQXFR : logoHQXEN ;
4753
4854 useEffect ( ( ) => {
4955 if ( status === "unauthenticated" ) {
@@ -141,11 +147,22 @@ export default function UploadPage() {
141147 } ;
142148
143149 const validateFileType = ( file : File ) : boolean => {
144-
145150 console . log ( "File Type =" , file . type )
146- const validTypes = [ 'application/javascript' , 'text/javascript' , 'application/zip' , 'application/x-javascript' ] ;
151+ const validTypes = [
152+ 'application/javascript' ,
153+ 'text/javascript' ,
154+ 'application/zip' ,
155+ 'application/x-javascript' ,
156+ 'text/ecmascript' ,
157+ 'application/ecmascript' ,
158+ 'application/x-ecmascript' ,
159+ 'text/x-javascript' ,
160+ 'text/jsx' ,
161+ 'text/plain' ,
162+ 'module'
163+ ] ;
147164 return validTypes . includes ( file . type ) ;
148- } ;
165+ } ;
149166
150167 const sanitizeContent = ( content : Uint8Array ) : Uint8Array => {
151168 const text = new TextDecoder ( ) . decode ( content ) ;
@@ -404,8 +421,7 @@ export default function UploadPage() {
404421 }
405422
406423 return (
407- < div className = "min-h-screen bg-[#2a39a9] relative w-full max-w-[90rem] m-auto" >
408- < Header />
424+ < div className = "min-h-screen bg-[#2a39a9] relative w-full max-w-[90rem] m-auto" > < Header />
409425 < div className = "relative z-10 pt-12" >
410426 < Image
411427 src = { logoHQX }
@@ -416,6 +432,7 @@ export default function UploadPage() {
416432 priority
417433 />
418434 </ div >
435+
419436 < div className = "flex justify-center items-center min-h-[60vh]" >
420437 < motion . div
421438 initial = { { opacity : 0 , y : 20 } }
@@ -443,20 +460,54 @@ export default function UploadPage() {
443460 </ p >
444461
445462 { ! isUploading && (
446- < div className = "mt-8 " >
463+ < div className = "space-y-4 " >
447464 < UploadButton onFilesSelected = { handleFilesSelected } onError = { handleUploadError } />
465+ < motion . button
466+ whileHover = { { scale : 1.05 } }
467+ whileTap = { { scale : 0.95 } }
468+ onClick = { ( ) => setShowSupportModal ( true ) }
469+ className = "w-full flex items-center justify-center gap-2 py-3 px-6 bg-white/10 hover:bg-white/20 backdrop-blur-lg rounded-xl text-white"
470+ >
471+ < AlertCircle className = "w-5 h-5" />
472+ < span > { tSupport ( 'modal.title' ) } </ span >
473+ </ motion . button >
448474 </ div >
449475 ) }
450476
451477 { isUploading && (
452478 < div className = "flex items-center justify-center space-x-2" >
453479 < div className = "animate-spin rounded-full h-5 w-5 border-t-2 border-b-2 border-white" > </ div >
454- < span > { t ( 'loading ' ) } </ span >
480+ < p className = "text-white" > { t ( 'uploading ' ) } </ p >
455481 </ div >
456482 ) }
457483 </ div >
458484 </ div >
485+
459486 </ motion . div >
487+
488+ { /* Modal de Support */ }
489+ < SupportModal
490+ isOpen = { showSupportModal }
491+ onClose = { ( ) => setShowSupportModal ( false ) }
492+ />
493+
494+ { /* </motion.div> */ }
495+
496+ { /* <motion.button
497+ whileHover={{ scale: 1.05 }}
498+ whileTap={{ scale: 0.95 }}
499+ onClick={() => setShowSupportModal(true)}
500+ className="fixed bottom-4 right-4 bg-white/10 hover:bg-white/20 backdrop-blur-lg rounded-full p-3 text-white shadow-lg flex items-center gap-2"
501+ >
502+ <AlertCircle className="w-5 h-5" />
503+ <span>{tSupport('button')}</span>
504+ </motion.button> */ }
505+
506+ { /* Modal de Support */ }
507+ < SupportModal
508+ isOpen = { showSupportModal }
509+ onClose = { ( ) => setShowSupportModal ( false ) }
510+ />
460511 </ div >
461512
462513 { /* Modals */ }
0 commit comments