@@ -11,11 +11,11 @@ import OutcomeSearchAutocomplete from './OutcomeSearchAutocomplete'
1111import AdvancedTrialSearch from './AdvancedTrialSearch'
1212import { Robot } from '@phosphor-icons/react'
1313import { FeatureBox } from './FeatureBox'
14- import ProblemSection from './ProblemSection'
1514import SolutionSection from './SolutionSection'
16- import GoodNewsSection from './GoodNewsSection'
1715import CitizenScienceSection from './CitizenScienceSection'
1816import { useRouter } from 'next/navigation'
17+ import { useState } from 'react'
18+ import { getSafeUrlWithToken } from '../dfdaActions'
1919
2020const SquigglyPattern = ( ) => (
2121 < svg className = "absolute inset-0 h-full w-full" xmlns = "http://www.w3.org/2000/svg" >
@@ -28,41 +28,46 @@ const SquigglyPattern = () => (
2828
2929export default function HomePage ( ) {
3030 const router = useRouter ( )
31+ const [ isLoading , setIsLoading ] = useState ( false )
32+
33+ const handleDigitalTwinSafeClick = async ( path : string ) => {
34+ //setIsLoading(true)
35+ const url = await getSafeUrlWithToken ( '' )
36+ window . open ( url , '_blank' )
37+ }
3138
3239 const features = [
3340 {
34- title : "Right to Trial Act" ,
35- desc : "Help us create this groundbreaking legislation " ,
41+ title : "The Cure Acceleration Act" ,
42+ desc : "Help us give people suffering access to the most promising treatments " ,
3643 color : "bg-blue-400" ,
3744 icon : Scroll ,
38- media : "https://example.com/right-to-trial .jpg" ,
39- onClick : ( ) => {
45+ media : "https://wiki.dfda.earth/right_to_trial_act_image .jpg" ,
46+ onClick : async ( ) => {
4047 console . log ( "Right to Trial Act clicked" )
48+ setIsLoading ( true )
4149 router . push ( "/dfda/right-to-trial-act" )
4250 }
4351 } ,
4452 {
45- title : "FDAi Agent" ,
53+ title : "Your Personal FDAi Agent" ,
4654 desc : "Help us give everyone a free superintelligent doctor" ,
4755 color : "bg-green-400" ,
4856 icon : Robot ,
4957 media : "https://player.vimeo.com/video/930843979?badge=0&autopause=0&player_id=0&app_id=58479" ,
5058 onClick : ( ) => {
5159 console . log ( "FDAi Agent clicked" )
5260 // Add specific behavior here, e.g., open a modal with AI tool demo
61+ window . open ( "https://fdai.earth" , "_blank" )
5362 }
5463 } ,
5564 {
56- title : "Digital Twin Safe" ,
65+ title : "Your Digital Twin Safe" ,
5766 desc : "Securely store and control your health data" ,
5867 color : "bg-purple-400" ,
5968 icon : Pill ,
6069 media : "https://user-images.githubusercontent.com/2808553/180306571-ac9cc741-6f34-4059-a814-6f8a72ed8322.png" ,
61- onClick : ( ) => {
62- console . log ( "Digital Twin Safe clicked" )
63- // get a dfda access token and append it to safe.dfda.earth and open it in a new tab
64- window . open ( "https://safe/dfda.earth" , "_blank" )
65- }
70+ onClick : handleDigitalTwinSafeClick
6671 } ,
6772 {
6873 title : "Clinipedia" ,
@@ -93,6 +98,7 @@ export default function HomePage() {
9398 desc : "Learn about the historical context and need for decentralization" ,
9499 color : "bg-yellow-400" ,
95100 icon : Info ,
101+ media : "https://thinkbynumbers.org/wp-content/uploads/2021/03/news-story-headline-1-1024x563.png" ,
96102 href : "/dfda/why" ,
97103 onClick : ( ) => {
98104 // open https://dfda.earth in a new tab
@@ -133,6 +139,11 @@ export default function HomePage() {
133139
134140 return (
135141 < div className = "" >
142+ { isLoading && (
143+ < div className = "fixed inset-0 bg-black/50 z-50 flex items-center justify-center" >
144+ < div className = "animate-spin rounded-full h-16 w-16 border-t-4 border-white" > </ div >
145+ </ div >
146+ ) }
136147 < SquigglyPattern />
137148 < header className = "relative mb-12 overflow-hidden rounded-xl border-4 border-black bg-white p-6 text-center shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]" >
138149 < motion . h1
0 commit comments