Skip to content

Commit

Permalink
Merge branch 'upstream/release/v4.0.0' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	.eslintignore
#	.github/workflows/dev.yaml
#	.github/workflows/production.yaml
#	.github/workflows/staging.yaml
#	.github/workflows/teardown.yaml
#	.github/workflows/testing.yaml
#	.husky/pre-commit
#	.npmrc
#	CHANGELOG.md
#	code-of-conduct.md
#	package.json
#	pnpm-lock.yaml
#	readme.md
#	security.md
#	src/chat/components/ChatDetails/ChatDetailsMembers/index.tsx
#	src/chat/components/ChatDetails/EditChatMemberComposer/index.tsx
#	src/chat/components/MessageList/index.tsx
#	src/chat/components/RecentChat/index.tsx
#	src/chat/components/UserSelectorModal/ContactList/index.tsx
#	src/chat/components/UserSelectorModal/index.tsx
#	src/core/components/ChunkHighlighter/index.tsx
#	src/core/components/Confirm/index.tsx
#	src/core/components/Confirm/styles.tsx
#	src/core/components/InputText/InsideInputText.tsx
#	src/core/components/UserChip/UIUserChip.tsx
#	src/core/providers/UiKitProvider/index.tsx
#	src/core/providers/UiKitProvider/theme/default-theme.ts
#	src/core/providers/UiKitProvider/theme/index.ts
#	src/i18n/en.json
#	src/icons/index.ts
#	src/index.ts
#	src/social/components/Comment/index.tsx
#	src/social/components/CommentComposeBar/index.tsx
#	src/social/components/CommentLikeButton/UICommentLikeButton.tsx
#	src/social/components/CommentLikeButton/index.tsx
#	src/social/components/CommentLikeButton/styles.tsx
#	src/social/components/CommentList/index.tsx
#	src/social/components/CommentList/styles.tsx
#	src/social/components/CommunityInfo/UICommunityInfo.tsx
#	src/social/components/CommunityInfo/index.tsx
#	src/social/components/CommunityPermissions/CommunityPermissions.tsx
#	src/social/components/CommunityPermissions/SwitchItem.tsx
#	src/social/components/CommunityPermissions/index.tsx
#	src/social/components/CommunityPermissions/styles.tsx
#	src/social/components/CommunityPermissions/utils.tsx
#	src/social/components/CommunitySideMenu/index.tsx
#	src/social/components/LoadMoreWrapper/index.tsx
#	src/social/components/UserProfileForm/index.tsx
#	src/social/components/post/LikeButton/styles.tsx
#	src/social/hooks/usePostByIds.ts
#	src/social/hooks/usePostLike.ts
#	src/social/hooks/useSocialMention.ts
#	src/social/hooks/useStories.ts
#	src/social/pages/Application/index.tsx
#	src/social/pages/CommunityFeed/index.tsx
#	src/social/pages/NewsFeed/index.tsx
#	src/social/pages/NewsFeed/styles.tsx
#	src/social/providers/NavigationProvider.tsx
#	src/utils.ts
  • Loading branch information
bonanaaaaaa committed Mar 22, 2024
2 parents d608e2c + 7772c5f commit 8529e54
Show file tree
Hide file tree
Showing 159 changed files with 6,889 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ storybook-build/
build/

dist/
jest.config.js
jest.config.js
133 changes: 133 additions & 0 deletions amity-uikit.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"global_theme": {
"light_theme": {
"primary_color": "#1054DE",
"secondary_color": "#292B32"
}
},
"excludes": [],
"customizations": {
"select_target_page/*/*": {
"page_theme": {
"light_theme": {
"primary_color": "#1054DE",
"secondary_color": "#292B32"
}
},
"title": "Share to"
},
"select_target_page/*/back_button": {
"back_icon": "back"
},
"camera_page/*/*": {
"resolution": "720p",
"page_theme": {
"light_theme": {
"primary_color": "#1054DE",
"secondary_color": "#292B32"
}
}
},
"camera_page/*/close_button": {
"close_icon": "close",
"background_color": "#80000000"
},
"create_story_page/*/*": {},
"create_story_page/*/back_button": {
"back_icon": "back",
"background_color": "#80000000"
},
"create_story_page/*/aspect_ratio_button": {
"aspect_ratio_icon": "aspect_ratio",
"background_color": "#80000000"
},
"create_story_page/*/story_hyperlink_button": {
"hyperlink_button_icon": "hyperlink_button",
"background_color": "#80000000"
},
"create_story_page/*/hyper_link": {
"hyper_link_icon": "hyper_link",
"background_color": "#80000000"
},
"create_story_page/*/share_story_button": {
"share_icon": "share_story_button",
"background_color": "#FFFFFF",
"hide_avatar": false
},
"story_page/*/*": {},
"story_page/*/progress_bar": {},
"story_page/*/overflow_menu": {
"overflow_menu_icon": "threeDot"
},
"story_page/*/close_button": {
"close_icon": "close"
},
"story_page/*/story_impression_button": {
"impression_icon": "impressionIcon"
},
"story_page/*/story_comment_button": {
"comment_icon": "comment"
},
"story_page/*/story_reaction_button": {
"reaction_icon": "like",
"background_color": "#1243EE"
},
"story_page/*/create_new_story_button": {
"create_new_story_icon": "plus",
"background_color": "#1243EE"
},
"story_page/*/speaker_button": {
"mute_icon": "mute",
"unmute_icon": "unmute"
},
"*/edit_comment_component/*": {
"component_theme": {
"light_theme": {
"primary_color": "#1054DE",
"secondary_color": "#292B32"
}
}
},
"*/edit_comment_component/cancel_button": {
"cancel_icon": "",
"cancel_button_text": "Cancel",
"background_color": "#FFFFFF"
},
"*/edit_comment_component/save_button": {
"save_icon": "",
"save_button_text": "Save",
"background_color": "#1054DE"
},
"*/hyper_link_config_component/*": {
"component_theme": {
"light_theme": {
"primary_color": "#1054DE",
"secondary_color": "#292B32"
}
}
},
"*/hyper_link_config_component/done_button": {
"done_icon": "",
"done_button_text": "Done",
"background_color": "#1243EE"
},
"*/hyper_link_config_component/cancel_button": {
"cancel_icon": "",
"cancel_button_text": "Cancel"
},
"*/comment_tray_component/*": {},
"*/story_tab_component/*": {},
"*/story_tab_component/story_ring": {
"progress_color": ["#339AF9", "#78FA58"],
"fail_color": ["#FA4D30"],
"background_color": ["#EBECEF"]
},
"*/story_tab_component/create_new_story_button": {
"create_new_story_icon": "plus",
"background_color": "#1243EE"
},
"*/*/close_button": {
"close_icon": "close"
}
}
}
2 changes: 1 addition & 1 deletion code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Code of conduct

Please refer to the [Amity code of conduct](https://docs.amity.co/support/code-of-conduct)
Please refer to the [Amity code of conduct](https://docs.amity.co/support/code-of-conduct)
26 changes: 0 additions & 26 deletions readme.md

This file was deleted.

2 changes: 1 addition & 1 deletion security.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Security policy

Please refer to the [Amity security policies](https://docs.amity.co/support/security)
Please refer to the [Amity security policies](https://docs.amity.co/support/security)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ChatDetailsMembers = ({
<FormattedMessage id="chat.members.return" />
</MembersReturnTitle>
</MembersReturn>
{members.length > 0 ? (
{members?.length > 0 ? (
<LoadMoreWrapper
hasMore={hasMore}
loadMore={loadMore}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ const EditChatMemberComposerForm = ({

return Promise.all(
[
toAddMemberIds.length > 0
toAddMemberIds?.length > 0
? ChannelRepository.Membership.addMembers(channelId, toAddMemberIds)
: null,
toRemoveMemberIds.length > 0
toRemoveMemberIds?.length > 0
? ChannelRepository.Membership.removeMembers(channelId, toRemoveMemberIds)
: null,
].filter(isNonNullable),
Expand Down
2 changes: 1 addition & 1 deletion src/chat/components/MessageList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const MessageList = ({ channelId }: MessageListProps) => {
next={loadMore}
loader={isLoading ? <span key={0}>Loading...</span> : null}
inverse={true}
dataLength={messages.length}
dataLength={messages?.length || 0}
style={{ display: 'flex', flexDirection: 'column-reverse' }}
height={containerRef.current.clientHeight}
>
Expand Down
2 changes: 1 addition & 1 deletion src/chat/components/RecentChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const RecentChat = ({
hasMore={hasMore}
next={loadMore}
loader={hasMore && <span key={0}>Loading...</span>}
dataLength={channels.length}
dataLength={channels?.length || 0}
height={containerRef.current.clientHeight}
>
{Array.isArray(channels) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const UserList = ({
hasMore={hasMore}
next={loadMore}
loader={<span key={0}>Loading...</span>}
dataLength={filterUsers.length}
dataLength={filterUsers?.length || 0}
>
<ListItemContainer>
{filterUsers.map((userData) => (
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/UserSelectorModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const UserSelectorModal = ({
</WrapSearch>

<WrapResult>
{query.length > 0 && (
{query?.length > 0 && (
<SearchUserList
excludeSelf
query={query}
Expand All @@ -113,7 +113,7 @@ const UserSelectorModal = ({
/>
)}

{query.length === 0 && (
{(!query || query?.length === 0) && (
<AllUserList
excludeSelf
selectedUserIds={selectedUserIds}
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/ChunkHighlighter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import React, { ReactNode } from 'react';
type Chunk = { start: number; end: number; highlight?: boolean };

export const processChunks = (text: string, chunks: Chunk[] = []) => {
const textLength = text.length;
const textLength = text?.length || 0;
const allChunks: Chunk[] = [];

const append = (start: number, end: number, highlight: boolean) => {
allChunks.push({ start, end, highlight });
};

if (chunks.length === 0) {
if (!chunks || chunks?.length === 0) {
append(0, textLength, false);
} else {
let lastIndex = 0;
Expand Down
10 changes: 8 additions & 2 deletions src/core/components/Confirm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React, { useState } from 'react';
import { PrimaryButton } from '~/core/components/Button';

import { ConfirmModal, Footer, DefaultOkButton, DefaultCancelButton } from './styles';
import {
ConfirmModal,
Footer,
DefaultOkButton,
DefaultCancelButton,
ConfirmModalContent,
} from './styles';

const Confirm = ({
'data-qa-anchor': dataQaAnchor = '',
Expand Down Expand Up @@ -35,7 +41,7 @@ const Confirm = ({
}
onCancel={onCancel}
>
{content}
<ConfirmModalContent>{content}</ConfirmModalContent>
</ConfirmModal>
);

Expand Down
4 changes: 4 additions & 0 deletions src/core/components/Confirm/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const ConfirmModal = styled(Modal)`
max-width: 360px;
`;

export const ConfirmModalContent = styled.div`
padding: 1rem 1rem 0.75rem 1rem;
`;

export const Footer = styled.div`
display: flex;
justify-content: flex-end;
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/InputText/InsideInputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Container = styled.div`
display: flex;
flex-wrap: wrap;
min-width: 1em;
background: ${({ theme }) => theme.palette.system.background};
background: ${({ theme }) => theme.palette.base.shade4};
border: 1px solid #e3e4e8;
border-radius: 4px;
transition: background 0.2s, border-color 0.2s;
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/UserChip/UIUserChip.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useCallback } from 'react';

import Avatar from '~/core/components/Avatar';
import { Close, Remove } from '~/icons';

import { backgroundImage as UserImage } from '~/icons/User';

import { Chip, Name, RoundButton } from './styles';
import { Chip, Name, RoundButton, Close } from './styles';
import { useCustomComponent } from '~/core/providers/CustomComponentsProvider';

interface UIUserChipProps {
Expand Down
Loading

0 comments on commit 8529e54

Please sign in to comment.