Skip to content

Commit

Permalink
Merge pull request #841 from culturecreates/feature/issue-784
Browse files Browse the repository at this point in the history
Feature/issue 784
  • Loading branch information
AbhishekPAnil authored Dec 5, 2023
2 parents 2b16c3f + 946baa8 commit 6002f77
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/components/DatePicker/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ import frLocale from 'antd/es/date-picker/locale/fr_CA';
import enLocale from 'antd/es/date-picker/locale/en_US';

function DatePickerStyled(props) {
const handleDateChange = (value) => {
if (value && value.isValid()) {
datePickerRef.current.blur();
}
if (props.onChange) {
props.onChange(value);
}
};

const datePickerRef = React.createRef();

return (
<DatePicker
ref={datePickerRef}
format="DD/MM/YYYY"
size="large"
locale={i18n?.language === 'en' ? enLocale : i18n?.language === 'fr' && frLocale}
className="date-picker-wrapper"
{...props}
changeOnBlur={true}
placeholder={i18n?.language === 'en' ? 'DD/MM/YYYY' : 'JJ/MM/AAAA'}
showToday={false}
popupClassName="date-picker-calendar"
getPopupContainer={(trigger) => trigger.parentNode}
onChange={handleDateChange}
/>
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/TextEditor/TextEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ function TextEditor(props) {
placeholder={placeholder}
className="text-editor"
modules={modules}
style={{
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL ? '4px solid #E8E8E8' : '1px solid #b6c1c9'
}`,
}}
preserveWhitespace
onChange={onChange}
data-cy="text-editor"
Expand Down
12 changes: 10 additions & 2 deletions src/pages/Dashboard/AddEvent/AddEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3278,7 +3278,11 @@ function AddEvent() {
)}
style={{
borderRadius: '4px',
border: '4px solid #E8E8E8',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '423px',
resize: 'vertical',
}}
Expand All @@ -3297,7 +3301,11 @@ function AddEvent() {
)}
style={{
borderRadius: '4px',
border: '4px solid #E8E8E8',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '423px',
resize: 'vertical',
}}
Expand Down

0 comments on commit 6002f77

Please sign in to comment.