linked-data-browser 0.0.7 → 0.0.8-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/.env +2 -0
  2. package/.eslintrc.js +1 -0
  3. package/{index.js → App.js} +1 -4
  4. package/README.md +6 -0
  5. package/app/index.tsx +4 -2
  6. package/app.json +1 -0
  7. package/babel.config.js +7 -8
  8. package/components/DataBrowser.tsx +9 -19
  9. package/components/DataBrowserContext.ts +23 -0
  10. package/components/TargetResourceProvider.tsx +1 -1
  11. package/components/ThemeProvider.tsx +2 -4
  12. package/components/common/LoadingBar.tsx +11 -1
  13. package/components/common/ProfileAvatar.tsx +4 -7
  14. package/components/nav/Layout.tsx +20 -4
  15. package/components/nav/header/AddressBox.tsx +104 -48
  16. package/components/nav/header/AvatarMenu.tsx +42 -10
  17. package/components/nav/header/Header.tsx +26 -19
  18. package/components/nav/header/SignInMenu.tsx +63 -36
  19. package/components/nav/header/ThemeToggleMenu.tsx +21 -9
  20. package/components/nav/header/ViewMenu.tsx +79 -71
  21. package/components/sharing/AccessDropdown.tsx +18 -7
  22. package/components/sharing/CopyLink.tsx +15 -3
  23. package/components/sharing/PermissionRow.tsx +17 -2
  24. package/components/sharing/SharingModal.tsx +30 -3
  25. package/components/sharing/WacRuleForm.tsx +12 -3
  26. package/components/sharing/agentPermissions/AgentInformation.tsx +16 -3
  27. package/components/sharing/agentPermissions/AgentInput.tsx +19 -4
  28. package/components/sharing/agentPermissions/AgentPermissionRow.tsx +24 -6
  29. package/components/ui/accordion.tsx +77 -33
  30. package/components/ui/alert.tsx +75 -42
  31. package/components/ui/avatar.tsx +38 -13
  32. package/components/ui/badge.tsx +76 -48
  33. package/components/ui/button.tsx +226 -108
  34. package/components/ui/card.tsx +60 -30
  35. package/components/ui/checkbox.tsx +53 -16
  36. package/components/ui/context-menu.tsx +238 -117
  37. package/components/ui/dialog.tsx +116 -65
  38. package/components/ui/dropdown-menu.tsx +304 -105
  39. package/components/ui/hover-card.tsx +36 -13
  40. package/components/ui/icon.tsx +23 -0
  41. package/components/ui/input-dropdown.tsx +42 -5
  42. package/components/ui/input.tsx +85 -22
  43. package/components/ui/label.tsx +16 -7
  44. package/components/ui/menubar.tsx +284 -136
  45. package/components/ui/navigation-menu.tsx +157 -90
  46. package/components/ui/popover.tsx +36 -9
  47. package/components/ui/progress.tsx +53 -27
  48. package/components/ui/radio-group.tsx +61 -17
  49. package/components/ui/select.tsx +139 -67
  50. package/components/ui/separator.tsx +22 -7
  51. package/components/ui/skeleton.tsx +16 -11
  52. package/components/ui/switch.tsx +83 -51
  53. package/components/ui/table.tsx +57 -35
  54. package/components/ui/tabs.tsx +66 -35
  55. package/components/ui/text.tsx +221 -30
  56. package/components/ui/textarea.tsx +34 -10
  57. package/components/ui/toggle-group.tsx +103 -46
  58. package/components/ui/toggle.tsx +97 -74
  59. package/components/ui/tooltip.tsx +38 -9
  60. package/components/ui/typography.tsx +94 -65
  61. package/components/useViewContext.tsx +8 -8
  62. package/global.css +93 -3
  63. package/lib/index.js +88 -0
  64. package/metro.config.js +1 -3
  65. package/package.json +14 -10
  66. package/resourceViews/Container/ContainerConfig.tsx +1 -1
  67. package/resourceViews/Container/ContainerView.tsx +63 -25
  68. package/resourceViews/Profile/ProfileConfig.tsx +1 -1
  69. package/resourceViews/Profile/ProfileKnows.tsx +17 -9
  70. package/resourceViews/Profile/ProfileView.tsx +21 -4
  71. package/resourceViews/RawCode/RawCodeConfig.tsx +1 -1
  72. package/resourceViews/RawCode/RawCodeView.tsx +20 -6
  73. package/components.json +0 -7
  74. package/lib/icons/ArrowRight.tsx +0 -4
  75. package/lib/icons/Check.tsx +0 -4
  76. package/lib/icons/ChevronDown.tsx +0 -4
  77. package/lib/icons/ChevronRight.tsx +0 -4
  78. package/lib/icons/ChevronUp.tsx +0 -4
  79. package/lib/icons/ChevronsRight.tsx +0 -4
  80. package/lib/icons/CircleSlash.tsx +0 -4
  81. package/lib/icons/CircleX.tsx +0 -4
  82. package/lib/icons/Code.tsx +0 -4
  83. package/lib/icons/EllipsisVertical.tsx +0 -4
  84. package/lib/icons/EyeOff.tsx +0 -4
  85. package/lib/icons/File.tsx +0 -4
  86. package/lib/icons/Fingerprint.tsx +0 -4
  87. package/lib/icons/Folder.tsx +0 -4
  88. package/lib/icons/Folders.tsx +0 -4
  89. package/lib/icons/Info.tsx +0 -4
  90. package/lib/icons/Link.tsx +0 -4
  91. package/lib/icons/Loader.tsx +0 -4
  92. package/lib/icons/LogOut.tsx +0 -4
  93. package/lib/icons/MonitorSmartphone.tsx +0 -4
  94. package/lib/icons/MoonStar.tsx +0 -4
  95. package/lib/icons/OctagonX.tsx +0 -4
  96. package/lib/icons/Plus.tsx +0 -4
  97. package/lib/icons/RefreshCw.tsx +0 -4
  98. package/lib/icons/Save.tsx +0 -4
  99. package/lib/icons/ShieldX.tsx +0 -4
  100. package/lib/icons/Sun.tsx +0 -4
  101. package/lib/icons/TextCursorInput.tsx +0 -4
  102. package/lib/icons/Trash.tsx +0 -4
  103. package/lib/icons/User.tsx +0 -4
  104. package/lib/icons/UserPlus.tsx +0 -4
  105. package/lib/icons/Users.tsx +0 -4
  106. package/lib/icons/ViewIcon.tsx +0 -4
  107. package/lib/icons/X.tsx +0 -4
  108. package/lib/icons/iconWithClassName.ts +0 -14
  109. package/lib/utils.ts +0 -6
  110. package/nativewind-env.d.ts +0 -1
  111. package/tailwind.config.js +0 -69
@@ -1,10 +1,10 @@
1
1
  import { useSolidAuth } from '@ldo/solid-react';
2
2
  import React, { FunctionComponent, useCallback, useState } from 'react';
3
- import { View } from 'react-native';
3
+ import { View, StyleSheet, useWindowDimensions } from 'react-native';
4
4
 
5
5
  import { Button } from '../../ui/button';
6
6
  import { Text } from '../../ui/text';
7
- import { EllipsisVertical } from '../../../lib/icons/EllipsisVertical';
7
+ import { EllipsisVertical } from 'lucide-react-native';
8
8
  import {
9
9
  DropdownMenu,
10
10
  DropdownMenuContent,
@@ -25,13 +25,17 @@ import {
25
25
  DialogTrigger,
26
26
  } from '../../ui/dialog';
27
27
  import { Input } from '../../ui/input';
28
-
29
- const DEFAULT_ISSUER = window.location.origin;
28
+ import { useDataBrowserConfig } from '../../DataBrowserContext';
30
29
 
31
30
  export const SignInMenu: FunctionComponent = () => {
32
31
  const [idpValue, setIdpValue] = useState('');
33
32
  const [, setIdpError] = useState<string | undefined>();
34
33
  const { login, signUp } = useSolidAuth();
34
+ const { width } = useWindowDimensions();
35
+ const { defaultIssuer } = useDataBrowserConfig();
36
+
37
+ // Tailwind sm: breakpoint is 640px
38
+ const isSmallScreen = width < 640;
35
39
  const onIdpSubmit = useCallback(async () => {
36
40
  setIdpError(undefined);
37
41
  try {
@@ -47,57 +51,62 @@ export const SignInMenu: FunctionComponent = () => {
47
51
 
48
52
  const renderButtonGroup = () => {
49
53
  return (
50
- <View className="flex-row">
51
- <Button
52
- key="signUp"
53
- className="hidden sm:block"
54
- onPress={() => signUp(DEFAULT_ISSUER)}
55
- variant="ghost"
56
- text="Sign Up"
57
- />
58
- <Button
59
- key="logIn"
60
- className="hidden sm:block"
61
- onPress={() => login(DEFAULT_ISSUER)}
62
- variant="default"
63
- text="Log In"
64
- />
54
+ <View style={styles.buttonGroup}>
55
+ {!isSmallScreen && (
56
+ <Button
57
+ key="signUp"
58
+ onPress={() => signUp(defaultIssuer)}
59
+ variant="ghost"
60
+ text="Sign Up"
61
+ />
62
+ )}
63
+ {!isSmallScreen && (
64
+ <Button
65
+ key="logIn"
66
+ onPress={() => login(defaultIssuer)}
67
+ variant="default"
68
+ text="Log In"
69
+ />
70
+ )}
65
71
  <DropdownMenu>
66
72
  <DropdownMenuTrigger asChild>
67
73
  <Button
68
74
  key="setMemu"
69
75
  variant="ghost"
70
- className="w-10"
71
- iconLeft={<EllipsisVertical size={20} />}
76
+ style={styles.menuButton}
77
+ iconLeft={EllipsisVertical}
78
+ textStyle={styles.menuButtonText}
72
79
  />
73
80
  </DropdownMenuTrigger>
74
- <DropdownMenuContent className="w-64 native:w-72">
81
+ <DropdownMenuContent style={styles.dropdownContent}>
75
82
  <DropdownMenuGroup>
76
- <DropdownMenuItem
77
- className="sm:hidden flex"
78
- onPress={() => signUp(DEFAULT_ISSUER)}
79
- >
80
- <Text>Sign Up</Text>
81
- </DropdownMenuItem>
82
- <DropdownMenuItem
83
- className="sm:hidden flex"
84
- onPress={() => login(DEFAULT_ISSUER)}
85
- >
86
- <Text>Log In</Text>
87
- </DropdownMenuItem>
83
+ {isSmallScreen && (
84
+ <DropdownMenuItem
85
+ onPress={() => signUp(defaultIssuer)}
86
+ >
87
+ <Text>Sign Up</Text>
88
+ </DropdownMenuItem>
89
+ )}
90
+ {isSmallScreen && (
91
+ <DropdownMenuItem
92
+ onPress={() => login(defaultIssuer)}
93
+ >
94
+ <Text>Log In</Text>
95
+ </DropdownMenuItem>
96
+ )}
88
97
  <Dialog>
89
98
  <DialogTrigger asChild>
90
99
  <DropdownMenuItem closeOnPress={false}>
91
100
  <Text>Log in with Another Pod</Text>
92
101
  </DropdownMenuItem>
93
102
  </DialogTrigger>
94
- <DialogContent className="w-[400px]">
103
+ <DialogContent style={styles.dialogContent}>
95
104
  <DialogHeader>
96
105
  <DialogTitle>Solid WebId or Identity Provider</DialogTitle>
97
106
  <DialogDescription>
98
107
  <Input
99
108
  value={idpValue}
100
- placeholder={DEFAULT_ISSUER}
109
+ placeholder={defaultIssuer}
101
110
  onChangeText={(newText) => setIdpValue(newText)}
102
111
  onSubmitEditing={onIdpSubmit}
103
112
  />
@@ -121,3 +130,21 @@ export const SignInMenu: FunctionComponent = () => {
121
130
 
122
131
  return renderButtonGroup();
123
132
  };
133
+
134
+ const styles = StyleSheet.create({
135
+ buttonGroup: {
136
+ flexDirection: 'row',
137
+ },
138
+ menuButton: {
139
+ width: 40,
140
+ },
141
+ dropdownContent: {
142
+ width: 256,
143
+ },
144
+ dialogContent: {
145
+ width: 400,
146
+ },
147
+ menuButtonText: {
148
+ fontSize: 20,
149
+ },
150
+ });
@@ -1,11 +1,12 @@
1
- import React from 'react';
2
- import { FunctionComponent } from 'react';
3
- import { MoonStar } from '../../../lib/icons/MoonStar';
4
- import { Sun } from '../../../lib/icons/Sun';
1
+ import React, { FunctionComponent } from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { MoonStar } from 'lucide-react-native';
4
+ import { Sun } from 'lucide-react-native';
5
5
  import { Text } from '../../ui/text';
6
6
  import { Switch } from '../../ui/switch';
7
7
  import { DropdownMenuItem } from '../../ui/dropdown-menu';
8
8
  import { useThemeChange } from '../../ThemeProvider';
9
+ import { Icon } from '../../ui/icon';
9
10
 
10
11
  export const ThemeToggleMenu: FunctionComponent = () => {
11
12
  const { colorScheme, setColorScheme } = useThemeChange();
@@ -15,20 +16,31 @@ export const ThemeToggleMenu: FunctionComponent = () => {
15
16
  onPress={() => {
16
17
  setColorScheme(colorScheme === 'light' ? 'dark' : 'light');
17
18
  }}
18
- className="justify-between"
19
+ style={styles.dropdownMenuItem}
19
20
  closeOnPress={false}
20
21
  >
21
- <Text className="flex flex-row gap-1 items-center">
22
- {colorScheme === 'dark' ? <MoonStar /> : <Sun />} Dark Mode
23
- </Text>
22
+ <View style={styles.textContainer}>
23
+ <Icon icon={colorScheme === 'dark' ? MoonStar : Sun} />
24
+ <Text>Dark Mode</Text>
25
+ </View>
24
26
 
25
27
  <Switch
26
28
  checked={colorScheme === 'dark'}
27
29
  onCheckedChange={(isDark) => {
28
30
  setColorScheme(isDark ? 'dark' : 'light');
29
31
  }}
30
- nativeID="airplane-mode"
31
32
  />
32
33
  </DropdownMenuItem>
33
34
  );
34
35
  };
36
+
37
+ const styles = StyleSheet.create({
38
+ dropdownMenuItem: {
39
+ justifyContent: 'space-between',
40
+ },
41
+ textContainer: {
42
+ flexDirection: 'row',
43
+ gap: 4,
44
+ alignItems: 'center',
45
+ },
46
+ });
@@ -1,88 +1,96 @@
1
1
  import React, { FunctionComponent } from 'react';
2
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
3
2
  import {
4
- NavigationMenu,
5
- NavigationMenuContent,
6
- NavigationMenuItem,
7
- NavigationMenuLink,
8
- NavigationMenuList,
9
- NavigationMenuTrigger,
10
- } from '../../ui/navigation-menu';
3
+ DropdownMenu,
4
+ DropdownMenuContent,
5
+ DropdownMenuItem,
6
+ DropdownMenuTrigger,
7
+ } from '../../ui/dropdown-menu';
11
8
  import { Text } from '../../ui/text';
12
- import { View } from 'react-native';
13
- import type { ViewRef } from '@rn-primitives/types';
14
- import { cn } from '../../../lib/utils';
15
- import { ViewIcon } from '../../../lib/icons/ViewIcon';
9
+ import { StyleSheet, useWindowDimensions } from 'react-native';
10
+ import { ViewIcon } from 'lucide-react-native';
16
11
  import { useViewContext } from '../../useViewContext';
17
12
  import { ResourceViewConfig } from '../../../components/ResourceView';
13
+ import { useTheme } from '@react-navigation/native';
14
+ import { Icon } from '../../ui/icon';
15
+ import { Button } from '../../ui/button';
18
16
 
19
17
  export const ViewMenu: FunctionComponent = () => {
20
- const insets = useSafeAreaInsets();
21
- const contentInsets = {
22
- top: insets.top,
23
- bottom: insets.bottom,
24
- left: 12,
25
- right: 12,
26
- };
27
18
  const { validViews } = useViewContext();
28
-
29
- const [isOpen, setIsOpen] = React.useState<string>();
19
+ const { width } = useWindowDimensions();
30
20
 
31
21
  return (
32
- <NavigationMenu value={isOpen} onValueChange={setIsOpen}>
33
- <NavigationMenuList>
34
- <NavigationMenuItem value="views">
35
- <NavigationMenuTrigger>
36
- <Text>
37
- <ViewIcon />
38
- </Text>
39
- <Text className="sm:block hidden">Views</Text>
40
- </NavigationMenuTrigger>
41
- <NavigationMenuContent insets={contentInsets}>
42
- <View
43
- role="list"
44
- className="web:grid w-dvw gap-3 p-4 md:w-[500px] web:md:grid-cols-2 lg:w-[600px] "
45
- >
46
- {validViews.map((menuItem) => (
47
- <ListItem key={menuItem.name} viewConfig={menuItem}>
48
- {menuItem.displayName}
49
- </ListItem>
50
- ))}
51
- </View>
52
- </NavigationMenuContent>
53
- </NavigationMenuItem>
54
- </NavigationMenuList>
55
- </NavigationMenu>
22
+ <DropdownMenu>
23
+ <DropdownMenuTrigger asChild>
24
+ <Button
25
+ variant="ghost"
26
+ iconLeft={ViewIcon}
27
+ text={width < 640 ? undefined : 'Views'}
28
+ />
29
+ </DropdownMenuTrigger>
30
+ <DropdownMenuContent
31
+ style={StyleSheet.flatten([styles.contentContainer])}
32
+ >
33
+ {validViews.map((menuItem) => (
34
+ <ListItem key={menuItem.name} viewConfig={menuItem}>
35
+ {menuItem.displayName}
36
+ </ListItem>
37
+ ))}
38
+ </DropdownMenuContent>
39
+ </DropdownMenu>
56
40
  );
57
41
  };
58
42
 
59
- const ListItem = React.forwardRef<
60
- ViewRef,
61
- React.ComponentPropsWithoutRef<typeof View> & {
62
- viewConfig: ResourceViewConfig;
63
- }
64
- >(({ className, viewConfig, ...props }, ref) => {
65
- // TODO: add navigationn to `href` on `NavigationMenuLink` onPress
43
+ const ListItem: React.FC<{
44
+ viewConfig: ResourceViewConfig;
45
+ children: React.ReactNode;
46
+ }> = ({ viewConfig, children }) => {
66
47
  const { curViewConfig, setCurViewConfig } = useViewContext();
67
- const Icon = viewConfig.displayIcon;
48
+ const { colors } = useTheme();
49
+ const DisplayIcon = viewConfig.displayIcon;
50
+
51
+ const isSelected = curViewConfig.name === viewConfig.name;
52
+
68
53
  return (
69
- <View role="listitem">
70
- <NavigationMenuLink
71
- ref={ref}
72
- className={cn(
73
- 'web:select-none flex-row items-center overflow-hidden rounded-md p-3 leading-none no-underline text-foreground web:outline-none web:transition-colors web:hover:bg-accent active:bg-accent web:hover:text-accent-foreground web:focus:bg-accent web:focus:text-accent-foreground cursor-pointer',
74
- className,
75
- curViewConfig.name === viewConfig.name ? 'bg-secondary' : '',
76
- )}
77
- onPress={() => setCurViewConfig(viewConfig)}
78
- {...props}
79
- >
80
- <Icon size={20} />
81
- <Text className="ml-2" size="sm">
82
- {viewConfig.displayName}
83
- </Text>
84
- </NavigationMenuLink>
85
- </View>
54
+ <DropdownMenuItem
55
+ style={StyleSheet.flatten([
56
+ styles.listItem,
57
+ isSelected && {
58
+ backgroundColor: colors.border,
59
+ },
60
+ ])}
61
+ onPress={() => setCurViewConfig(viewConfig)}
62
+ >
63
+ <Icon icon={DisplayIcon} />
64
+ <Text>{children}</Text>
65
+ </DropdownMenuItem>
86
66
  );
87
- });
67
+ };
88
68
  ListItem.displayName = 'ListItem';
69
+
70
+ const styles = StyleSheet.create({
71
+ triggerContainer: {
72
+ flexDirection: 'row',
73
+ alignItems: 'center',
74
+ gap: 4,
75
+ paddingHorizontal: 8,
76
+ paddingVertical: 6,
77
+ borderRadius: 6,
78
+ },
79
+ contentContainer: {
80
+ gap: 4,
81
+ padding: 4,
82
+ flexDirection: 'column' as const,
83
+ minWidth: 200,
84
+ },
85
+ listItem: {
86
+ flexDirection: 'row' as const,
87
+ alignItems: 'center' as const,
88
+ overflow: 'hidden' as const,
89
+ borderRadius: 2,
90
+ paddingHorizontal: 8,
91
+ paddingVertical: 6,
92
+ },
93
+ iconStyle: {
94
+ fontSize: 20,
95
+ },
96
+ });
@@ -13,8 +13,9 @@ import {
13
13
  import { Text } from '../ui/text';
14
14
  import { Button } from '../ui/button';
15
15
  import { Checkbox } from '../ui/checkbox';
16
- import { ChevronDown } from '../../lib/icons/ChevronDown';
17
- import { View } from 'react-native';
16
+ import { ChevronDown } from 'lucide-react-native';
17
+ import { StyleSheet } from 'react-native';
18
+ import { Icon } from '../ui/icon';
18
19
 
19
20
  interface AccessDropdownProps {
20
21
  value: AccessModeList;
@@ -53,12 +54,10 @@ export const AccessDropdown: FunctionComponent<AccessDropdownProps> = ({
53
54
 
54
55
  return (
55
56
  <DropdownMenu>
56
- <DropdownMenuTrigger asChild>
57
- <Button variant="outline" className=" w-[130px] justify-between gap-0">
57
+ <DropdownMenuTrigger asChild style={styles.button}>
58
+ <Button variant="outline">
58
59
  <Text>{accessDescription}</Text>
59
- <Text>
60
- <ChevronDown size={14} />
61
- </Text>
60
+ <Icon icon={ChevronDown} style={styles.buttonChevron} />
62
61
  </Button>
63
62
  </DropdownMenuTrigger>
64
63
  <DropdownMenuContent>
@@ -93,3 +92,15 @@ export const AccessDropdown: FunctionComponent<AccessDropdownProps> = ({
93
92
  </DropdownMenu>
94
93
  );
95
94
  };
95
+
96
+ const styles = StyleSheet.create({
97
+ button: {
98
+ display: 'flex',
99
+ width: 130,
100
+ justifyContent: 'space-between',
101
+ gap: 0,
102
+ },
103
+ buttonChevron: {
104
+ fontSize: 14,
105
+ },
106
+ });
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useState } from 'react';
2
+ import { StyleSheet } from 'react-native';
2
3
  import { Button } from '../ui/button';
3
- import { Text } from '../ui/text';
4
- import { Link } from '../../lib/icons/Link';
4
+ import { Link } from 'lucide-react-native';
5
5
  import { FunctionComponent } from 'react';
6
6
  import { useViewContext } from '../useViewContext';
7
7
 
@@ -16,6 +16,18 @@ export const CopyLink: FunctionComponent = () => {
16
16
  }, [targetUri]);
17
17
 
18
18
  return (
19
- <Button variant="outline" className="flex-row" onPress={onCopy} text={message} iconLeft={<Link />} />
19
+ <Button
20
+ variant="outline"
21
+ style={styles.button}
22
+ onPress={onCopy}
23
+ text={message}
24
+ iconLeft={Link}
25
+ />
20
26
  );
21
27
  };
28
+
29
+ const styles = StyleSheet.create({
30
+ button: {
31
+ flexDirection: 'row',
32
+ },
33
+ });
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { StyleSheet } from 'react-native';
2
3
  import { AccessModeList } from '@ldo/connected-solid';
3
4
  import { Text } from '../ui/text';
4
5
  import { FunctionComponent } from 'react';
@@ -21,8 +22,8 @@ export const PermissionRow: FunctionComponent<PermissionRowProps> = ({
21
22
  onChange,
22
23
  }) => {
23
24
  return (
24
- <View className="flex-row justify-between items-center">
25
- <View className="flex-row gap-4 flex-1 items-center">
25
+ <View style={styles.container}>
26
+ <View style={styles.leftSection}>
26
27
  <Avatar alt={displayName}>
27
28
  <AvatarFallback>
28
29
  <Text>
@@ -36,3 +37,17 @@ export const PermissionRow: FunctionComponent<PermissionRowProps> = ({
36
37
  </View>
37
38
  );
38
39
  };
40
+
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ flexDirection: 'row',
44
+ justifyContent: 'space-between',
45
+ alignItems: 'center',
46
+ },
47
+ leftSection: {
48
+ flexDirection: 'row',
49
+ gap: 16,
50
+ flex: 1,
51
+ alignItems: 'center',
52
+ },
53
+ });
@@ -8,6 +8,8 @@ import React, {
8
8
  useMemo,
9
9
  useState,
10
10
  } from 'react';
11
+ import { StyleSheet, useWindowDimensions } from 'react-native';
12
+ import { useTheme } from '@react-navigation/native';
11
13
  import {
12
14
  Dialog,
13
15
  DialogContent,
@@ -50,6 +52,7 @@ export const SharingModalProvider: FunctionComponent<PropsWithChildren<{}>> = ({
50
52
  children,
51
53
  }) => {
52
54
  const { targetResource } = useViewContext();
55
+ const { colors } = useTheme();
53
56
  const [isOpen, setIsOpen] = useState(false);
54
57
  const [wacResult, setWacResult] = useState<
55
58
  | GetWacRuleError<SolidLeaf | SolidContainer>
@@ -62,6 +65,7 @@ export const SharingModalProvider: FunctionComponent<PropsWithChildren<{}>> = ({
62
65
  authenticated: { read: false, write: false, append: false, control: false },
63
66
  agent: {},
64
67
  });
68
+ const { width, height } = useWindowDimensions();
65
69
 
66
70
  useEffect(() => {
67
71
  if (
@@ -116,17 +120,26 @@ export const SharingModalProvider: FunctionComponent<PropsWithChildren<{}>> = ({
116
120
  return (
117
121
  <sharingModalContext.Provider value={context}>
118
122
  <Dialog open={isOpen} onOpenChange={(value) => setIsOpen(value)}>
119
- <DialogContent className="sm:w-[640px] w-[95vw] h-[95vh]">
123
+ <DialogContent
124
+ style={{
125
+ width: width > 640 ? 640 : width * 0.95,
126
+ height: height * 0.95,
127
+ }}
128
+ >
120
129
  <LoadingBar isLoading={isLoading} />
121
130
  <DialogHeader>
122
131
  <DialogTitle>Resource Sharing Preferences</DialogTitle>
123
132
  </DialogHeader>
124
- <ScrollView className="flex-1 border-border border-b border-t pt-2 pb-2 ml-[-24px] mr-[-24px] pl-6 pr-6">
133
+ <ScrollView
134
+ style={[{ borderColor: colors.border }, styles.scrollView]}
135
+ >
125
136
  {(() => {
126
137
  if (!wacResult) return <></>;
127
138
  if (wacResult.isError) {
128
139
  return (
129
- <Text className="color-red-800">{wacResult.message}</Text>
140
+ <Text style={{ color: colors.notification }}>
141
+ {wacResult.message}
142
+ </Text>
130
143
  );
131
144
  }
132
145
  return (
@@ -147,3 +160,17 @@ export const SharingModalProvider: FunctionComponent<PropsWithChildren<{}>> = ({
147
160
  </sharingModalContext.Provider>
148
161
  );
149
162
  };
163
+
164
+ const styles = StyleSheet.create({
165
+ scrollView: {
166
+ flex: 1,
167
+ borderTopWidth: 1,
168
+ borderBottomWidth: 1,
169
+ paddingTop: 8,
170
+ paddingBottom: 8,
171
+ marginLeft: -24,
172
+ marginRight: -24,
173
+ paddingLeft: 24,
174
+ paddingRight: 24,
175
+ },
176
+ });
@@ -1,12 +1,13 @@
1
1
  import React from 'react';
2
+ import { StyleSheet } from 'react-native';
2
3
  import { Separator } from '../ui/separator';
3
4
  import { FunctionComponent } from 'react';
4
5
  import { AgentPermissions } from './agentPermissions/AgentPermissions';
5
6
  import { WacRule } from '@ldo/connected-solid';
6
7
  import { View } from 'react-native';
7
8
  import { PermissionRow } from './PermissionRow';
8
- import { Users } from '../../lib/icons/Users';
9
- import { Fingerprint } from '../../lib/icons/Fingerprint';
9
+ import { Users } from 'lucide-react-native';
10
+ import { Fingerprint } from 'lucide-react-native';
10
11
 
11
12
  interface WacRuleFormProps {
12
13
  value: WacRule;
@@ -18,7 +19,7 @@ export const WacRuleForm: FunctionComponent<WacRuleFormProps> = ({
18
19
  onChange,
19
20
  }) => {
20
21
  return (
21
- <View className="gap-4 mt-2 mb-2">
22
+ <View style={styles.container}>
22
23
  <PermissionRow
23
24
  displayName="Public Access"
24
25
  Icon={Users}
@@ -42,3 +43,11 @@ export const WacRuleForm: FunctionComponent<WacRuleFormProps> = ({
42
43
  </View>
43
44
  );
44
45
  };
46
+
47
+ const styles = StyleSheet.create({
48
+ container: {
49
+ gap: 16,
50
+ marginTop: 8,
51
+ marginBottom: 8,
52
+ },
53
+ });
@@ -1,7 +1,7 @@
1
1
  import { SolidProfileShapeType } from '../../../.ldo/profile.shapeTypes';
2
2
  import { useResource, useSolidAuth, useSubject } from '@ldo/solid-react';
3
3
  import React, { FunctionComponent, ReactNode } from 'react';
4
- import { View } from 'react-native';
4
+ import { View, StyleSheet } from 'react-native';
5
5
  import { ProfileAvatar } from '../../common/ProfileAvatar';
6
6
  import { Text } from '../../ui/text';
7
7
 
@@ -19,9 +19,9 @@ export const AgentInformation: FunctionComponent<AgentInformationProps> = ({
19
19
  const agentProfile = useSubject(SolidProfileShapeType, webId);
20
20
 
21
21
  return (
22
- <View className="flex-row gap-4 flex-1 items-center">
22
+ <View style={styles.container}>
23
23
  <ProfileAvatar profile={agentProfile} />
24
- <View className="flex-1">
24
+ <View style={styles.textContainer}>
25
25
  <Text>
26
26
  {agentProfile['@id'] === session.webId
27
27
  ? 'You'
@@ -31,6 +31,19 @@ export const AgentInformation: FunctionComponent<AgentInformationProps> = ({
31
31
  {webId}
32
32
  </Text>
33
33
  </View>
34
+ {accessoryRight}
34
35
  </View>
35
36
  );
36
37
  };
38
+
39
+ const styles = StyleSheet.create({
40
+ container: {
41
+ flexDirection: 'row',
42
+ gap: 16,
43
+ flex: 1,
44
+ alignItems: 'center',
45
+ },
46
+ textContainer: {
47
+ flex: 1,
48
+ },
49
+ });