this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Assorted clipclop fixes (#3853)

* empty state for new chat dialog

* use terniary

* dark mode pending state

* copy message text option

* fix service url input (scrollview ftw)

* whoops, fix equality

* slightly reduce horizontal message padding

authored by

Samuel Newman and committed by
GitHub
c223bcda feff55a1

+67 -23
+7 -2
src/components/dms/MessageItem.tsx
··· 62 62 lastInGroupRef.current = isLastInGroup 63 63 } 64 64 65 + const pendingColor = 66 + t.name === 'light' ? t.palette.primary_200 : t.palette.primary_800 67 + 65 68 return ( 66 69 <View> 67 70 <ActionsWrapper isFromSelf={isFromSelf} message={item}> 68 71 <View 69 72 style={[ 70 73 a.py_sm, 71 - a.px_lg, 72 74 a.my_2xs, 73 75 a.rounded_md, 74 76 { 77 + paddingLeft: 14, 78 + paddingRight: 14, 75 79 backgroundColor: isFromSelf 76 80 ? pending 77 - ? t.palette.primary_200 81 + ? pendingColor 78 82 : t.palette.primary_500 79 83 : t.palette.contrast_50, 80 84 borderRadius: 17, ··· 88 92 a.text_md, 89 93 a.leading_snug, 90 94 isFromSelf && {color: t.palette.white}, 95 + pending && t.name !== 'light' && {color: t.palette.primary_300}, 91 96 ]}> 92 97 {item.text} 93 98 </Text>
+23 -2
src/components/dms/MessageMenu.tsx
··· 1 1 import React from 'react' 2 2 import {Pressable, View} from 'react-native' 3 + import * as Clipboard from 'expo-clipboard' 3 4 import {ChatBskyConvoDefs} from '@atproto-labs/api' 4 5 import {msg} from '@lingui/macro' 5 6 import {useLingui} from '@lingui/react' 6 7 7 8 import {useSession} from 'state/session' 9 + import * as Toast from '#/view/com/util/Toast' 8 10 import {atoms as a, useTheme} from '#/alf' 9 11 import {DotGrid_Stroke2_Corner0_Rounded as DotsHorizontal} from '#/components/icons/DotGrid' 10 12 import {Trash_Stroke2_Corner0_Rounded as Trash} from '#/components/icons/Trash' ··· 12 14 import * as Menu from '#/components/Menu' 13 15 import * as Prompt from '#/components/Prompt' 14 16 import {usePromptControl} from '#/components/Prompt' 17 + import {Clipboard_Stroke2_Corner2_Rounded as ClipboardIcon} from '../icons/Clipboard' 15 18 16 19 export let MessageMenu = ({ 17 20 message, ··· 32 35 33 36 const isFromSelf = message.sender?.did === currentAccount?.did 34 37 38 + const onCopyPostText = React.useCallback(() => { 39 + // use when we have rich text 40 + // const str = richTextToString(richText, true) 41 + 42 + Clipboard.setStringAsync(message.text) 43 + Toast.show(_(msg`Copied to clipboard`)) 44 + }, [_, message.text]) 45 + 35 46 const onDelete = React.useCallback(() => { 36 47 // TODO delete the message 37 48 }, []) ··· 64 75 <Menu.Outer> 65 76 <Menu.Group> 66 77 <Menu.Item 78 + testID="messageDropdownCopyBtn" 79 + label={_(msg`Copy message text`)} 80 + onPress={onCopyPostText}> 81 + <Menu.ItemText>{_(msg`Copy message text`)}</Menu.ItemText> 82 + <Menu.ItemIcon icon={ClipboardIcon} position="right" /> 83 + </Menu.Item> 84 + </Menu.Group> 85 + <Menu.Divider /> 86 + <Menu.Group> 87 + <Menu.Item 67 88 testID="messageDropdownDeleteBtn" 68 - label={_(msg`Delete message`)} 89 + label={_(msg`Delete message for me`)} 69 90 onPress={deleteControl.open}> 70 - <Menu.ItemText>{_(msg`Delete`)}</Menu.ItemText> 91 + <Menu.ItemText>{_(msg`Delete for me`)}</Menu.ItemText> 71 92 <Menu.ItemIcon icon={Trash} position="right" /> 72 93 </Menu.Item> 73 94 {!isFromSelf && (
+32 -15
src/components/dms/NewChat.tsx
··· 20 20 import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2' 21 21 import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' 22 22 import {Button} from '../Button' 23 + import {Envelope_Stroke2_Corner0_Rounded as Envelope} from '../icons/Envelope' 23 24 import {ListMaybePlaceholder} from '../Lists' 24 25 import {Text} from '../Typography' 25 26 ··· 178 179 </Text> 179 180 <TextField.Root> 180 181 <TextField.Icon icon={Search} /> 181 - <TextField.Input 182 + <Dialog.Input 182 183 label={_(msg`Search profiles`)} 183 184 placeholder={_(msg`Search`)} 184 185 value={searchText} ··· 197 198 autoCorrect={false} 198 199 autoComplete="off" 199 200 autoCapitalize="none" 201 + autoFocus 200 202 /> 201 203 </TextField.Root> 202 204 </View> ··· 211 213 ListHeaderComponent={ 212 214 <> 213 215 {listHeader} 214 - {searchText.length > 0 && !actorAutocompleteData?.length && ( 215 - <ListMaybePlaceholder 216 - isLoading={isFetching} 217 - isError={isError} 218 - onRetry={refetch} 219 - hideBackButton={true} 220 - emptyType="results" 221 - sideBorders={false} 222 - emptyMessage={ 223 - isError 224 - ? _(msg`No search results found for "${searchText}".`) 225 - : _(msg`Could not load profiles. Please try again later.`) 226 - } 227 - /> 216 + {searchText.length === 0 ? ( 217 + <View style={[a.pt_4xl, a.align_center, a.px_lg]}> 218 + <Envelope width={64} fill={t.palette.contrast_200} /> 219 + <Text 220 + style={[ 221 + a.text_lg, 222 + a.text_center, 223 + a.mt_md, 224 + t.atoms.text_contrast_low, 225 + ]}> 226 + <Trans>Search for someone to start a conversation with.</Trans> 227 + </Text> 228 + </View> 229 + ) : ( 230 + !actorAutocompleteData?.length && ( 231 + <ListMaybePlaceholder 232 + isLoading={isFetching} 233 + isError={isError} 234 + onRetry={refetch} 235 + hideBackButton={true} 236 + emptyType="results" 237 + sideBorders={false} 238 + emptyMessage={ 239 + isError 240 + ? _(msg`No search results found for "${searchText}".`) 241 + : _(msg`Could not load profiles. Please try again later.`) 242 + } 243 + /> 244 + ) 228 245 )} 229 246 </> 230 247 }
+3 -2
src/screens/Messages/List/index.tsx
··· 21 21 import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' 22 22 import {ViewHeader} from '#/view/com/util/ViewHeader' 23 23 import {CenteredView} from '#/view/com/util/Views' 24 + import {ScrollView} from '#/view/com/util/Views' 24 25 import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' 25 26 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 26 27 import {DialogControlProps, useDialogControl} from '#/components/Dialog' ··· 130 131 131 132 if (!hasValidServiceUrl) { 132 133 return ( 133 - <CenteredView sideBorders style={[a.flex_1, a.p_md]}> 134 + <ScrollView contentContainerStyle={a.p_lg}> 134 135 <View> 135 136 <TextField.LabelText>Service URL</TextField.LabelText> 136 137 <TextField.Root> ··· 143 144 /> 144 145 </TextField.Root> 145 146 </View> 146 - </CenteredView> 147 + </ScrollView> 147 148 ) 148 149 } 149 150
+2 -2
src/view/com/util/forms/PostDropdownBtn.tsx
··· 1 1 import React, {memo} from 'react' 2 2 import {Pressable, PressableProps, StyleProp, ViewStyle} from 'react-native' 3 - import {setStringAsync} from 'expo-clipboard' 3 + import * as Clipboard from 'expo-clipboard' 4 4 import { 5 5 AppBskyActorDefs, 6 6 AppBskyFeedPost, ··· 160 160 const onCopyPostText = React.useCallback(() => { 161 161 const str = richTextToString(richText, true) 162 162 163 - setStringAsync(str) 163 + Clipboard.setStringAsync(str) 164 164 Toast.show(_(msg`Copied to clipboard`)) 165 165 }, [_, richText]) 166 166