Skip to content

Commit 9556c08

Browse files
committed
feat: channel list and message list empty redesign
1 parent 4dba502 commit 9556c08

13 files changed

Lines changed: 42 additions & 46 deletions

File tree

package/src/components/Indicators/EmptyStateIndicator.tsx

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
33

44
import { useTheme } from '../../contexts/themeContext/ThemeContext';
55
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
6-
import { useViewport } from '../../hooks/useViewport';
7-
import { ChatIcon, MessageBubbleEmpty, MessageIcon } from '../../icons';
6+
import { MessageBubbleEmpty } from '../../icons';
87
import { primitives } from '../../theme';
98

109
export type EmptyStateProps = {
@@ -14,59 +13,41 @@ export type EmptyStateProps = {
1413
export const EmptyStateIndicator = ({ listType }: EmptyStateProps) => {
1514
const {
1615
theme: {
17-
colors: { black, grey, grey_gainsboro },
18-
emptyStateIndicator: {
19-
channelContainer,
20-
channelDetails,
21-
channelTitle,
22-
messageContainer,
23-
messageTitle,
24-
},
16+
emptyStateIndicator: { channelContainer, channelTitle, messageContainer, messageTitle },
2517
semantics,
2618
},
2719
} = useTheme();
28-
const { vw } = useViewport();
29-
const width = vw(33);
3020
const { t } = useTranslationContext();
3121
const styles = useStyles();
3222

3323
switch (listType) {
3424
case 'channel':
3525
return (
3626
<View style={[styles.container, channelContainer]}>
37-
<MessageIcon height={width} pathFill={grey_gainsboro} width={width} />
38-
<Text
39-
style={[styles.channelTitle, { color: black }, channelTitle]}
40-
testID='empty-channel-state-title'
41-
>
42-
{t("Let's start chatting!")}
43-
</Text>
44-
<Text
45-
style={[styles.channelDetails, { color: grey, width: vw(66) }, channelDetails]}
46-
testID='empty-channel-state-details'
47-
>
48-
{t('How about sending your first message to a friend?')}
27+
<MessageBubbleEmpty height={27} stroke={semantics.textTertiary} width={25} />
28+
<Text style={[styles.channelTitle, channelTitle]} testID='empty-channel-state-title'>
29+
{t('No conversations yet')}
4930
</Text>
5031
</View>
5132
);
5233
case 'message':
5334
return (
5435
<View style={[styles.container, messageContainer]}>
55-
<ChatIcon height={width} pathFill={grey_gainsboro} width={width} />
56-
<Text style={[styles.messageTitle, { color: grey_gainsboro }, messageTitle]}>
57-
{t('No chats here yet…')}
58-
</Text>
36+
<MessageBubbleEmpty height={27} stroke={semantics.textTertiary} width={25} />
37+
<Text style={[styles.messageTitle, messageTitle]}>{t('No chats here yet…')}</Text>
5938
</View>
6039
);
6140
case 'threads':
6241
return (
63-
<View style={[styles.container]}>
42+
<View style={styles.container}>
6443
<MessageBubbleEmpty height={27} stroke={semantics.textTertiary} width={25} />
6544
<Text style={styles.threadText}>{t('Reply to a message to start a thread')}</Text>
6645
</View>
6746
);
6847
default:
69-
return <Text style={[{ color: black }, messageContainer]}>No items exist</Text>;
48+
return (
49+
<Text style={[{ color: semantics.textSecondary }, messageContainer]}>No items exist</Text>
50+
);
7051
}
7152
};
7253

@@ -82,9 +63,12 @@ const useStyles = () => {
8263
textAlign: 'center',
8364
},
8465
channelTitle: {
85-
fontSize: 16,
86-
paddingBottom: 8,
87-
paddingTop: 16,
66+
color: semantics.textSecondary,
67+
fontSize: primitives.typographyFontSizeMd,
68+
fontWeight: primitives.typographyFontWeightRegular,
69+
lineHeight: primitives.typographyLineHeightNormal,
70+
textAlign: 'center',
71+
paddingVertical: primitives.spacingSm,
8872
},
8973
container: {
9074
alignItems: 'center',
@@ -97,7 +81,7 @@ const useStyles = () => {
9781
paddingBottom: 8,
9882
},
9983
threadText: {
100-
color: semantics.textTertiary,
84+
color: semantics.textSecondary,
10185
fontSize: primitives.typographyFontSizeMd,
10286
fontWeight: primitives.typographyFontWeightRegular,
10387
lineHeight: primitives.typographyLineHeightNormal,

package/src/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "Poll has ended",
181181
"Reply to a message to start a thread": "Reply to a message to start a thread",
182182
"Couldn't load new threads. Tap to retry": "Couldn't load new threads. Tap to retry",
183-
"{{count}} new threads": "{{count}} new threads"
183+
"{{count}} new threads": "{{count}} new threads",
184+
"No conversations yet": "No conversations yet"
184185
}

package/src/i18n/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "Votación finalizada",
181181
"Reply to a message to start a thread": "Responde a un mensaje para empezar un hilo",
182182
"Couldn't load new threads. Tap to retry": "No se pudieron cargar nuevos hilos. Toca para reintentar",
183-
"{{count}} new threads": "{{count}} nuevos hilos"
183+
"{{count}} new threads": "{{count}} nuevos hilos",
184+
"No conversations yet": "No hay conversaciones todavía"
184185
}

package/src/i18n/fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "Vote terminé",
181181
"Reply to a message to start a thread": "Répondre à un message pour commencer un fil",
182182
"Couldn't load new threads. Tap to retry": "Impossible de charger les nouveaux fils. Appuyez pour réessayer",
183-
"{{count}} new threads": "{{count}} nouveaux fils"
183+
"{{count}} new threads": "{{count}} nouveaux fils",
184+
"No conversations yet": "Aucune conversation pour le moment"
184185
}

package/src/i18n/he.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "ההצבעה הסתיימה",
181181
"Reply to a message to start a thread": "השב/י להודעה כדי להתחיל שרשור",
182182
"Couldn't load new threads. Tap to retry": "לא ניתן לטעון שרשורים חדשים. הקש כדי לנסות שוב",
183-
"{{count}} new threads": "{{count}} שרשורים חדשים"
183+
"{{count}} new threads": "{{count}} שרשורים חדשים",
184+
"No conversations yet": "אין שיחות עדיין"
184185
}

package/src/i18n/hi.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "वोट समाप्त",
181181
"Reply to a message to start a thread": "एक संदेश का जवाब देकर थ्रेड शुरू करें",
182182
"Couldn't load new threads. Tap to retry": "नये थ्रेड्स लोड नहीं हो सके। टैप करके पुनः कोशिश करें",
183-
"{{count}} new threads": "{{count}} नये थ्रेड्स"
183+
"{{count}} new threads": "{{count}} नये थ्रेड्स",
184+
"No conversations yet": "अभी तक कोई चैट नहीं है"
184185
}

package/src/i18n/it.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "Votazione terminata",
181181
"Reply to a message to start a thread": "Rispondi a un messaggio per iniziare un thread",
182182
"Couldn't load new threads. Tap to retry": "Impossibile caricare nuovi thread. Tocca per riprovare",
183-
"{{count}} new threads": "{{count}} nuovi thread"
183+
"{{count}} new threads": "{{count}} nuovi thread",
184+
"No conversations yet": "Ancora nessuna conversazione"
184185
}

package/src/i18n/ja.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "投票終了",
181181
"Reply to a message to start a thread": "メッセージに返信してスレッドを開始",
182182
"Couldn't load new threads. Tap to retry": "新しいスレッドを読み込めませんでした。タップして再試行",
183-
"{{count}} new threads": "{{count}} 新しいスレッド"
183+
"{{count}} new threads": "{{count}} 新しいスレッド",
184+
"No conversations yet": "まだ会話がありません"
184185
}

package/src/i18n/ko.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "투표 종료됨",
181181
"Reply to a message to start a thread": "메시지에 답장하여 스레드 시작",
182182
"Couldn't load new threads. Tap to retry": "새로운 스레드를 로드할 수 없습니다. 탭하여 다시 시도",
183-
"{{count}} new threads": "{{count}} 새로운 스레드"
183+
"{{count}} new threads": "{{count}} 새로운 스레드",
184+
"No conversations yet": "아직 대화가 없습니다"
184185
}

package/src/i18n/nl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@
180180
"Poll has ended": "Stemmen beëindigd",
181181
"Reply to a message to start a thread": "Antwoord op een bericht om een thread te starten",
182182
"Couldn't load new threads. Tap to retry": "Kan nieuwe threads niet laden. Tik om opnieuw te proberen",
183-
"{{count}} new threads": "{{count}} nieuwe threads"
183+
"{{count}} new threads": "{{count}} nieuwe threads",
184+
"No conversations yet": "Nog geen gesprekken"
184185
}

0 commit comments

Comments
 (0)