frontend client for gemstone. decentralised workplace app

refactor: chat windows styles

serenity 28e513c1 e7ffff0c

Changed files
+38 -34
src
components
Chat
Navigation
ChannelsPicker
+37 -34
src/components/Chat/index.tsx
···
import { Message } from "@/components/Chat/Message";
import { Loading } from "@/components/primitives/Loading";
import { Text } from "@/components/primitives/Text";
+
import { useFacet } from "@/lib/facet";
import { useChannel } from "@/lib/hooks/useChannel";
import type { AtUri } from "@/lib/types/atproto";
import { useProfile } from "@/providers/authed/ProfileProvider";
import { useCurrentPalette } from "@/providers/ThemeProvider";
+
import { ArrowUp } from "lucide-react-native";
import { useState } from "react";
import {
View,
TextInput,
TouchableOpacity,
-
ScrollView,
Image,
FlatList,
} from "react-native";
···
const { messages, sendMessageToChannel, isConnected } =
useChannel(channelAtUri);
const { semantic } = useCurrentPalette();
+
const { typography, atoms } = useFacet();
const handleSend = () => {
if (inputText.trim()) {
···
justifyContent: "space-between",
padding: 16,
borderBottomWidth: 1,
-
borderBottomColor: semantic.border,
+
borderBottomColor: semantic.borderVariant,
alignItems: "center",
}}
>
···
style={{
width: 32,
height: 32,
-
borderRadius: 2000000000,
+
borderRadius: atoms.radii.full,
}}
source={{ uri: profile.avatar }}
/>
···
style={{
padding: 16,
borderBottomWidth: 1,
-
borderBottomColor: semantic.border,
+
borderBottomColor: semantic.borderVariant,
}}
>
<Text
···
<FlatList
inverted
-
data={messages}
+
data={messages.toReversed()}
renderItem={({ item }) => <Message message={item} />}
-
keyExtractor={(item, index) => index.toString()}
+
keyExtractor={(_, index) => index.toString()}
contentContainerStyle={{
-
padding: 16,
+
paddingLeft: 20,
+
flex: 1,
+
gap: 2,
}}
-
style={{ flex: 1 }}
+
showsVerticalScrollIndicator={false}
/>
<View
style={{
flexDirection: "row",
padding: 16,
-
borderTopWidth: 1,
-
borderTopColor: semantic.border,
+
alignItems: "center",
}}
>
<TextInput
-
style={{
-
flex: 1,
-
borderWidth: 1,
-
borderColor: semantic.border,
-
borderRadius: 8,
-
paddingHorizontal: 12,
-
paddingVertical: 8,
-
marginRight: 8,
-
fontSize: 16,
-
color: semantic.text,
-
}}
+
style={[
+
{
+
flex: 1,
+
borderWidth: 1,
+
borderColor: semantic.border,
+
borderRadius: 8,
+
paddingHorizontal: 12,
+
paddingVertical: 10,
+
marginRight: 8,
+
color: semantic.text,
+
outline: "0",
+
},
+
typography.sizes.base,
+
]}
value={inputText}
onChangeText={setInputText}
placeholder="boop"
placeholderTextColor={semantic.textTertiary}
onSubmitEditing={handleSend}
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- can't get it working with the new prop.
+
blurOnSubmit={false}
/>
<TouchableOpacity
style={{
-
backgroundColor: semantic.primary,
-
paddingHorizontal: 20,
-
paddingVertical: 10,
-
borderRadius: 8,
+
backgroundColor: inputText.trim()
+
? semantic.primary
+
: semantic.border,
+
borderRadius: atoms.radii.full,
justifyContent: "center",
+
height: 36,
+
width: 36,
+
alignItems: "center",
}}
onPress={handleSend}
disabled={!isConnected}
>
-
<Text
-
style={{
-
color: semantic.textInverse,
-
fontSize: 16,
-
fontWeight: "600",
-
}}
-
>
-
Send
-
</Text>
+
<ArrowUp height={20} width={20} />
</TouchableOpacity>
</View>
</View>
+1
src/components/Navigation/ChannelsPicker/index.tsx
···
padding: 12,
paddingTop: 6,
borderTopRightRadius: atoms.radii.xl,
+
minWidth: 200,
}}
>
{spaces.map((space) => (