Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import unusedImports from 'eslint-plugin-unused-imports';
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{
ignores: ['**/node_modules/**', '**/build/**', '**/dist/**'],
ignores: ['**/node_modules/**', '**/build/**', '**/dist/**', '**/.next/**'],
},
{ languageOptions: { globals: globals.node } },
{ languageOptions: { globals: globals.browser } },
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"build:react-sdk": "yarn workspace @stream-io/feeds-react-native-sdk run build",
"build:react-tutorial": "yarn build:client && yarn build:react-sdk && yarn workspace stream-feeds-react-tutorial run build",
"clean:all": "yarn workspaces foreach -vt run clean",
"lint:all": "eslint --max-warnings=0 --cache 'packages/**/*.{ts,tsx}'",
"lint:all:fix": "eslint --max-warnings=0 'packages/**/*.{ts,tsx}' --fix",
"lint:all": "eslint --max-warnings=0 --cache '**/*.{ts,tsx}'",
"lint:all:fix": "eslint --max-warnings=0 '**/*.{ts,tsx}' --fix",
"test:ci:all": "yarn workspaces foreach -vt run test-ci",
"test:ci:libs": "yarn workspaces foreach -vt --no-private run test-ci",
"test:docs-snippets": "yarn workspaces foreach -vt --no-private run test-docs-snippets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { useCallback } from 'react';

const stableEmptyArray: readonly FeedOwnCapability[] = [];

export const useOwnCapabilities = (feedFromProps?: Feed) => {
export const useOwnCapabilities = (feedFromProps?: Feed | string) => {
const client = useFeedsClient();
const feedFromContext = useFeedContext();
const feed = feedFromProps ?? feedFromContext;
const fid = feed?.feed;
const fid = typeof feed === 'string' ? feed : feed?.feed;

const selector = useCallback(
(currentState: FeedsClientState) => {
Expand Down
3 changes: 2 additions & 1 deletion sample-apps/react-native/ExpoTikTokApp/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import 'react-native-reanimated';
import { StreamFeeds } from '@stream-io/feeds-react-native-sdk';
import LoginScreen from '@/components/LoginScreen';

import type {
LocalUser} from '@/contexts/UserContext';
import {
LocalUser,
UserContextProvider,
useUserContext,
} from '@/contexts/UserContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import React, { useCallback, useMemo, useState } from 'react';
import { View, ScrollView, Text, StyleSheet, Pressable } from 'react-native';

import * as ImagePicker from 'expo-image-picker';
import {
import type {
Attachment,
CreateFeedsBatchResponse,
StreamFile} from '@stream-io/feeds-react-native-sdk';
import {
isImageFile,
isVideoFile,
StreamFile,
useFeedContext,
useFeedsClient,
} from '@stream-io/feeds-react-native-sdk';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { useFeedActivities } from '@stream-io/feeds-react-native-sdk';
import React, { useEffect, useRef, useState } from 'react';
import { useStableCallback } from '@/hooks/useStableCallback';
import type {
NativeScrollEvent,
NativeSyntheticEvent} from 'react-native';
import {
Dimensions,
NativeScrollEvent,
NativeSyntheticEvent,
Platform,
} from 'react-native';
import { FlashList, FlashListRef } from '@shopify/flash-list';
import type { FlashListRef } from '@shopify/flash-list';
import { FlashList } from '@shopify/flash-list';
import type { ActivityResponse } from '@stream-io/feeds-react-native-sdk';
import { ActivityPagerContextProvider } from '@/contexts/ActivityPagerContext';
import { PagerItem } from '@/components/activity-pager/PagerItem';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Platform, TouchableOpacity } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { useStableCallback } from '@/hooks/useStableCallback';
import { openSheetWith } from '@/store/bottom-sheet-state-store';
import { ActivityResponse } from '@stream-io/feeds-react-native-sdk';
import type { ActivityResponse } from '@stream-io/feeds-react-native-sdk';
import { useRouter } from 'expo-router';

export const ActivityAction = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { ActivityIndicator, FlatList, StyleSheet } from 'react-native';
import { Activity } from '@/components/activity-section-list/Activity';
import { useCallback } from 'react';
import { LoadingIndicator, ErrorIndicator } from '@/components/indicators';
import { useStableCallback } from '@/hooks/useStableCallback';
import { View } from '@/components/common/Themed';

const renderItem = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useMemo } from 'react';
import { Ionicons } from '@expo/vector-icons';
import type {
ActivityResponse} from '@stream-io/feeds-react-native-sdk';
import {
ActivityResponse,
useClientConnectedUser,
useFeedsClient,
} from '@stream-io/feeds-react-native-sdk';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React, { PropsWithChildren, useEffect, useMemo, useRef } from 'react';
import type { PropsWithChildren} from 'react';
import React, { useEffect, useMemo, useRef } from 'react';
import {
Dimensions,
StyleSheet,
View,
Pressable,
Platform,
} from 'react-native';
import type {
GestureType} from 'react-native-gesture-handler';
import {
Gesture,
GestureDetector,
GestureType,
GestureDetector
} from 'react-native-gesture-handler';
import Animated, {
useSharedValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useBottomSheetState } from '@/hooks/useBottomSheetState';
import { Alert } from 'react-native';
import type {
CommentResponse} from '@stream-io/feeds-react-native-sdk';
import {
CommentResponse,
useClientConnectedUser,
useFeedsClient,
} from '@stream-io/feeds-react-native-sdk';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ReactElement } from 'react';
import type { ReactElement } from 'react';
import { FlatList, Platform, StyleSheet, TouchableOpacity } from 'react-native';
import { Text } from '@/components/common/Themed';
import { StableCallback, useStableCallback } from '@/hooks/useStableCallback';
import type { StableCallback} from '@/hooks/useStableCallback';
import { useStableCallback } from '@/hooks/useStableCallback';
import { closeSheet, setHeight } from '@/store/bottom-sheet-state-store';

type ActionType = () => void | Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import Ionicons from '@expo/vector-icons/Ionicons';
import Colors from '@/constants/Colors';
import React from 'react';
import { useColorScheme } from 'react-native';
import { StableCallback, useStableCallback } from '@/hooks/useStableCallback';
import type { StableCallback} from '@/hooks/useStableCallback';
import { useStableCallback } from '@/hooks/useStableCallback';

type CallbackType = () => void | Promise<void>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useEffect, useRef, useState } from 'react';
import {
View,
StyleSheet,
TextInput,
Image,
KeyboardAvoidingView,
Platform,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Ionicons } from '@expo/vector-icons';
import { TouchableOpacity } from 'react-native';
import React from 'react';
import type {
ActivityResponse} from '@stream-io/feeds-react-native-sdk';
import {
ActivityResponse,
useFeedsClient,
} from '@stream-io/feeds-react-native-sdk';
import { useStableCallback } from '@/hooks/useStableCallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Text, StyleSheet, Pressable } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { Place } from '@/components/search/PlaceSearchDropdown';
import type { Place } from '@/components/search/PlaceSearchDropdown';
import { useRouter } from 'expo-router';
import { mapApiKey } from '@/constants/stream';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Ionicons } from '@expo/vector-icons';
import { Share, TouchableOpacity } from 'react-native';
import React from 'react';
import {
Attachment,
isImageFile,
isVideoFile,
} from '@stream-io/feeds-react-native-sdk';
import type {
Attachment} from '@stream-io/feeds-react-native-sdk';


import { useStableCallback } from '@/hooks/useStableCallback';

const pretext = 'Check out this cool';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import type {
NativeSyntheticEvent,
TextInputSelectionChangeEventData,
TextInputProps} from 'react-native';
import {
StyleSheet,
TextInput,
View,
NativeSyntheticEvent,
TextInputSelectionChangeEventData,
TextInputProps,
Platform,
} from 'react-native';
import { AutocompleteSearch } from '@/components/common/autocomplete-input/AutocompleteSearch';
Expand All @@ -14,8 +15,9 @@ import {
useSearchContext,
useSearchResult,
} from '@stream-io/feeds-react-native-sdk';
import type {
Suggestion} from '@/components/common/autocomplete-input/SuggestionsList';
import {
Suggestion,
SuggestionsList,
} from '@/components/common/autocomplete-input/SuggestionsList';
import { useStableCallback } from '@/hooks/useStableCallback';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
useFeedsClient,
UserSearchSource,
} from '@stream-io/feeds-react-native-sdk';
import { PropsWithChildren, useMemo } from 'react';
import type { PropsWithChildren} from 'react';
import { useMemo } from 'react';

export const AutocompleteSearch = ({ children }: PropsWithChildren) => {
const client = useFeedsClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
StreamSearchResults, useSearchContext,
useSearchSources,
} from '@stream-io/feeds-react-native-sdk';
import { PropsWithChildren, useEffect, useMemo } from 'react';
import type { PropsWithChildren} from 'react';
import { useEffect, useMemo } from 'react';

export const AutocompleteSearchResults = ({ children }: PropsWithChildren) => {
const searchController = useSearchContext();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Feed, User } from '@stream-io/feeds-react-native-sdk';
import type { Feed, User } from '@stream-io/feeds-react-native-sdk';
import { useSearchResultsContext } from '@stream-io/feeds-react-native-sdk';
import {
Image,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TextProps } from 'react-native';
import type { TextProps } from 'react-native';
import { useMemo } from 'react';
import { CommentParent } from '@stream-io/feeds-react-native-sdk';
import type { CommentParent } from '@stream-io/feeds-react-native-sdk';
import { TokenizedText } from '@/components/common/tokenized-text/TokenizedText';
import { useMentionAnnotations } from '@/components/common/tokenized-text/hooks/useMentionAnnotations';
import { useHashtagAnnotations } from '@/components/common/tokenized-text/hooks/useHashtagAnnotations';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TextProps } from 'react-native';
import type { TextProps } from 'react-native';
import { useMemo } from 'react';
import { CommentParent } from '@stream-io/feeds-react-native-sdk';
import type { CommentParent } from '@stream-io/feeds-react-native-sdk';
import { TokenizedText } from '@/components/common/tokenized-text/TokenizedText';
import { useMentionAnnotations } from '@/components/common/tokenized-text/hooks/useMentionAnnotations';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo } from 'react';
import { Text, TextProps } from 'react-native';
import type { TextProps } from 'react-native';
import { Text } from 'react-native';

export type TokenizerConfig = {
matching: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRouter } from 'expo-router';
import { useCallback, useMemo } from 'react';
import { useStableCallback } from '@/hooks/useStableCallback';
import { MentionPreview } from '@/components/mentions/MentionPreview';
import { CommentParent } from '@stream-io/feeds-react-native-sdk';
import type { CommentParent } from '@stream-io/feeds-react-native-sdk';

export const useMentionAnnotations = ({
entity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Feed, FollowResponse } from '@stream-io/feeds-react-native-sdk';
import type { Feed, FollowResponse } from '@stream-io/feeds-react-native-sdk';
import { useOwnFollows } from '@stream-io/feeds-react-native-sdk';
import React, { useMemo } from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useMemo } from 'react';
import type {
FollowResponse} from '@stream-io/feeds-react-native-sdk';
import {
FollowResponse,
useClientConnectedUser,
useFeedsClient,
useFollowers,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useMemo } from 'react';
import type {
FollowResponse} from '@stream-io/feeds-react-native-sdk';
import {
FollowResponse,
useClientConnectedUser,
useFeedsClient,
useFollowing,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { StreamFeed } from '@stream-io/feeds-react-native-sdk';
import { useLocalSearchParams } from 'expo-router';
import { useCreateAndQueryFeed } from '@/hooks/useCreateAndQueryFeed';
import { PropsWithChildren, useMemo } from 'react';
import type { PropsWithChildren} from 'react';
import { useMemo } from 'react';

export const FollowsWrapper = ({ groupId, children }: PropsWithChildren<{ groupId: string }>) => {
const { userId: userIdParam } = useLocalSearchParams();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useMemo, useState, useCallback } from 'react';
import { View, Text, Pressable, StyleSheet } from 'react-native';
import {
FeedState, useFeedActivities,
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import type {
FeedState} from '@stream-io/feeds-react-native-sdk';
import { useFeedActivities,
useFeedContext,
useStateStore,
} from '@stream-io/feeds-react-native-sdk';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AggregatedActivityResponse } from '@stream-io/feeds-react-native-sdk';
import type { AggregatedActivityResponse } from '@stream-io/feeds-react-native-sdk';

export const getNotificationText = (aggregatedActivity: AggregatedActivityResponse) => {
const { activities } = aggregatedActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
Feed} from '@stream-io/feeds-react-native-sdk';
import {
Feed,
useClientConnectedUser,
useFeedMetadata,
useSearchResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
import {
useSearchContext,
useSearchSources,
SearchSource,
} from '@stream-io/feeds-react-native-sdk';

const tabsNameMap = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Dimensions, Image, StyleSheet, TouchableOpacity } from 'react-native';
import { Text, View } from '@/components/common/Themed';
import React from 'react';
import {
import type {
Feed,
FeedState,
FeedState} from '@stream-io/feeds-react-native-sdk';
import {
useClientConnectedUser,
useFeedMetadata,
useStateStore,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createContext, PropsWithChildren, useContext, useMemo } from 'react';
import { Feed } from '@stream-io/feeds-react-native-sdk';
import type { PropsWithChildren} from 'react';
import { createContext, useContext, useMemo } from 'react';
import type { Feed } from '@stream-io/feeds-react-native-sdk';
import { useCreateAndQueryFeed } from '@/hooks/useCreateAndQueryFeed';
import { usePushNotifications } from '@/hooks/usePushNotifications';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type {
PropsWithChildren} from 'react';
import {
createContext,
PropsWithChildren,
useContext,
useMemo,
useState,
} from 'react';
import { Place } from '@/components/search/PlaceSearchDropdown';
import type { Place } from '@/components/search/PlaceSearchDropdown';
import type { Attachment } from '@stream-io/feeds-react-native-sdk';
import { useActivityActionState } from '@/hooks/useActivityActionState';

Expand Down
Loading
Loading