11import { HStack , Image , Spacer , Text , VStack } from '@expo/ui/swift-ui' ;
2- import { font , foregroundStyle , frame } from '@expo/ui/swift-ui/modifiers' ;
2+ import { font , foregroundStyle , frame , widgetURL } from '@expo/ui/swift-ui/modifiers' ;
33import { createWidget } from 'expo-widgets' ;
44import type { NextClassWidgetProps , WidgetClass } from '../types' ;
55
@@ -8,6 +8,9 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
88 const isSmall = env ?. widgetFamily === 'systemSmall' ;
99 const blue = env ?. colorScheme === 'dark' ? 'rgb(155, 203, 255)' : 'rgb(0, 98, 159)' ;
1010
11+ // toucher le widget ouvre l'EDT (lien profond unicenotes://edt, voir utils/deeplink.ts)
12+ const openEdt = [ widgetURL ( 'unicenotes://edt' ) ] ;
13+
1114 const EMPTY : WidgetClass = {
1215 title : 'Aucun cours' ,
1316 room : 'Profites-en !' ,
@@ -32,7 +35,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
3235 if ( props ?. configured === false ) {
3336 if ( isSmall ) {
3437 return (
35- < VStack alignment = "leading" spacing = { 4 } >
38+ < VStack alignment = "leading" spacing = { 4 } modifiers = { openEdt } >
3639 { LogoHeader }
3740 < Spacer />
3841 < Text modifiers = { [ font ( { size : 11 } ) , foregroundStyle ( 'secondary' ) ] } >
@@ -42,7 +45,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
4245 ) ;
4346 }
4447 return (
45- < VStack alignment = "leading" spacing = { 10 } >
48+ < VStack alignment = "leading" spacing = { 10 } modifiers = { openEdt } >
4649 < HStack alignment = "center" >
4750 { LogoHeader }
4851 < Spacer />
@@ -59,7 +62,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
5962 if ( props ?. configured === undefined ) {
6063 if ( isSmall ) {
6164 return (
62- < VStack alignment = "leading" spacing = { 4 } >
65+ < VStack alignment = "leading" spacing = { 4 } modifiers = { openEdt } >
6366 { LogoHeader }
6467 < Spacer />
6568 < Text modifiers = { [ font ( { size : 11 } ) , foregroundStyle ( 'secondary' ) ] } >
@@ -69,7 +72,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
6972 ) ;
7073 }
7174 return (
72- < VStack alignment = "leading" spacing = { 10 } >
75+ < VStack alignment = "leading" spacing = { 10 } modifiers = { openEdt } >
7376 < HStack alignment = "center" >
7477 { LogoHeader }
7578 < Spacer />
@@ -88,7 +91,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
8891
8992 if ( isSmall ) {
9093 return (
91- < VStack alignment = "leading" spacing = { 4 } >
94+ < VStack alignment = "leading" spacing = { 4 } modifiers = { openEdt } >
9295 { LogoHeader }
9396 < Spacer />
9497 { c1 . startTime ? (
@@ -106,7 +109,7 @@ const NextClassWidget = (props: NextClassWidgetProps, env: any) => {
106109
107110 // systemMedium / systemLarge
108111 return (
109- < VStack alignment = "leading" spacing = { 10 } >
112+ < VStack alignment = "leading" spacing = { 10 } modifiers = { openEdt } >
110113 < HStack alignment = "center" >
111114 { LogoHeader }
112115 < Spacer />
0 commit comments