Skip to content

Commit

Permalink
Move mentionable hook to shared
Browse files Browse the repository at this point in the history
  • Loading branch information
jakzaizzat committed Oct 20, 2023
1 parent 6200ba8 commit 1a32c49
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Keyboard } from 'react-native';
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
import { graphql, useFragment, useLazyLoadQuery, usePaginationFragment } from 'react-relay';
import { useEventComment } from 'src/hooks/useEventComment';
import { useMentionableMessage } from 'src/hooks/useMentionableMessage';
import { usePostComment } from 'src/hooks/usePostComment';

import { CommentsBottomSheetList } from '~/components/Feed/CommentsBottomSheet/CommentsBottomSheetList';
Expand All @@ -31,6 +30,7 @@ import { CommentsBottomSheetConnectedCommentsListQuery } from '~/generated/Comme
import { CommentsBottomSheetConnectedPostCommentsListFragment$key } from '~/generated/CommentsBottomSheetConnectedPostCommentsListFragment.graphql';
import { CommentsBottomSheetConnectedPostCommentsListQuery } from '~/generated/CommentsBottomSheetConnectedPostCommentsListQuery.graphql';
import { CommentsBottomSheetQueryFragment$key } from '~/generated/CommentsBottomSheetQueryFragment.graphql';
import { useMentionableMessage } from '~/shared/hooks/useMentionableMessage';
import { removeNullValues } from '~/shared/relay/removeNullValues';
import { noop } from '~/shared/utils/noop';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useNavigation } from '@react-navigation/native';
import { useCallback } from 'react';
import { graphql, useFragment } from 'react-relay';
import { MentionType } from 'src/hooks/useMentionableMessage';

import { CommunityProfilePicture } from '~/components/ProfilePicture/CommunityProfilePicture';
import { CommunitySearchResultFragment$key } from '~/generated/CommunitySearchResultFragment.graphql';
import { MainTabStackNavigatorProp } from '~/navigation/types';
import { MentionType } from '~/shared/hooks/useMentionableMessage';

import { SearchResult } from '../SearchResult';

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/components/Search/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { FlashList, ListRenderItem } from '@shopify/flash-list';
import { useCallback, useDeferredValue, useMemo } from 'react';
import { View } from 'react-native';
import { graphql, useLazyLoadQuery } from 'react-relay';
import { MentionType } from 'src/hooks/useMentionableMessage';

import { CommunitySearchResultFragment$key } from '~/generated/CommunitySearchResultFragment.graphql';
import { GallerySearchResultFragment$key } from '~/generated/GallerySearchResultFragment.graphql';
import { SearchResultsQuery } from '~/generated/SearchResultsQuery.graphql';
import { UserSearchResultFragment$key } from '~/generated/UserSearchResultFragment.graphql';
import { MentionType } from '~/shared/hooks/useMentionableMessage';

import { Typography } from '../Typography';
import { CommunitySearchResult } from './Community/CommunitySearchResult';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useNavigation } from '@react-navigation/native';
import { useCallback } from 'react';
import { graphql, useFragment } from 'react-relay';
import { MentionType } from 'src/hooks/useMentionableMessage';

import { ProfilePicture } from '~/components/ProfilePicture/ProfilePicture';
import { UserSearchResultFragment$key } from '~/generated/UserSearchResultFragment.graphql';
import { MainTabStackNavigatorProp } from '~/navigation/types';
import { MentionType } from '~/shared/hooks/useMentionableMessage';

import { SearchResult } from '../SearchResult';

Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/screens/PostScreen/PostComposerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Suspense, useCallback, useRef, useState } from 'react';
import { Keyboard, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { graphql, useFragment, useLazyLoadQuery } from 'react-relay';
import { useMentionableMessage } from 'src/hooks/useMentionableMessage';

import { BackButton } from '~/components/BackButton';
import { GalleryBottomSheetModalType } from '~/components/GalleryBottomSheet/GalleryBottomSheetModal';
Expand All @@ -23,6 +22,7 @@ import {
PostStackNavigatorParamList,
} from '~/navigation/types';
import { contexts } from '~/shared/analytics/constants';
import { useMentionableMessage } from '~/shared/hooks/useMentionableMessage';
import { noop } from '~/shared/utils/noop';

import { PostComposerNftFallback } from './PostComposerNftFallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useCallback, useState } from 'react';
import { graphql, useFragment } from 'react-relay';
import isFeatureEnabled, { FeatureFlag } from 'src/utils/isFeatureEnabled';

import { useMentionableMessageQueryFragment$key } from '~/generated/useMentionableMessageQueryFragment.graphql';
import useDebounce from '~/shared/hooks/useDebounce';

import isFeatureEnabled, { FeatureFlag } from '../utils/isFeatureEnabled';
import useDebounce from './useDebounce';

type MentionDataType = {
interval: {
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/utils/isFeatureEnabled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
isFeatureEnabledFragment$key,
Role as RelayRole,
} from '~/generated/isFeatureEnabledFragment.graphql';
import { removeNullValues } from '~/relay/removeNullValues';

import { removeNullValues } from '../relay/removeNullValues';

export enum FeatureFlag {
KOALA = 'KOALA',
Expand Down

0 comments on commit 1a32c49

Please sign in to comment.