Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Fixed lint
  • Loading branch information
Alex Risch authored and Alex Risch committed May 31, 2024
1 parent 955cbb8 commit b923392
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 112 deletions.
105 changes: 3 additions & 102 deletions src/components/ConversationListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ export interface ConversationListHeaderProps {
onShowMessageRequests: () => void;
}

export const ConversationListHeader: FC<ConversationListHeaderProps> = ({
list,
showPickerModal,
messageRequestCount,
onShowMessageRequests,
}) => {
export const ConversationListHeader: FC<ConversationListHeaderProps> = () => {
const {navigate} = useTypedNavigation();
const {address} = useAddress();
const {avatarUrl} = useContactInfo(address);
Expand All @@ -34,11 +29,6 @@ export const ConversationListHeader: FC<ConversationListHeaderProps> = ({
const handleAccountPress = useCallback(() => {
navigate(ScreenNames.Account);
}, [navigate]);
const navigateToDev = useCallback(() => {
if (__DEV__) {
navigate(ScreenNames.Dev);
}
}, [navigate]);
return (
<VStack marginTop={'4px'}>
<HStack
Expand All @@ -54,104 +44,15 @@ export const ConversationListHeader: FC<ConversationListHeaderProps> = ({
size={40}
/>
</Pressable>
{/* <Box
borderRadius={'24px'}
paddingX={'16px'}
paddingY={'8px'}
backgroundColor={'white'}
>
<Box>
<Button
onLongPress={navigateToDev}
_pressed={{backgroundColor: 'transparent'}}
size={'sm'}
variant={'ghost'}
leftIcon={
<Icon
name="chat-bubble-oval-left"
size={16}
type="mini"
color="#0F172A"
/>
}
rightIcon={
<Icon
name="chevron-down-thick"
size={16}
type="mini"
color="#0F172A"
/>
}
onPress={showPickerModal}>
<Text typography="text-sm/heavy">
{list === 'ALL_MESSAGES'
? translate('all_messages')
: translate('message_requests')}
</Text>
</Button>
</Box> }
</Box> */}
<Text typography="text-lg/heavy" textAlign={'center'}>
{translate('group_chats')}
</Text>
<Box>
<Pressable onPress={handleNewMessagePress}>
<Icon
name="plus-circle"
size={40}
color={"#4F46E5"}
/>
<Icon name="plus-circle" size={40} color={'#4F46E5'} />
</Pressable>
</Box>
</HStack>
{/* {
list === 'MESSAGE_REQUESTS' ? (
<Box
backgroundColor={colors.actionAlertBG}
paddingY={'8px'}
paddingX={'16px'}>
<Text
typography="text-caption/regular"
textAlign={'center'}
color={colors.actionAlertText}>
{translate('message_requests_from_new_addresses')}
</Text>
</Box>
) : messageRequestCount > 0 ? (
<Pressable onPress={onShowMessageRequests}>
<HStack
backgroundColor={colors.actionPrimary}
padding={'8px'}
borderRadius={'8px'}
alignItems={'center'}
marginX={'16px'}>
<Box paddingLeft={'8px'} paddingRight={'16px'}>
<Icon name="inbox-arrow-down" color={colors.actionPrimaryText} />
</Box>
<Text
flex={1}
color={colors.actionPrimaryText}
typography="text-xs/bold">
{translate('message_requests_count', {
count: String(messageRequestCount),
})}
</Text>
<Box
paddingLeft={'8px'}
paddingRight={'16px'}
justifyContent={'flex-end'}>
<Icon
name="chevron-right-thick"
size={16}
color={colors.actionPrimaryText}
/>
</Box>
</HStack>
</Pressable>
) : (
<Box />
)
} */}
</VStack >
</VStack>
);
};
8 changes: 0 additions & 8 deletions src/screens/ConversationListScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {useIsFocused} from '@react-navigation/native';
import {Group} from '@xmtp/react-native-sdk';
import {Box, Center, FlatList, HStack, VStack} from 'native-base';
import React, {useCallback, useMemo, useState} from 'react';
Expand All @@ -14,9 +13,7 @@ import {AppConfig} from '../consts/AppConfig';
import {SupportedContentTypes} from '../consts/ContentTypes';
import {TestIds} from '../consts/TestIds';
import {useClient} from '../hooks/useClient';
import {useTypedNavigation} from '../hooks/useTypedNavigation';
import {translate} from '../i18n';
import {ScreenNames} from '../navigation/ScreenNames';
import {useListQuery} from '../queries/useListQuery';
import {mmkvStorage} from '../services/mmkvStorage';
import {colors} from '../theme/colors';
Expand Down Expand Up @@ -74,7 +71,6 @@ export const ConversationListScreen = () => {
);
const [showPickerModal, setShowPickerModal] = useState(false);
const [showConsentDrawer, setShowConsentDrawer] = useState(false);
const focused = useIsFocused();
const {
messages,
messageRequests,
Expand All @@ -83,14 +79,10 @@ export const ConversationListScreen = () => {
refetch,
isRefetching,
} = useData();
const {navigate} = useTypedNavigation();

const showPicker = () => {
setShowPickerModal(true);
};
const handleNewMessagePress = useCallback(() => {
navigate(ScreenNames.Search);
}, [navigate]);

const handleFilterPress = useCallback(
(type: 'ALL_MESSAGES' | 'MESSAGE_REQUESTS') => {
Expand Down
8 changes: 6 additions & 2 deletions src/screens/DevScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const RequestItem: FC<RequestItemProps> = ({title, request}) => {
return JSON.stringify(data, (key, value) => {
if (typeof value === 'object' && value !== null) {
// Duplicate reference found, discard key
if (cache.includes(value)) return;
if (cache.includes(value)) {
return;
}

// Store value in our collection
cache.push(value);
Expand Down Expand Up @@ -73,7 +75,9 @@ const DataItem: FC<DataItemProps> = ({title, data}) => {
return JSON.stringify(data, (key, value) => {
if (typeof value === 'object' && value !== null) {
// Duplicate reference found, discard key
if (cache.includes(value)) return;
if (cache.includes(value)) {
return;
}

// Store value in our collection
cache.push(value);
Expand Down

0 comments on commit b923392

Please sign in to comment.