21
21
22
22
import type { ReactElement } from "react" ;
23
23
import React , { useContext } from "react" ;
24
- import { addDatetime , addStringNoLocale , createSolidDataset , createThing , getThing , getUrl , setThing , SolidDataset } from "@inrupt/solid-client" ;
24
+ import type { SolidDataset } from "@inrupt/solid-client" ;
25
+ import {
26
+ addDatetime ,
27
+ addStringNoLocale ,
28
+ createSolidDataset ,
29
+ createThing ,
30
+ getThing ,
31
+ getUrl ,
32
+ setThing ,
33
+ } from "@inrupt/solid-client" ;
25
34
import DatasetContext , {
26
35
DatasetProvider ,
27
36
} from "../../src/context/datasetContext" ;
@@ -76,11 +85,7 @@ export function BasicExample(): ReactElement {
76
85
namePredicate ,
77
86
`example name 2` ,
78
87
) ;
79
- const thing2 = addDatetime (
80
- thing2A ,
81
- datePredicate ,
82
- new Date ( "1999-01-02" ) ,
83
- ) ;
88
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
84
89
85
90
const emptyDataset = createSolidDataset ( ) ;
86
91
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
@@ -113,21 +118,9 @@ export function MultipleValues(): ReactElement {
113
118
namePredicate ,
114
119
`example name 1` ,
115
120
) ;
116
- const thing1B = addStringNoLocale (
117
- thing1A ,
118
- nickPredicate ,
119
- `Nickname` ,
120
- ) ;
121
- const thing1C = addStringNoLocale (
122
- thing1B ,
123
- nickPredicate ,
124
- `Alt Nickname` ,
125
- ) ;
126
- const thing1 = addStringNoLocale (
127
- thing1C ,
128
- nickPredicate ,
129
- `Final Nickname` ,
130
- ) ;
121
+ const thing1B = addStringNoLocale ( thing1A , nickPredicate , `Nickname` ) ;
122
+ const thing1C = addStringNoLocale ( thing1B , nickPredicate , `Alt Nickname` ) ;
123
+ const thing1 = addStringNoLocale ( thing1C , nickPredicate , `Final Nickname` ) ;
131
124
132
125
const thing2A = addStringNoLocale (
133
126
createThing ( ) ,
@@ -184,11 +177,7 @@ export function CustomBodyComponent(): ReactElement {
184
177
namePredicate ,
185
178
`example name 2` ,
186
179
) ;
187
- const thing2 = addDatetime (
188
- thing2A ,
189
- datePredicate ,
190
- new Date ( "1999-01-02" ) ,
191
- ) ;
180
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
192
181
193
182
const emptyDataset = createSolidDataset ( ) ;
194
183
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
@@ -249,10 +238,7 @@ export function NestedDataExample(): ReactElement {
249
238
let phoneNumber = "" ;
250
239
numberThingIris . some ( ( numberThingIri ) => {
251
240
const numberThing = getThing ( dataset , numberThingIri ) ;
252
- if (
253
- numberThing &&
254
- getUrl ( numberThing , typeProperty ) === numberType
255
- ) {
241
+ if ( numberThing && getUrl ( numberThing , typeProperty ) === numberType ) {
256
242
phoneNumber = getUrl ( numberThing , valueProperty ) ?? "" ;
257
243
return true ;
258
244
}
@@ -267,10 +253,7 @@ export function NestedDataExample(): ReactElement {
267
253
if ( ! solidDataset ) {
268
254
return null ;
269
255
}
270
- const personThing = getThing (
271
- solidDataset ,
272
- `${ host } /example.ttl#me` ,
273
- ) ;
256
+ const personThing = getThing ( solidDataset , `${ host } /example.ttl#me` ) ;
274
257
const alterEgoThing = getThing (
275
258
solidDataset ,
276
259
`${ host } /example.ttl#alterEgo` ,
@@ -350,11 +333,7 @@ export function SortableColumns(): ReactElement {
350
333
namePredicate ,
351
334
`example name 2` ,
352
335
) ;
353
- const thing2 = addDatetime (
354
- thing2A ,
355
- datePredicate ,
356
- new Date ( "1999-01-02" ) ,
357
- ) ;
336
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
358
337
359
338
const emptyDataset = createSolidDataset ( ) ;
360
339
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
@@ -406,11 +385,7 @@ export function FilterOnFirstColumn({
406
385
namePredicate ,
407
386
`example name 2` ,
408
387
) ;
409
- const thing2 = addDatetime (
410
- thing2A ,
411
- datePredicate ,
412
- new Date ( "1999-01-02" ) ,
413
- ) ;
388
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
414
389
415
390
const emptyDataset = createSolidDataset ( ) ;
416
391
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
@@ -456,16 +431,8 @@ export function SortingFunctionOnFirstColumn(): ReactElement {
456
431
) ;
457
432
const thing1 = addDatetime ( thing1A , datePredicate , new Date ( ) ) ;
458
433
459
- const thing2A = addStringNoLocale (
460
- createThing ( ) ,
461
- namePredicate ,
462
- "Name A" ,
463
- ) ;
464
- const thing2 = addDatetime (
465
- thing2A ,
466
- datePredicate ,
467
- new Date ( "1999-01-02" ) ,
468
- ) ;
434
+ const thing2A = addStringNoLocale ( createThing ( ) , namePredicate , "Name A" ) ;
435
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
469
436
470
437
const emptyDataset = createSolidDataset ( ) ;
471
438
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
@@ -516,11 +483,7 @@ export function NoDataComponent(): ReactElement {
516
483
namePredicate ,
517
484
`example name 2` ,
518
485
) ;
519
- const thing2 = addDatetime (
520
- thing2A ,
521
- datePredicate ,
522
- new Date ( "1999-01-02" ) ,
523
- ) ;
486
+ const thing2 = addDatetime ( thing2A , datePredicate , new Date ( "1999-01-02" ) ) ;
524
487
525
488
const emptyDataset = createSolidDataset ( ) ;
526
489
const datasetWithThing1 = setThing ( emptyDataset , thing1 ) ;
0 commit comments