Skip to content

Commit 1b9c965

Browse files
committed
fix: refactor icons in the SDK
1 parent afff5b7 commit 1b9c965

File tree

100 files changed

+336
-732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+336
-732
lines changed

examples/SampleApp/src/components/AddMemberBottomSheet.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
View,
99
} from 'react-native';
1010
import { useSafeAreaInsets } from 'react-native-safe-area-context';
11-
import { CircleClose, Search, useTheme } from 'stream-chat-react-native';
11+
import { Search, useTheme } from 'stream-chat-react-native';
1212

1313
import { UserSearchResultsGrid } from './UserSearch/UserSearchResultsGrid';
1414

@@ -20,6 +20,7 @@ import {
2020
import { usePaginatedUsers } from '../hooks/usePaginatedUsers';
2121

2222
import type { UserResponse } from 'stream-chat';
23+
import { CircleClose } from '../icons/CircleClose';
2324

2425
const styles = StyleSheet.create({
2526
container: {

examples/SampleApp/src/components/ChannelInfoOverlay.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,16 @@ import Animated, {
1414
withDecay,
1515
withTiming,
1616
} from 'react-native-reanimated';
17-
import {
18-
CircleClose,
19-
Delete,
20-
User,
21-
UserMinus,
22-
useTheme,
23-
useViewport,
24-
UserAvatar,
25-
} from 'stream-chat-react-native';
17+
import { Delete, User, useTheme, useViewport, UserAvatar, Pin } from 'stream-chat-react-native';
2618
import { ChannelMemberResponse } from 'stream-chat';
2719

2820
import { useAppOverlayContext } from '../context/AppOverlayContext';
2921
import { useChannelInfoOverlayContext } from '../context/ChannelInfoOverlayContext';
3022
import { Archive } from '../icons/Archive';
31-
import { Pin } from '../icons/Pin';
3223
import { useChannelInfoOverlayActions } from '../hooks/useChannelInfoOverlayActions';
3324
import { SafeAreaView } from 'react-native-safe-area-context';
25+
import { UserMinus } from '../icons/UserMinus';
26+
import { CircleClose } from '../icons/CircleClose';
3427

3528
dayjs.extend(relativeTime);
3629

@@ -350,7 +343,7 @@ export const ChannelInfoOverlay = (props: ChannelInfoOverlayProps) => {
350343
]}
351344
>
352345
<View style={styles.rowInner}>
353-
<Pin height={24} width={24} />
346+
<Pin height={24} width={24} stroke={grey} />
354347
</View>
355348
<Text style={[styles.rowText, { color: black }]}>
356349
{membership?.pinned_at ? 'Unpin' : 'Pin'}

examples/SampleApp/src/components/ChannelPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
ChannelPreviewStatus,
1010
ChannelPreviewStatusProps,
1111
Delete,
12-
MenuPointHorizontal,
1312
Pin,
1413
useChannelMembershipState,
1514
useChatContext,
@@ -24,6 +23,7 @@ import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
2423

2524
import type { StackNavigatorParamList } from '../types';
2625
import { ChannelState } from 'stream-chat';
26+
import { MenuPointHorizontal } from '../icons/MenuPointHorizontal';
2727

2828
const styles = StyleSheet.create({
2929
leftSwipeableButton: {

examples/SampleApp/src/components/ConfirmationBottomSheet.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React from 'react';
22
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
33
import { useSafeAreaInsets } from 'react-native-safe-area-context';
4-
import { Delete, UserMinus, useTheme } from 'stream-chat-react-native';
4+
import { Delete, useTheme } from 'stream-chat-react-native';
55

66
import { useAppOverlayContext } from '../context/AppOverlayContext';
77
import {
88
isAddMemberBottomSheetData,
99
useBottomSheetOverlayContext,
1010
} from '../context/BottomSheetOverlayContext';
11+
import { UserMinus } from '../icons/UserMinus';
1112

1213
const styles = StyleSheet.create({
1314
actionButtonLeft: {

examples/SampleApp/src/components/MenuDrawer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, { useCallback, useEffect, useState } from 'react';
22
import { Image, StyleSheet, Text, TouchableOpacity, Pressable, View } from 'react-native';
3-
import { Edit, Group, User, useTheme } from 'stream-chat-react-native';
3+
import { Edit, User, useTheme } from 'stream-chat-react-native';
44

55
import { useAppContext } from '../context/AppContext';
66
import { SecretMenu } from './SecretMenu.tsx';
77

88
import type { DrawerContentComponentProps } from '@react-navigation/drawer';
99
import { SafeAreaView } from 'react-native-safe-area-context';
10+
import { Group } from '../icons/Group.tsx';
1011

1112
export const styles = StyleSheet.create({
1213
avatar: {

examples/SampleApp/src/components/NewDirectMessagingSendButton.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
MessageInputContextValue,
88
Search,
99
SendRight,
10-
SendUp,
1110
useChannelContext,
1211
useMessageInputContext,
1312
useTheme,
@@ -17,14 +16,16 @@ import { NewDirectMessagingScreenNavigationProp } from '../screens/NewDirectMess
1716

1817
import { useUserSearchContext } from '../context/UserSearchContext';
1918
import { useAppContext } from '../context/AppContext';
19+
import { SendUp } from '../icons/SendUp';
2020

21-
type NewDirectMessagingSendButtonPropsWithContext = Pick<MessageInputContextValue, 'giphyActive' | 'sendMessage'> & {
21+
type NewDirectMessagingSendButtonPropsWithContext = Pick<
22+
MessageInputContextValue,
23+
'giphyActive' | 'sendMessage'
24+
> & {
2225
/** Disables the button */ disabled: boolean;
2326
};
2427

25-
const SendButtonWithContext = (
26-
props: NewDirectMessagingSendButtonPropsWithContext,
27-
) => {
28+
const SendButtonWithContext = (props: NewDirectMessagingSendButtonPropsWithContext) => {
2829
const { disabled = false, giphyActive, sendMessage } = props;
2930
const {
3031
theme: {

examples/SampleApp/src/components/SecretMenu.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ import {
1414
StyleSheet,
1515
ScrollView,
1616
} from 'react-native';
17-
import { Close, Edit, Notification, Delete, Folder, ZIP, useTheme } from 'stream-chat-react-native';
17+
import { Close, Edit, Delete, ZIP, useTheme } from 'stream-chat-react-native';
1818
import { styles as menuDrawerStyles } from './MenuDrawer.tsx';
1919
import AsyncStore from '../utils/AsyncStore.ts';
2020
import { StreamChat } from 'stream-chat';
2121
import { LabeledTextInput } from '../screens/AdvancedUserSelectorScreen.tsx';
22+
import { Notification } from '../icons/Notification.tsx';
23+
import { Folder } from '../icons/Folder.tsx';
2224

2325
const isAndroid = Platform.OS === 'android';
2426

examples/SampleApp/src/components/UserInfoOverlay.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ import Animated, {
1515
withTiming,
1616
} from 'react-native-reanimated';
1717
import {
18-
CircleClose,
1918
MessageIcon,
2019
useChatContext,
2120
User,
22-
UserMinus,
2321
useTheme,
2422
useViewport,
2523
UserAvatar,
@@ -32,6 +30,8 @@ import { useAppContext } from '../context/AppContext';
3230
import { UserResponse } from 'stream-chat';
3331
import { useUserInfoOverlayActions } from '../hooks/useUserInfoOverlayActions';
3432
import { SafeAreaView } from 'react-native-safe-area-context';
33+
import { UserMinus } from '../icons/UserMinus';
34+
import { CircleClose } from '../icons/CircleClose';
3535

3636
dayjs.extend(relativeTime);
3737

@@ -123,19 +123,19 @@ export const UserInfoOverlay = (props: UserInfoOverlayProps) => {
123123
}
124124
showScreen.value = show
125125
? withTiming(1, {
126-
duration: 150,
127-
easing: Easing.in(Easing.ease),
128-
})
129-
: withTiming(
130-
0,
131-
{
132126
duration: 150,
133-
easing: Easing.out(Easing.ease),
134-
},
135-
() => {
136-
runOnJS(reset)();
137-
},
138-
);
127+
easing: Easing.in(Easing.ease),
128+
})
129+
: withTiming(
130+
0,
131+
{
132+
duration: 150,
133+
easing: Easing.out(Easing.ease),
134+
},
135+
() => {
136+
runOnJS(reset)();
137+
},
138+
);
139139
};
140140

141141
useEffect(() => {
@@ -181,12 +181,12 @@ export const UserInfoOverlay = (props: UserInfoOverlayProps) => {
181181
translateY.value =
182182
evt.velocityY > 1000
183183
? withDecay({
184-
velocity: evt.velocityY,
185-
})
184+
velocity: evt.velocityY,
185+
})
186186
: withTiming(screenHeight, {
187-
duration: 200,
188-
easing: Easing.out(Easing.ease),
189-
});
187+
duration: 200,
188+
easing: Easing.out(Easing.ease),
189+
});
190190
} else {
191191
translateY.value = withTiming(0);
192192
overlayOpacity.value = withTiming(1);
@@ -217,8 +217,8 @@ export const UserInfoOverlay = (props: UserInfoOverlayProps) => {
217217

218218
const self = channel
219219
? Object.values(channel.state.members).find(
220-
(channelMember) => channelMember.user?.id === client.user?.id,
221-
)
220+
(channelMember) => channelMember.user?.id === client.user?.id,
221+
)
222222
: undefined;
223223

224224
const { viewInfo, messageUser, removeFromGroup, cancel } = useUserInfoOverlayActions();

examples/SampleApp/src/components/UserSearch/UserSearchResults.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import {
99
} from 'react-native';
1010
import dayjs from 'dayjs';
1111
import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg';
12-
import { CheckSend, Close, useTheme, useViewport, UserAvatar } from 'stream-chat-react-native';
12+
import { Close, useTheme, useViewport, UserAvatar } from 'stream-chat-react-native';
1313

1414
import { useUserSearchContext } from '../../context/UserSearchContext';
1515

1616
import type { UserResponse } from 'stream-chat';
1717

1818
import { Search } from '../../icons/Search';
1919
import calendar from 'dayjs/plugin/calendar';
20+
import { CheckSend } from '../../icons/CheckSend';
2021

2122
dayjs.extend(calendar);
2223

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
import React from 'react';
2-
import Svg, { Path } from 'react-native-svg';
3-
import { useTheme } from 'stream-chat-react-native';
42

5-
import { IconProps } from '../utils/base';
3+
import { IconProps, RootPath, RootSvg } from 'stream-chat-react-native';
64

7-
export const CheckSend: React.FC<IconProps> = ({ height, width }) => {
8-
const {
9-
theme: {
10-
colors: { accent_blue },
11-
},
12-
} = useTheme();
13-
14-
return (
15-
<Svg fill='none' height={height} viewBox={`0 0 ${height} ${width}`} width={width}>
16-
<Path
17-
clipRule='evenodd'
18-
d='M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm3.707 7.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-2-2a1 1 0 111.414-1.414L11 12.586l3.293-3.293a1 1 0 011.414 0z'
19-
fill={accent_blue}
20-
fillRule='evenodd'
21-
/>
22-
</Svg>
23-
);
24-
};
5+
export const CheckSend = (props: IconProps) => (
6+
<RootSvg {...props}>
7+
<RootPath
8+
d='M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm3.707 7.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-2-2a1 1 0 111.414-1.414L11 12.586l3.293-3.293a1 1 0 011.414 0z'
9+
{...props}
10+
/>
11+
</RootSvg>
12+
);

0 commit comments

Comments
 (0)