@sendbird/uikit-react-native-foundation 2.0.1 → 2.0.2

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 (39) hide show
  1. package/lib/commonjs/index.js +16 -0
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/theme/DarkUIKitTheme.js +10 -0
  4. package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
  5. package/lib/commonjs/theme/LightUIKitTheme.js +10 -0
  6. package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
  7. package/lib/commonjs/types.js.map +1 -1
  8. package/lib/commonjs/ui/GroupChannelPreview/index.js +11 -2
  9. package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
  10. package/lib/commonjs/ui/OutlinedButton/index.js +57 -0
  11. package/lib/commonjs/ui/OutlinedButton/index.js.map +1 -0
  12. package/lib/commonjs/ui/ProfileCard/index.js +94 -0
  13. package/lib/commonjs/ui/ProfileCard/index.js.map +1 -0
  14. package/lib/module/index.js +2 -0
  15. package/lib/module/index.js.map +1 -1
  16. package/lib/module/theme/DarkUIKitTheme.js +10 -0
  17. package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
  18. package/lib/module/theme/LightUIKitTheme.js +10 -0
  19. package/lib/module/theme/LightUIKitTheme.js.map +1 -1
  20. package/lib/module/types.js.map +1 -1
  21. package/lib/module/ui/GroupChannelPreview/index.js +11 -2
  22. package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
  23. package/lib/module/ui/OutlinedButton/index.js +43 -0
  24. package/lib/module/ui/OutlinedButton/index.js.map +1 -0
  25. package/lib/module/ui/ProfileCard/index.js +78 -0
  26. package/lib/module/ui/ProfileCard/index.js.map +1 -0
  27. package/lib/typescript/src/index.d.ts +2 -0
  28. package/lib/typescript/src/types.d.ts +5 -1
  29. package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +2 -1
  30. package/lib/typescript/src/ui/OutlinedButton/index.d.ts +8 -0
  31. package/lib/typescript/src/ui/ProfileCard/index.d.ts +11 -0
  32. package/package.json +3 -3
  33. package/src/index.ts +2 -0
  34. package/src/theme/DarkUIKitTheme.ts +10 -0
  35. package/src/theme/LightUIKitTheme.ts +10 -0
  36. package/src/types.ts +7 -1
  37. package/src/ui/GroupChannelPreview/index.tsx +13 -0
  38. package/src/ui/OutlinedButton/index.tsx +42 -0
  39. package/src/ui/ProfileCard/index.tsx +73 -0
@@ -28,6 +28,7 @@ type Props = {
28
28
 
29
29
  frozen?: boolean;
30
30
  notificationOff?: boolean;
31
+ broadcast?: boolean;
31
32
  };
32
33
 
33
34
  const GroupChannelPreview = ({
@@ -43,6 +44,7 @@ const GroupChannelPreview = ({
43
44
  titleCaptionLeft,
44
45
  frozen,
45
46
  notificationOff,
47
+ broadcast,
46
48
  }: Props) => {
47
49
  const { colors } = useUIKitTheme();
48
50
  const color = colors.ui.groupChannelPreview;
@@ -65,6 +67,14 @@ const GroupChannelPreview = ({
65
67
  <View style={styles.rightSection}>
66
68
  <View style={styles.rightTopSection}>
67
69
  <View style={styles.channelInfoContainer}>
70
+ {broadcast && (
71
+ <Icon
72
+ size={16}
73
+ icon={'broadcast'}
74
+ color={colors.secondary}
75
+ containerStyle={styles.channelInfoBroadcast}
76
+ />
77
+ )}
68
78
  <Text numberOfLines={1} subtitle1 style={styles.channelInfoTitle} color={color.default.none.textTitle}>
69
79
  {title}
70
80
  </Text>
@@ -148,6 +158,9 @@ const styles = createStyleSheet({
148
158
  alignItems: 'center',
149
159
  flexDirection: 'row',
150
160
  },
161
+ channelInfoBroadcast: {
162
+ marginRight: 4,
163
+ },
151
164
  channelInfoTitle: {
152
165
  flexShrink: 1,
153
166
  marginRight: 4,
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { Pressable, StyleProp, ViewStyle } from 'react-native';
3
+
4
+ import Text from '../../components/Text';
5
+ import createStyleSheet from '../../styles/createStyleSheet';
6
+ import useUIKitTheme from '../../theme/useUIKitTheme';
7
+
8
+ type OutlinedButtonProps = {
9
+ children: string;
10
+ containerStyle?: StyleProp<ViewStyle>;
11
+ onPress?: () => void;
12
+ };
13
+
14
+ const OutlinedButton = ({ children, onPress, containerStyle }: OutlinedButtonProps) => {
15
+ const { colors } = useUIKitTheme();
16
+ return (
17
+ <Pressable
18
+ onPress={onPress}
19
+ style={[styles.outlinedButton, { borderColor: colors.onBackground01 }, containerStyle]}
20
+ >
21
+ <Text button color={colors.onBackground01} numberOfLines={1} style={styles.outlinedButtonText}>
22
+ {children}
23
+ </Text>
24
+ </Pressable>
25
+ );
26
+ };
27
+
28
+ const styles = createStyleSheet({
29
+ outlinedButton: {
30
+ borderRadius: 4,
31
+ padding: 16,
32
+ borderWidth: 1,
33
+ alignItems: 'center',
34
+ justifyContent: 'center',
35
+ },
36
+ outlinedButtonText: {
37
+ textAlign: 'center',
38
+ width: '100%',
39
+ },
40
+ });
41
+
42
+ export default OutlinedButton;
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { StyleProp, View, ViewStyle } from 'react-native';
3
+
4
+ import Divider from '../../components/Divider';
5
+ import Text from '../../components/Text';
6
+ import createStyleSheet from '../../styles/createStyleSheet';
7
+ import useUIKitTheme from '../../theme/useUIKitTheme';
8
+ import Avatar from '../Avatar';
9
+
10
+ type Props = {
11
+ uri: string;
12
+ username: string;
13
+
14
+ button?: JSX.Element;
15
+
16
+ bodyLabel: string;
17
+ body: string;
18
+
19
+ containerStyle?: StyleProp<ViewStyle>;
20
+ };
21
+
22
+ const ProfileCard = ({ uri, username, bodyLabel, body, button, containerStyle }: Props) => {
23
+ const { colors } = useUIKitTheme();
24
+ const color = colors.ui.profileCard.default.none;
25
+
26
+ return (
27
+ <View style={[styles.container, { backgroundColor: color.background }, containerStyle]}>
28
+ <View style={styles.profileContainer}>
29
+ <Avatar uri={uri} size={80} containerStyle={styles.profileAvatar} />
30
+ <Text h1 color={color.textUsername} numberOfLines={1}>
31
+ {username}
32
+ </Text>
33
+ </View>
34
+ {button && <View style={styles.messageButtonArea}>{button}</View>}
35
+ <Divider space={16} />
36
+ <View style={styles.profileInfoContainer}>
37
+ <Text body2 color={color.textBodyLabel} style={styles.profileInfoBodyLabel}>
38
+ {bodyLabel}
39
+ </Text>
40
+ <Text body3 numberOfLines={1} color={color.textBody}>
41
+ {body}
42
+ </Text>
43
+ </View>
44
+ </View>
45
+ );
46
+ };
47
+
48
+ const styles = createStyleSheet({
49
+ container: {
50
+ paddingTop: 32,
51
+ width: '100%',
52
+ },
53
+ profileContainer: {
54
+ alignItems: 'center',
55
+ paddingHorizontal: 16,
56
+ marginBottom: 24,
57
+ },
58
+ profileAvatar: {
59
+ marginBottom: 8,
60
+ },
61
+ profileInfoContainer: {
62
+ padding: 16,
63
+ },
64
+ profileInfoBodyLabel: {
65
+ marginBottom: 4,
66
+ },
67
+ messageButtonArea: {
68
+ marginHorizontal: 24,
69
+ marginBottom: 24,
70
+ },
71
+ });
72
+
73
+ export default ProfileCard;