Client - display characters limitation on textarea - fix #81

This commit is contained in:
Sam
2021-07-14 15:05:00 +02:00
parent 7cea812d8b
commit fdfd828677
21 changed files with 93 additions and 37 deletions

View File

@ -7,6 +7,7 @@ import { addWorkout, editWorkout } from '../../../actions/workouts'
import { history } from '../../../index'
import { getFileSize } from '../../../utils'
import { translateSports } from '../../../utils/workouts'
import CustomTextArea from '../../Common/CustomTextArea'
function FormWithGpx(props) {
const {
@ -105,12 +106,11 @@ function FormWithGpx(props) {
<div className="form-group">
<label>
{t('workouts:Notes')}:
<textarea
name="notes"
<CustomTextArea
charLimit={500}
defaultValue={workout ? workout.notes : ''}
disabled={loading}
className="form-control input-lg"
maxLength="500"
loading={loading}
name="notes"
/>
</label>
</div>

View File

@ -5,6 +5,7 @@ import { addWorkoutWithoutGpx, editWorkout } from '../../../actions/workouts'
import { history } from '../../../index'
import { getDateWithTZ } from '../../../utils'
import { formatWorkoutDate, translateSports } from '../../../utils/workouts'
import CustomTextArea from '../../Common/CustomTextArea'
function FormWithoutGpx(props) {
const { onAddOrEdit, sports, t, user, workout } = props
@ -106,11 +107,10 @@ function FormWithoutGpx(props) {
<div className="form-group">
<label>
{t('workouts:Notes')}:
<textarea
name="notes"
<CustomTextArea
charLimit={500}
defaultValue={workout ? workout.notes : ''}
className="form-control input-lg"
maxLength="500"
name="notes"
/>
</label>
</div>