Skip to content

Commit

Permalink
Merge pull request #89 from AmityCo/ASC-22470-react-native-ui-kit-can…
Browse files Browse the repository at this point in the history
…not-comment-thrid-times-in-a-row

Fix: Asc 22470 react native UI kit cannot comment thrid times in a row
  • Loading branch information
NaingAmity authored May 14, 2024
2 parents f2c4805 + e1dbe13 commit cfebedb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 8 deletions.
Binary file removed amity-react-native-social-ui-kit-4.0.0-beta-2.tgz
Binary file not shown.
Binary file added amity-react-native-social-ui-kit-4.0.0-beta-3.tgz
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-2):
- amity-react-native-social-ui-kit (4.0.0-beta-3):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- boost (1.76.0)
Expand Down Expand Up @@ -732,7 +732,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
amity-react-native-social-ui-kit: fcd3e2399b2c5e26097e25679ed3e760bdb41893
amity-react-native-social-ui-kit: ab21e193552c469ad4e28e9a5aaa56987a0695bb
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand Down
2 changes: 1 addition & 1 deletion 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-2",
"version": "4.0.0-beta-3",
"description": "Social UIKit",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
7 changes: 5 additions & 2 deletions src/components/EditCommentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const EditCommentModal = ({
}
}
};
const disabledState =
!inputMessage || inputMessage === commentDetail?.data?.text;
const disabledColor = disabledState && { color: theme.colors.baseShade2 };

return (
<Modal visible={visible} animationType="slide">
Expand All @@ -63,9 +66,9 @@ const EditCommentModal = ({
<TouchableOpacity
onPress={handleEditComment}
style={styles.headerTextContainer}
disabled={inputMessage === commentDetail?.data?.text}
disabled={disabledState}
>
<Text style={styles.headerText}>Save</Text>
<Text style={[styles.headerText, disabledColor]}>Save</Text>
</TouchableOpacity>
</View>
<View style={styles.container}>
Expand Down
5 changes: 3 additions & 2 deletions src/components/EditCommentModal/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ export const useStyles = () => {
container: {
flex: 1,
backgroundColor: theme.colors.background,
paddingTop: Platform.OS === 'android' ? 35 : 10, // Adjust for Android status bar
paddingTop: Platform.OS === 'android' ? 35 : 10,
paddingHorizontal: 15,
},
header: {
paddingTop: Platform.OS === 'ios' ? 50 : 20, // Adjust for iOS notch
paddingTop: Platform.OS === 'ios' ? 50 : 20,
zIndex: 1,
padding: 12,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
backgroundColor: theme.colors.background,
},
closeButton: {
zIndex: 1,
Expand Down
3 changes: 2 additions & 1 deletion src/components/MentionInput/AmityMentionInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const AmityMentionInput: FC<IMentionInput> = ({
);
useEffect(() => {
if (resetValue) {
onChangeInput('');
return onChangeInput('');
}
onChangeInput(initialValue);
}, [initialValue, onChangeInput, resetValue]);
Expand Down Expand Up @@ -127,6 +127,7 @@ const AmityMentionInput: FC<IMentionInput> = ({
);
return (
<MentionTextInput
containerStyle={styles.inputContainer}
style={styles.inputText}
{...rest}
value={value}
Expand Down
3 changes: 3 additions & 0 deletions src/components/MentionInput/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const useStyles = () => {
color: theme.colors.primary,
fontSize: 15,
},
inputContainer: {
width: '100%',
},
inputText: {
color: theme.colors.base,
fontSize: 15,
Expand Down
1 change: 1 addition & 0 deletions src/screens/PostDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const PostDetail = () => {
}
};
const handleSend: () => Promise<void> = async () => {
setResetValue(false);
if (inputMessage.trim() === '') {
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/v4/component/Social/CommentList/CommentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const CommentList: FC<ICommentListProp> = ({
};

const handleSend: () => Promise<void> = useCallback(async () => {
setResetValue(false);
if (inputMessage.trim() === '') {
return;
}
Expand Down

0 comments on commit cfebedb

Please sign in to comment.