Skip to content

Commit

Permalink
Removing character count
Browse files Browse the repository at this point in the history
  • Loading branch information
VineetBala-AOT committed Jan 10, 2024
1 parent deeaac6 commit 9548aad
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import React, { useContext, useState } from 'react';
import { Box, Grid, Typography } from '@mui/material';
import React, { useContext } from 'react';
import { Box, Grid } from '@mui/material';
import { MetHeader4 } from 'components/common';
import { EngagementSettingsContext } from './EngagementSettingsContext';
import RichTextEditor from 'components/common/RichTextEditor';

const ConsentMessage = () => {
const [descriptionCharCount, setDescriptionCharCount] = useState(0);
const { consentMessage, setConsentMessage } = useContext(EngagementSettingsContext);

const handleContentChange = (rawText: string) => {
setDescriptionCharCount(rawText.length);
};

const handleRichContentChange = (newState: string) => {
setConsentMessage(newState);
};
Expand All @@ -24,11 +19,9 @@ const ConsentMessage = () => {
<Grid item xs={12}>
<Box display="flex" flexDirection="column" justifyContent="space-between">
<RichTextEditor
setRawText={handleContentChange}
handleEditorStateChange={handleRichContentChange}
initialRawEditorState={consentMessage || ''}
/>
<Typography alignSelf="flex-end">Character Count: {descriptionCharCount}</Typography>
</Box>
</Grid>
</Grid>
Expand Down

0 comments on commit 9548aad

Please sign in to comment.