-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitialSetup.patch
1713 lines (1710 loc) · 83.5 KB
/
initialSetup.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Index: pages/api/redirect.ts
===================================================================
diff --git a/pages/api/redirect.ts b/pages/api/redirect.ts
deleted file mode 100644
--- a/pages/api/redirect.ts (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ /dev/null (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
@@ -1,20 +0,0 @@
-import initMiro from '../../initMiro';
-import {NextApiRequest, NextApiResponse} from 'next';
-
-// handle redirect with code and exchange it for the access token
-export default async function handler(
- req: NextApiRequest,
- res: NextApiResponse,
-) {
- const {miro} = initMiro(req, res);
-
- // Make sure the code is in query parameters
- if (typeof req.query.code !== 'string') {
- res.status(400);
- res.send('Missing code in the query');
- return;
- }
-
- await miro.exchangeCodeForAccessToken('', req.query.code);
- res.redirect('/');
-}
Index: pages/_app.tsx
===================================================================
diff --git a/pages/_app.tsx b/pages/_app.tsx
deleted file mode 100644
--- a/pages/_app.tsx (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ /dev/null (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
@@ -1,8 +0,0 @@
-import '../src/assets/style.css';
-import type {AppProps} from 'next/app';
-
-const MyApp = ({Component, pageProps}: AppProps) => {
- return <Component {...pageProps} />;
-};
-
-export default MyApp;
Index: pages/_document.tsx
===================================================================
diff --git a/pages/_document.tsx b/pages/_document.tsx
deleted file mode 100644
--- a/pages/_document.tsx (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ /dev/null (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
@@ -1,21 +0,0 @@
-import {Html, Head, Main, NextScript} from 'next/document';
-
-export default function Document() {
- return (
- <Html>
- <Head>
- <link
- rel="stylesheet"
- href="https://unpkg.com/mirotone/dist/styles.css"
- ></link>
- <script src="https://miro.com/app/static/sdk/v2/miro.js" />
- </Head>
- <body>
- <div id="root">
- <Main />
- </div>
- <NextScript />
- </body>
- </Html>
- );
-}
Index: pages/index.tsx
===================================================================
diff --git a/pages/index.tsx b/pages/index.tsx
deleted file mode 100644
--- a/pages/index.tsx (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ /dev/null (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
@@ -1,98 +0,0 @@
-import {GetServerSideProps} from 'next';
-import {useEffect} from 'react';
-import initMiro from '../initMiro';
-import Image from 'next/image';
-
-import congratulations from '../src/assets/congratulations.png';
-
-export const getServerSideProps: GetServerSideProps =
- async function getServerSideProps({req}) {
- const {miro} = initMiro(req);
-
- // redirect to auth url if user has not authorized the app
- if (!(await miro.isAuthorized(''))) {
- return {
- props: {
- boards: [],
- authUrl: miro.getAuthUrl(),
- },
- };
- }
-
- const api = miro.as('');
-
- const boards: string[] = [];
-
- for await (const board of api.getAllBoards()) {
- boards.push(board.name || '');
- }
-
- return {
- props: {
- boards,
- },
- };
- };
-
-export default function Main({
- boards,
- authUrl,
-}: {
- boards: string[];
- authUrl?: string;
-}) {
- useEffect(() => {
- if (new URLSearchParams(window.location.search).has('panel')) return;
-
- window.miro.board.ui.on('icon:click', async () => {
- window.miro.board.ui.openPanel({
- url: `/?panel=1`,
- });
- });
- }, []);
-
- if (authUrl) {
- return (
- <div className="grid wrapper">
- <div className="cs1 ce12">
- <a className="button button-primary" href={authUrl}>
- Login
- </a>
- </div>
- </div>
- );
- }
-
- return (
- <div className="grid wrapper">
- <div className="cs1 ce12">
- <Image src={congratulations} alt="Congratulations text" />
- </div>
- <div className="cs1 ce12">
- <h1>Congratulations!</h1>
- <p>You've just created your first Miro app!</p>
- <p>This is a list of all the boards that your user has access to:</p>
-
- <ul>
- {boards.map((board, idx) => (
- <li key={idx}>{board}</li>
- ))}
- </ul>
-
- <p>
- To explore more and build your own app, see the Miro Developer
- Platform documentation.
- </p>
- </div>
- <div className="cs1 ce12">
- <a
- className="button button-primary"
- target="_blank"
- href="https://developers.miro.com"
- >
- Read the documentation
- </a>
- </div>
- </div>
- );
-}
Index: src/assets/style.css
===================================================================
diff --git a/src/assets/style.css b/src/assets/style.css
deleted file mode 100644
--- a/src/assets/style.css (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ /dev/null (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
@@ -1,21 +0,0 @@
-@import 'mirotone/dist/styles.css';
-
-*,
-*:before,
-*:after {
- box-sizing: border-box;
-}
-
-body {
- display: flex;
-}
-
-#root {
- overflow: auto;
- padding: var(--space-medium);
-}
-
-img {
- max-width: 100%;
- height: auto;
-}
Index: tsconfig.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/tsconfig.json b/tsconfig.json
--- a/tsconfig.json (revision d93a1baab16ea2712d9d351f132a3c46b85ae8c7)
+++ b/tsconfig.json (date 1689190006003)
@@ -24,12 +24,18 @@
],
"allowJs": true,
"incremental": true,
- "isolatedModules": true
+ "isolatedModules": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
},
"include": [
"src",
"pages",
- "*.ts"
+ "*.ts",
+ ".next/types/**/*.ts"
],
"exclude": [
"node_modules"
Index: styles/globals.css
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/styles/globals.css b/styles/globals.css
new file mode 100644
--- /dev/null (date 1689189680625)
+++ b/styles/globals.css (date 1689189680625)
@@ -0,0 +1,16 @@
+.wrapper {
+ max-width: 500px;
+ margin: 0 auto;
+ padding: 20px;
+}
+
+img {
+ max-width: 60%;
+ margin: 0 auto;
+ height: auto;
+}
+
+a.button {
+ text-decoration: none;
+ line-height: 48px;
+}
Index: src/utils/fetch/boards.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/utils/fetch/boards.ts b/src/utils/fetch/boards.ts
new file mode 100644
--- /dev/null (date 1689189924193)
+++ b/src/utils/fetch/boards.ts (date 1689189924193)
@@ -0,0 +1,48 @@
+import {RequestCookies} from 'next/dist/server/web/spec-extension/cookies'
+import {ReadonlyRequestCookies} from 'next/dist/server/web/spec-extension/adapters/request-cookies'
+import {Board} from '@mirohq/miro-api'
+import initMiroApiClient from '../../initMiroApiClient'
+
+type GetDataInterface = (cookies: RequestCookies | ReadonlyRequestCookies) => Promise<Board[] | Error>
+type GetBoardDataInterface = (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string) => Promise<Board | Error>
+
+export const fetchBoards: GetDataInterface = async (cookies) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }}
+ )
+ }
+ const api = miro.as('')
+
+ const boards: Board[] = []
+
+ for await (const board of api.getAllBoards()) {
+ boards.push(board)
+ }
+
+ return boards
+}
+
+export const fetchBoard: GetBoardDataInterface = async (cookies, boardId) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }
+ }
+ )
+ }
+ return await miro.as('').getBoard(boardId)
+}
\ No newline at end of file
Index: src/initMiroApiClient.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/initMiroApiClient.ts b/src/initMiroApiClient.ts
new file mode 100644
--- /dev/null (date 1689189945041)
+++ b/src/initMiroApiClient.ts (date 1689189945041)
@@ -0,0 +1,34 @@
+import {Miro} from '@mirohq/miro-api';
+import {RequestCookies} from 'next/dist/server/web/spec-extension/cookies'
+import {ReadonlyRequestCookies} from 'next/dist/server/web/spec-extension/adapters/request-cookies'
+
+export const tokensCookie = 'miro_tokens';
+const userIdCookie = 'miro_user_id';
+
+const initMiroApiClient: (cookies: RequestCookies | ReadonlyRequestCookies) => { miro:Miro } = (
+ cookies: RequestCookies | ReadonlyRequestCookies
+) => {
+
+ // set up a Miro instance that loads tokens from cookies
+ return {
+ miro: new Miro({
+ storage: {
+ get: async () => {
+ // Load state (tokens) from a cookie if it's set
+ try {
+ return {
+ userId: '',
+ accessToken: cookies.get(tokensCookie)?.value || '',
+ }
+ } catch (err) {
+ return undefined
+ }
+ },
+ set: (_) => {},
+ },
+ }),
+ userId: cookies.get(userIdCookie) || '',
+ };
+}
+
+export default initMiroApiClient
\ No newline at end of file
Index: src/utils/fetch/items.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/utils/fetch/items.ts b/src/utils/fetch/items.ts
new file mode 100644
--- /dev/null (date 1689189924193)
+++ b/src/utils/fetch/items.ts (date 1689189924193)
@@ -0,0 +1,103 @@
+import {RequestCookies} from 'next/dist/server/web/spec-extension/cookies'
+import {ReadonlyRequestCookies} from 'next/dist/server/web/spec-extension/adapters/request-cookies'
+import initMiroApiClient from '../../initMiroApiClient'
+
+type GetItemsDataInterface = (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string) => Promise<string[] | Error>
+type GetItemDataInterface = (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string, itemId: string) => Promise<string | Error>
+
+export const fetchItems: GetItemsDataInterface = async (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }
+ }
+ )
+ }
+
+ const board = await miro.as('').getBoard(boardId)
+
+ const items = []
+
+ const resItems = await board.getAllItems()
+
+ for await (const item of resItems) {
+ items.push(JSON.stringify(item))
+ }
+
+ return items
+}
+
+export const fetchItem: GetItemDataInterface = async (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string, itemId: string) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }
+ }
+ )
+ }
+
+ const board = await miro.as('').getBoard(boardId)
+
+ const item = await board.getItem(itemId)
+
+ return JSON.stringify(item)
+}
+
+export const createItem = async (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string, content: string) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }
+ }
+ )
+ }
+
+ const board = await miro.as('').getBoard(boardId)
+
+ const item = await board.createStickyNoteItem({
+ data: {
+ content: content
+ }
+ })
+
+ return JSON.stringify(item)
+}
+
+export const deleteItem = async (cookies: RequestCookies | ReadonlyRequestCookies, boardId: string, itemId: string) => {
+ const {miro} = initMiroApiClient(cookies)
+
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ throw new Error('Authentication error', {
+ cause: {
+ redirect: {
+ destination: miro.getAuthUrl()
+ }
+ }
+ }
+ )
+ }
+
+ const board = await miro.as('').getBoard(boardId)
+
+ const item = await board.getItem(itemId)
+ await item.delete()
+}
\ No newline at end of file
Index: src/Authentication/Authentication.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Authentication/Authentication.tsx b/src/Authentication/Authentication.tsx
new file mode 100644
--- /dev/null (date 1689189680625)
+++ b/src/Authentication/Authentication.tsx (date 1689189680625)
@@ -0,0 +1,7 @@
+'use client'
+
+import React, {FunctionComponent} from 'react'
+
+export const Authentication: FunctionComponent<{destination?: string}> = ({destination}) => {
+ return destination ? <a href={destination} className='button button-primary' style={{lineHeight: '48px', textDecoration: 'none'}}>Login to Miro</a> : null
+}
\ No newline at end of file
Index: src/CookieMachine/CookieMachine.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/CookieMachine/CookieMachine.tsx b/src/CookieMachine/CookieMachine.tsx
new file mode 100644
--- /dev/null (date 1689189680626)
+++ b/src/CookieMachine/CookieMachine.tsx (date 1689189680626)
@@ -0,0 +1,13 @@
+'use client'
+
+import {useEffect} from 'react'
+import {tokensCookie} from '../initMiroApiClient'
+
+export default function({token}: {token?: string}) {
+ useEffect(() => {
+ if (!token) return
+ document.cookie = `${tokensCookie}=${token};path=/`;
+ },[])
+
+ return null
+}
\ No newline at end of file
Index: app/page.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/page.tsx b/app/page.tsx
new file mode 100644
--- /dev/null (date 1689190044893)
+++ b/app/page.tsx (date 1689190044893)
@@ -0,0 +1,53 @@
+import {cookies} from 'next/headers'
+import Image from 'next/image'
+import congratulations from '../public/congratulations.png'
+import {fetchBoards} from '../src/utils/fetch/boards'
+import Link from 'next/link'
+import React from 'react'
+import { Board } from '@mirohq/miro-api'
+
+export default async function HomePage() {
+ const nextCookies = cookies()
+
+ let boards: Board[] = []
+ try {
+ const response = await fetchBoards(nextCookies);
+ if (Array.isArray(response)) {
+ boards = response
+ }
+ } catch (e) {
+ console.log('Error while getting all boards', e)
+ }
+
+ return (
+ <div className="grid wrapper">
+ <div className="cs1 ce12">
+ <Image src={congratulations} alt="Congratulations" style={{width: '100%', height: 'auto'}} priority/>
+ </div>
+ <div className="cs1 ce12">
+ <h1>Congratulations!</h1>
+ <p>You've just created your first Nextjs 13 appDir app, and connected it to Miro!</p>
+ </div>
+ <div className="cs1 ce12">
+ <h2>List all your {boards.length} board(s) here:</h2>
+ <ul>
+ { !!boards.length && boards?.map(b => <li key={b.id}> {b.name} </li>) }
+ </ul>
+ </div>
+ <div className="cs1 ce12">
+ <p>
+ To explore more and build your own app, see the Miro Developer
+ Platform documentation.
+ </p>
+ </div>
+ <div className="cs1 ce12">
+ <h3>Resources</h3>
+ <ul>
+ <li><Link target="_blank" href="https://beta.nextjs.org/docs">NextJS 13 appDir docs</Link></li>
+ <li><Link target="_blank" href="https://developers.miro.com">Miro API docs</Link></li>
+ <li><Link target="_blank" href="https://miroapp.github.io/api-clients/index.html">miro-api client docs</Link></li>
+ </ul>
+ </div>
+ </div>
+ )
+}
\ No newline at end of file
Index: app/head.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/head.tsx b/app/head.tsx
new file mode 100644
--- /dev/null (date 1689189680624)
+++ b/app/head.tsx (date 1689189680624)
@@ -0,0 +1,18 @@
+import React from 'react'
+import Script from 'next/script'
+
+export default function Head() {
+ return (
+ <>
+ <meta content="width=device-width, initial-scale=1" name="viewport"/>
+ <link rel="icon" href="/favicon.ico"/>
+ <link
+ precedence="default"
+ rel="stylesheet"
+ href="https://unpkg.com/mirotone@^4/dist/styles.css"
+ />
+ <title>NextJS 13 appDir - Miro</title>
+ <Script src="https://miro.com/app/static/sdk/v2/miro.js" />
+ </>
+ )
+}
Index: app/error.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/error.tsx b/app/error.tsx
new file mode 100644
--- /dev/null (date 1689189680625)
+++ b/app/error.tsx (date 1689189680625)
@@ -0,0 +1,21 @@
+'use client';
+
+
+import { useEffect } from 'react';
+
+export default function Error({ error, reset }: {
+ error: Error;
+ reset: () => void;
+}) {
+ useEffect(() => {
+ // Log the error to an error reporting service
+ console.error(error);
+ }, [error]);
+
+ return (
+ <div>
+ <p>Something went wrong!</p>
+ <button onClick={() => reset()}>Reset error boundary</button>
+ </div>
+ );
+}
Index: app/LoadMiroWebSDK.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/LoadMiroWebSDK.tsx b/app/LoadMiroWebSDK.tsx
new file mode 100644
--- /dev/null (date 1689189680624)
+++ b/app/LoadMiroWebSDK.tsx (date 1689189680624)
@@ -0,0 +1,14 @@
+'use client'
+
+import {useEffect} from 'react'
+
+export default function() {
+ useEffect(() => {
+ window?.miro?.board.ui.on('icon:click', async () => {
+ window.miro.board.ui.openPanel({
+ url: `/`,
+ });
+ });
+ }, []);
+ return null
+}
\ No newline at end of file
Index: app/layout.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/layout.tsx b/app/layout.tsx
new file mode 100644
--- /dev/null (date 1689189680624)
+++ b/app/layout.tsx (date 1689189680624)
@@ -0,0 +1,37 @@
+import {cookies} from 'next/headers'
+import React from 'react'
+import {Authentication} from '../src/Authentication/Authentication'
+import LoadMiroWebSDK from './LoadMiroWebSDK'
+import initMiroApiClient from '../src/initMiroApiClient'
+
+type RootLayoutProps = {
+ children: React.ReactNode
+}
+export default async function RootLayout({
+ children
+ }: RootLayoutProps) {
+ const nextCookies = cookies()
+ const {miro} = initMiroApiClient(nextCookies)
+
+ let destination = ''
+ // redirect to auth url if user has not authorized the app
+ if (!(await miro.isAuthorized(''))) {
+ destination = miro.getAuthUrl()
+ }
+
+ return (
+ <html>
+ <head>
+ </head>
+ <body>
+ <div style={{maxWidth: '500px', margin: 'var(--space-large) auto', display: 'block'}}>
+ <h1>Miro board info viewer</h1>
+ <LoadMiroWebSDK/>
+ <Authentication destination={destination}/>
+ <hr/>
+ {children}
+ </div>
+ </body>
+ </html>
+ )
+}
Index: app/api/redirect/page.tsx
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/api/redirect/page.tsx b/app/api/redirect/page.tsx
new file mode 100644
--- /dev/null (date 1689189924193)
+++ b/app/api/redirect/page.tsx (date 1689189924193)
@@ -0,0 +1,39 @@
+'use server'
+
+import {redirect} from 'next/navigation'
+import Link from 'next/link'
+import {cookies} from 'next/headers'
+
+import initMiroApiClient from '../../../src/initMiroApiClient';
+import CookieMachine from '../../../src/CookieMachine/CookieMachine'
+
+// handle redirect with code and exchange it for the access token
+export default async function AuthorizationPage ({
+ searchParams,
+}: {
+ searchParams?: { [key: string]: string | undefined };
+}) {
+ const nextCookies = cookies()
+ const {miro} = initMiroApiClient(nextCookies);
+
+ // Make sure the code is in query parameters
+ const code = searchParams?.code
+ if (!code) {
+ redirect('./')
+ }
+
+ let token
+ try {
+ token = await miro.exchangeCodeForAccessToken('', code);
+ } catch (e) {
+ console.error('error fetching access token from Miro', e)
+ }
+
+ return (
+ <div>
+ <p>Successfully authorized.</p>
+ <CookieMachine token={token}/>
+ <Link href={'/'}>Back home</Link>
+ </div>
+ )
+}
\ No newline at end of file
diff --git a/src/assets/welcome.png b/src/assets/welcome.png
deleted file mode 100644
index e66f0e793f0e07b5e486711bd1782e717df2d527..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
diff --git a/src/assets/congratulations.png b/public/congratulations.png
rename from src/assets/congratulations.png
rename to public/congratulations.png
index 1c2dfd03deb01178fa5c56d4992aa9574bce6e55..1c2dfd03deb01178fa5c56d4992aa9574bce6e55
GIT binary patch
literal 40308
zc$}R1bySo8`v;ES8w19uNq2}KDJh*pQj{DZjVLM7Asr*6RT_Z}6k()vry>#plG30^
zmvn!}>-{;uKfd4pemiI9>^$%5dS3mwuIt`woyTgVFa{U^0Hhk~5A*;44|Vf}65viw
zA79G=K(>s=10@4r&}Ih+1OO0#?OIzD&j9!H|IbhV+plxkqu)v&SThMgBZnaT#0b${
zn}u&|wnK0V0<v(Fk}`K61kwRd&f0q^a>QNqW2u?_mxE96VO^Ww`Sn4-vDjD;Wv@H1
zzySc?Ccg+vMy|zTrlm+gCX!GPumoJVkrW7DU9cy=!fRKPBms60y<E@Y-TWF_$nis7
z{ksK(bd7EYvIMvNT_K*pPl^Kre>SXK>A=<Q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