Skip to content

Commit 9bbd89c

Browse files
authored
chore: icon migration (#3521)
## 🎯 Goal The icon set we used had a license that was blocking open source distribution and so we're changing the entire icon set before rolling out the next major. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent dd94992 commit 9bbd89c

File tree

297 files changed

+2585
-2757
lines changed

Some content is hidden

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

297 files changed

+2585
-2757
lines changed

examples/SampleApp/src/components/AddMembersBottomSheet.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import { SafeAreaView } from 'react-native-safe-area-context';
1212
import {
1313
BottomSheetModal,
1414
Checkmark,
15-
Close,
1615
StreamBottomSheetModalFlatList,
1716
UserAvatar,
1817
useStableCallback,
1918
useTheme,
2019
} from 'stream-chat-react-native';
2120

21+
import { Close } from '../icons/Close';
2222
import { CircleClose } from '../icons/CircleClose';
2323
import { usePaginatedUsers } from '../hooks/usePaginatedUsers';
2424

@@ -159,7 +159,7 @@ export const AddMembersBottomSheet = React.memo(
159159

160160
const initialLoadComplete = initialResults !== null;
161161

162-
const emptyComponent = useMemo(() => {
162+
const EmptyComponent = useCallback(() => {
163163
if (loading && !initialLoadComplete) {
164164
return (
165165
<View style={styles.emptyState}>
@@ -248,7 +248,7 @@ export const AddMembersBottomSheet = React.memo(
248248
keyExtractor={keyExtractor}
249249
keyboardDismissMode='interactive'
250250
keyboardShouldPersistTaps='handled'
251-
ListEmptyComponent={emptyComponent}
251+
ListEmptyComponent={EmptyComponent}
252252
onEndReached={loadMore}
253253
renderItem={renderItem}
254254
contentContainerStyle={styles.listContent}

examples/SampleApp/src/components/AllMembersBottomSheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Pressable, StyleSheet, Text, View } from 'react-native';
33
import { SafeAreaView } from 'react-native-safe-area-context';
44
import {
55
BottomSheetModal,
6-
Close,
76
StreamBottomSheetModalFlatList,
87
UserAdd,
98
useStableCallback,
@@ -12,6 +11,7 @@ import {
1211

1312
import { ContactDetailBottomSheet } from './ContactDetailBottomSheet';
1413
import { MemberListItem } from './MemberListItem';
14+
import { Close } from '../icons/Close';
1515

1616
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
1717
import type { Channel, ChannelMemberResponse } from 'stream-chat';

examples/SampleApp/src/components/BottomTabs.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';
1313
import type { Route } from '@react-navigation/native';
1414
import { DraftsTab } from '../icons/DraftsTab';
1515
import { RemindersTab } from '../icons/ReminderTab';
16+
import { useLegacyColors } from '../theme/useLegacyColors';
1617

1718
const styles = StyleSheet.create({
1819
notification: {
@@ -84,11 +85,8 @@ type TabProps = Pick<BottomTabBarProps, 'navigation' | 'state'> & {
8485

8586
const Tab = (props: TabProps) => {
8687
const { navigation, state, route, index } = props;
87-
const {
88-
theme: {
89-
colors: { black, grey },
90-
},
91-
} = useTheme();
88+
useTheme();
89+
const { black, grey } = useLegacyColors();
9290
const tab = getTab(route.name);
9391

9492
const isFocused = state.index === index;
@@ -130,11 +128,8 @@ const Tab = (props: TabProps) => {
130128

131129
export const BottomTabs: React.FC<BottomTabBarProps> = (props) => {
132130
const { navigation, state } = props;
133-
const {
134-
theme: {
135-
colors: { white },
136-
},
137-
} = useTheme();
131+
useTheme();
132+
const { white } = useLegacyColors();
138133
const { bottom } = useSafeAreaInsets();
139134

140135
return (

examples/SampleApp/src/components/ChannelInfoOverlay.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Animated from 'react-native-reanimated';
77
import {
88
CircleClose,
99
Delete,
10-
User,
1110
UserMinus,
1211
useTheme,
1312
useViewport,
@@ -24,6 +23,8 @@ import { Archive } from '../icons/Archive';
2423
import { useChannelInfoOverlayActions } from '../hooks/useChannelInfoOverlayActions';
2524
import { SafeAreaView } from 'react-native-safe-area-context';
2625
import { Pin } from '../icons/Pin.tsx';
26+
import { User } from '../icons/User';
27+
import { useLegacyColors } from '../theme/useLegacyColors';
2728

2829
import type { ConfirmationData } from './ConfirmationBottomSheet';
2930

@@ -102,11 +103,9 @@ export const ChannelInfoOverlay = (props: ChannelInfoOverlayProps) => {
102103
const { channel, clientId, membership, navigation } = data || {};
103104

104105
const {
105-
theme: {
106-
colors: { accent_red, black, grey },
107-
semantics,
108-
},
106+
theme: { semantics },
109107
} = useTheme();
108+
const { accent_red, black, grey } = useLegacyColors();
110109

111110
// magic number 8 used as fontSize is 16 so assuming average character width of half
112111
const maxWidth = channel

examples/SampleApp/src/components/ChatScreenHeader.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React from 'react';
22
import { Image, StyleSheet, TouchableOpacity } from 'react-native';
33
import { CompositeNavigationProp, useNavigation } from '@react-navigation/native';
4-
import { useChatContext, useTheme } from 'stream-chat-react-native';
4+
import { useChatContext } from 'stream-chat-react-native';
55

66
import { RoundButton } from './RoundButton';
77
import { ScreenHeader } from './ScreenHeader';
88

99
import { useAppContext } from '../context/AppContext';
1010
import { NewDirectMessageIcon } from '../icons/NewDirectMessageIcon';
11+
import { useLegacyColors } from '../theme/useLegacyColors';
1112

1213
import type { DrawerNavigationProp } from '@react-navigation/drawer';
1314
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
@@ -29,11 +30,7 @@ type ChatScreenHeaderNavigationProp = CompositeNavigationProp<
2930
>;
3031

3132
export const ChatScreenHeader: React.FC<{ title?: string }> = ({ title = 'Stream Chat' }) => {
32-
const {
33-
theme: {
34-
colors: { accent_blue },
35-
},
36-
} = useTheme();
33+
const { accent_blue } = useLegacyColors();
3734

3835
const navigation = useNavigation<ChatScreenHeaderNavigationProp>();
3936
const { chatClient } = useAppContext();

examples/SampleApp/src/components/ContactDetailBottomSheet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { SafeAreaView } from 'react-native-safe-area-context';
44
import {
55
BottomSheetModal,
66
CircleBan,
7-
MessageIcon,
87
useChatContext,
98
useStableCallback,
109
useTheme,
@@ -13,6 +12,7 @@ import {
1312

1413
import { ListItem } from './ListItem';
1514

15+
import { Message } from '../icons/Message';
1616
import { Mute } from '../icons/Mute';
1717
import { getUserActivityStatus } from '../utils/getUserActivityStatus';
1818

@@ -120,7 +120,7 @@ export const ContactDetailBottomSheet = React.memo(
120120
</View>
121121

122122
<ListItem
123-
icon={<MessageIcon height={20} width={20} pathFill={semantics.textPrimary} />}
123+
icon={<Message height={20} width={20} fill={semantics.textPrimary} />}
124124
label='Send Direct Message'
125125
onPress={sendDirectMessage}
126126
/>

examples/SampleApp/src/components/DraftsList.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useCallback, useEffect, useMemo } from 'react';
1111
import dayjs from 'dayjs';
1212
import { useIsFocused, useNavigation } from '@react-navigation/native';
1313
import { ChannelResponse, DraftMessage, DraftResponse, MessageResponseBase } from 'stream-chat';
14+
import { useLegacyColors } from '../theme/useLegacyColors';
1415

1516
export type DraftItemProps = {
1617
type?: 'channel' | 'thread';
@@ -22,11 +23,8 @@ export type DraftItemProps = {
2223
};
2324

2425
export const DraftItem = ({ type, channel, date, message, thread }: DraftItemProps) => {
25-
const {
26-
theme: {
27-
colors: { grey },
28-
},
29-
} = useTheme();
26+
useTheme();
27+
const { grey } = useLegacyColors();
3028
const navigation = useNavigation();
3129
const { client } = useChatContext();
3230
const messagePreviewText = useMessagePreviewText({ message });

examples/SampleApp/src/components/EditGroupBottomSheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import {
1313
BottomSheetModal,
1414
ChannelAvatar,
1515
Checkmark,
16-
Close,
1716
useStableCallback,
1817
useTheme,
1918
} from 'stream-chat-react-native';
2019

20+
import { Close } from '../icons/Close';
2121
import type { Channel } from 'stream-chat';
2222

2323
type EditGroupBottomSheetProps = {

examples/SampleApp/src/components/LocationSharing/CreateLocationModal.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
useTranslationContext,
2626
} from 'stream-chat-react-native';
2727
import MapView, { MapMarker, Marker } from 'react-native-maps';
28+
import { useLegacyColors } from '../../theme/useLegacyColors';
2829

2930
type LiveLocationCreateModalProps = {
3031
visible: boolean;
@@ -47,11 +48,8 @@ export const LiveLocationCreateModal = ({
4748
const messageComposer = useMessageComposer();
4849
const { width, height } = useWindowDimensions();
4950
const { client } = useChatContext();
50-
const {
51-
theme: {
52-
colors: { accent_blue, grey, grey_whisper },
53-
},
54-
} = useTheme();
51+
useTheme();
52+
const { accent_blue, grey, grey_whisper } = useLegacyColors();
5553
const { t } = useTranslationContext();
5654
const mapRef = useRef<MapView | null>(null);
5755
const markerRef = useRef<MapMarker | null>(null);

examples/SampleApp/src/components/LocationSharing/MessageLocation.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from 'stream-chat-react-native';
1717
import MapView, { MapMarker, Marker } from 'react-native-maps';
1818
import { SharedLocationResponse, StreamChat } from 'stream-chat';
19+
import { useLegacyColors } from '../../theme/useLegacyColors';
1920

2021
const MessageLocationFooter = ({
2122
client,
@@ -26,11 +27,8 @@ const MessageLocationFooter = ({
2627
}) => {
2728
const { channel } = useChannelContext();
2829
const { end_at, user_id } = shared_location;
29-
const {
30-
theme: {
31-
colors: { grey },
32-
},
33-
} = useTheme();
30+
useTheme();
31+
const { grey } = useLegacyColors();
3432
const liveLocationActive = end_at && new Date(end_at) > new Date();
3533
const endedAtDate = end_at ? new Date(end_at) : null;
3634
const formattedEndedAt = endedAtDate ? endedAtDate.toLocaleString() : '';
@@ -79,12 +77,8 @@ const MessageLocationComponent = ({
7977

8078
const { width, height } = useWindowDimensions();
8179
const aspect_ratio = width / height;
82-
83-
const {
84-
theme: {
85-
colors: { accent_blue },
86-
},
87-
} = useTheme();
80+
useTheme();
81+
const { accent_blue } = useLegacyColors();
8882

8983
const region = useMemo(() => {
9084
const latitudeDelta = 0.1;

0 commit comments

Comments
 (0)