Skip to content

Commit fffe237

Browse files
committed
feat: add url opener on widgets
1 parent 0bd6146 commit fffe237

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/constants/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export const PRONOTE_URL = 'https://sco.polytech.unice.fr/1/mobile.etudiant';
1010

1111
export const RELEASE_NOTES = {
1212
"info": "Tu as mis à jour l\'application ! 🎉",
13-
"subtitle": "Nouveautés :\n- Correction de bugs\n\nMerci d'utiliser UniceNotes !"
13+
"subtitle": "Nouveautés :\n- Trouve une salle libre !\n- Améliorations de rendu\n- Correction de bugs\n\nMerci d'utiliser UniceNotes !"
1414
}

src/widgets/NextClassWidget.ios.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { 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';
33
import { createWidget } from 'expo-widgets';
44
import 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

Comments
 (0)