Skip to content

Commit

Permalink
Merge pull request #146 from AmityCo/native-sprint
Browse files Browse the repository at this point in the history
Release/v4.0.0-beta-13
  • Loading branch information
ptchayap authored Sep 2, 2024
2 parents 84d6a9b + 63d6c85 commit d0ab912
Show file tree
Hide file tree
Showing 53 changed files with 1,029 additions and 143 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- amity-react-native-social-ui-kit (4.0.0-beta-12):
- amity-react-native-social-ui-kit (4.0.0-beta-13):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- ApiVideoLiveStream (1.4.1):
Expand Down Expand Up @@ -877,7 +877,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
amity-react-native-social-ui-kit: e685072006cde4bc623ea03ae77896ac5f1a0355
amity-react-native-social-ui-kit: fb1f7b715ce5649d0389b5000c2e03aa13c565d0
ApiVideoLiveStream: 8f9dce7f6d15d5e4bb3c7a25e406bf2a36337a5a
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amity-react-native-social-ui-kit",
"version": "4.0.0-beta-12",
"version": "4.0.0-beta-13",
"description": "Social UIKit",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -209,7 +209,7 @@
]
},
"dependencies": {
"@amityco/ts-sdk-react-native": "^6.25.0",
"@amityco/ts-sdk-react-native": "^6.30.0",
"@amityco/video-broadcaster-react-native": "^1.0.0",
"@amityco/video-player-react-native": "^1.0.0",
"@devvie/bottom-sheet": "^0.3.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/Social/PendingPostList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface IPost {
mentionees: string[];
mentionPosition?: IMentionPosition[];
path: string;
analytics: Amity.Post<'analytics'>;
}
export interface IPendingPostList {
onAcceptDecline?: (postId: string) => void;
Expand Down
1 change: 1 addition & 0 deletions src/components/Social/PostList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface IPost {
mentionees: string[];
mentionPosition?: IMentionPosition[];
path: string;
analytics: Amity.Post<'analytics'>;
}
export interface IPostList {
onDelete?: (postId: string) => void;
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const Permissions = Object.freeze({
ManageStoryPermission: 'MANAGE_COMMUNITY_STORY',
});
export const text_contain_blocked_word = 'Text contain blocked word';

export const comment_contains_inapproproate_word =
'Your comment contains inappropriate word. Please review and delete it.';
export const ALLOWED_MEDIA_TYPE = {
image: ['jpg', 'jpeg', 'png'],
video: ['mp4', 'mov'],
Expand Down
30 changes: 29 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ import {
AmityPostContentComponent,
AmityPostDetailPage,
AmityPostTargetSelectionPageType,
AmityCreatePostMenuComponent,
AmityDetailedMediaAttachmentComponent,
AmityMediaAttachmentComponent,
AmityPostCommentComponent,
AmityPostComposerPage,
AmityPostEngagementActionsComponent,
AmityPostTargetSelectionPage,
AmityReactionListComponent,
AmityStoryTargetSelectionPage,
AmityUserSearchResultComponent,
AmityMyCommunitiesSearchPage,
} from './v4';
import { AmityStoryTabComponentEnum } from './v4/PublicApi/types';
import {
AmityStoryTabComponentEnum,
AmityPostComposerMode,
mediaAttachment,
} from './v4/PublicApi/types';

const LINKING_ERROR =
`The package 'amity-react-native-social-ui-kit' doesn't seem to be linked. Make sure: \n\n` +
Expand Down Expand Up @@ -61,4 +76,17 @@ export {
AmityPostContentComponent,
AmityPostDetailPage,
AmityPostTargetSelectionPageType,
AmityCreatePostMenuComponent,
AmityDetailedMediaAttachmentComponent,
AmityMediaAttachmentComponent,
AmityPostCommentComponent,
AmityPostComposerPage,
AmityPostEngagementActionsComponent,
AmityPostTargetSelectionPage,
AmityReactionListComponent,
AmityStoryTargetSelectionPage,
AmityUserSearchResultComponent,
AmityMyCommunitiesSearchPage,
AmityPostComposerMode,
mediaAttachment,
};
17 changes: 0 additions & 17 deletions src/providers/Social/comment-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import {
ReactionRepository,
} from '@amityco/ts-sdk-react-native';
import { IMentionPosition } from '../../screens/CreatePost';
import { Alert } from 'react-native';
import { text_contain_blocked_word } from '../../constants';

export interface ICommentRes {
data: Amity.Comment[];
Expand Down Expand Up @@ -81,9 +79,6 @@ export async function createComment(
);
resolve(comment);
} catch (error) {
if (error.message.includes(text_contain_blocked_word)) {
Alert.alert('', text_contain_blocked_word);
}
reject(error);
}
}
Expand Down Expand Up @@ -120,9 +115,6 @@ export async function createReplyComment(
);
resolve(comment);
} catch (error) {
if (error.message.includes(text_contain_blocked_word)) {
Alert.alert('', text_contain_blocked_word);
}
reject(error);
}
}
Expand Down Expand Up @@ -155,9 +147,6 @@ export async function editComment(
);
resolve(comment);
} catch (error) {
if (error.message.includes(text_contain_blocked_word)) {
Alert.alert('', text_contain_blocked_word);
}
reject(error);
}
}
Expand All @@ -173,9 +162,6 @@ export async function getCommentsDataByIds(
const { data } = await CommentRepository.getCommentByIds(commentIds);
resolve(data);
} catch (error) {
if (error.message.includes(text_contain_blocked_word)) {
Alert.alert('', text_contain_blocked_word);
}
reject(error);
}
}
Expand All @@ -194,9 +180,6 @@ export async function deleteCommentById(commentId: string): Promise<boolean> {
resolve(true);
}
} catch (error) {
if (error.message.includes(text_contain_blocked_word)) {
Alert.alert('', text_contain_blocked_word);
}
reject(error);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/providers/Social/feed-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export async function getGlobalFeed(
const { data, nextPage, prevPage } =
await FeedRepository.getCustomRankingGlobalFeed({
page,
limit: 20,
});
resolve({ data, nextPage, prevPage });
} catch (error) {
Expand Down
4 changes: 1 addition & 3 deletions src/redux/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export const store: Store = configureStore({
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: {
ignoredPaths: ['globalFeed'],
},
serializableCheck: false,
}),
});

Expand Down
28 changes: 28 additions & 0 deletions src/snippet/AmityCommunitySearchResultComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* begin_sample_code
gist_id: 1c885a98ffdc94f5f3336e477ffce9d6
filename: AmityCommunitySearchResultComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityCommunitySearchResultComponent
*/
import {
AmityCommunitySearchResultComponent,
AmityUiKitProvider,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
import { TabName } from '../v4/enum';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
>
<AmityCommunitySearchResultComponent
searchResult={[{}] as (Amity.Community & Amity.User)[]}
onNextPage={() => {}}
searchType={TabName.Communities}
/>
</AmityUiKitProvider>;
/* end_sample_code */
29 changes: 29 additions & 0 deletions src/snippet/AmityCreatePostMenuComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* begin_sample_code
gist_id: a5976a141516a6fe6e561344a8656286
filename: AmityCreatePostMenuComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityCreatePostMenuComponent
*/
import {
AmityCreatePostMenuComponent,
AmityUiKitProvider,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
behaviour={{
AmityCreatePostMenuComponentBehavior: {
goToSelectStoryTargetPage: () => {},
goToSelectPostTargetPage: ({ postType }) => console.log(postType),
},
}}
>
<AmityCreatePostMenuComponent />
</AmityUiKitProvider>;
/* end_sample_code */
29 changes: 29 additions & 0 deletions src/snippet/AmityDetailedMediaAttachmentComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* begin_sample_code
gist_id: 193a12ef8f7aea1032e8884898ed2193
filename: AmityDetailedMediaAttachmentComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityDetailedMediaAttachmentComponent
*/
import {
AmityDetailedMediaAttachmentComponent,
AmityUiKitProvider,
mediaAttachment,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
>
<AmityDetailedMediaAttachmentComponent
onPressCamera={() => {}}
onPressImage={() => {}}
onPressVideo={() => {}}
chosenMediaType={mediaAttachment.image}
/>
</AmityUiKitProvider>;
/* end_sample_code */
23 changes: 23 additions & 0 deletions src/snippet/AmityEmptyNewsFeedComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* begin_sample_code
gist_id: 176852a181d7574c61a8d5260e7e8810
filename: AmityEmptyNewsFeedComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityEmptyNewsFeedComponent
*/
import {
AmityEmptyNewsFeedComponent,
AmityUiKitProvider,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
>
<AmityEmptyNewsFeedComponent />
</AmityUiKitProvider>;
/* end_sample_code */
30 changes: 30 additions & 0 deletions src/snippet/AmityGlobalFeedComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* begin_sample_code
gist_id: 3ec04da66a931c826f471ef50a90c7b9
filename: AmityGlobalFeedComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityGlobalFeedComponent
*/
import {
AmityGlobalFeedComponent,
AmityUiKitProvider,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
behaviour={{
AmityGlobalFeedComponentBehavior: {
goToPostDetailPage: (postId: string) => {
console.log(postId);
},
},
}}
>
<AmityGlobalFeedComponent />
</AmityUiKitProvider>;
/* end_sample_code */
29 changes: 29 additions & 0 deletions src/snippet/AmityMediaAttachmentComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* begin_sample_code
gist_id: 60de42520b795efd3bd1ec26672e27c4
filename: AmityMediaAttachmentComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityMediaAttachmentComponent
*/
import {
AmityMediaAttachmentComponent,
AmityUiKitProvider,
mediaAttachment,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
>
<AmityMediaAttachmentComponent
onPressCamera={() => {}}
onPressImage={() => {}}
onPressVideo={() => {}}
chosenMediaType={mediaAttachment.image}
/>
</AmityUiKitProvider>;
/* end_sample_code */
30 changes: 30 additions & 0 deletions src/snippet/AmityMyCommunitiesComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* begin_sample_code
gist_id: 106d5ba6c2ce0a1125a4d7fd9019489f
filename: AmityMyCommunitiesComponent.tsx
asc_page: https://docs.amity.co/amity-uikit/uikit-v4-beta
description: AmityMyCommunitiesComponent
*/
import {
AmityMyCommunitiesComponent,
AmityUiKitProvider,
} from 'amity-react-native-social-ui-kit';
import React from 'react';
import config from '../../uikit.config.json';
<AmityUiKitProvider
configs={config} //put your customized config json object
apiKey="API_KEY"
apiRegion="API_REGION"
userId="userId"
displayName="displayName"
apiEndpoint="https://api.{API_REGION}.amity.co"
behaviour={{
AmityMyCommunitiesComponentBehaviour: {
onPressCommunity: ({ communityId, communityName }) => {
console.log(communityId, communityName);
},
},
}}
>
<AmityMyCommunitiesComponent />
</AmityUiKitProvider>;
/* end_sample_code */
Loading

0 comments on commit d0ab912

Please sign in to comment.