Skip to content
Open
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: 2 additions & 0 deletions src/app/Peerly/constants/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ export default {
'Your objection reason has been submitted successfully. We appreciate your feedback.',
REWARD_SUCCESS:
'Your rewards has been submitted successfully. We appreciate your feedback.',
MIN_DESCRIPTION_LENGTH: 'Description must be at least 150 characters long.',
NOTE: 'Note:'
};
28 changes: 21 additions & 7 deletions src/app/Peerly/screens/GiveAppreciationScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const paginationData = {
const schema = yup.object().shape({
receiver: yup.string().required(messages.SELECT_COWORKER_NAME),
core_value_id: yup.string().required(messages.SELECT_CORE_VALUE),
description: yup.string().required(messages.ENTER_DESCIPTION),
description: yup.string().required(messages.ENTER_DESCIPTION)
.min(150, messages.MIN_DESCRIPTION_LENGTH),
});

const AppreciationScreen = () => {
Expand Down Expand Up @@ -159,12 +160,17 @@ const AppreciationScreen = () => {
<Controller
control={control}
render={({field: {onChange, value}}) => (
<TextInput
style={styles.description}
onChangeText={onChange}
value={value}
multiline
/>
<>
<TextInput
style={styles.description}
onChangeText={onChange}
value={value}
multiline
/>
<Typography style={styles.noteText}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text field should toggle between helper text and error messages. We should avoid showing both simultaneously, especially when they have same text.

<Text style={styles.noteBold}>{messages.NOTE}</Text> {messages.MIN_DESCRIPTION_LENGTH}
</Typography>
</>
)}
name="description"
/>
Expand Down Expand Up @@ -259,6 +265,14 @@ const styles = StyleSheet.create({
fontSize: 16,
borderRadius: 12,
},
noteText: {
color: 'gray',
fontSize: 10,
marginTop: 4,
},
noteBold: {
fontWeight: 'bold',
},
});

export default AppreciationScreen;