mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Profile editing: Re-adds the character counter with the new limit (#38400)
This commit is contained in:
@@ -3,6 +3,7 @@ import { useCallback, useState } from 'react';
|
|||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
import { CharacterCounter } from '@/mastodon/components/character_counter';
|
||||||
import { Details } from '@/mastodon/components/details';
|
import { Details } from '@/mastodon/components/details';
|
||||||
import { TextAreaField } from '@/mastodon/components/form_fields';
|
import { TextAreaField } from '@/mastodon/components/form_fields';
|
||||||
import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
|
import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
|
||||||
@@ -84,7 +85,12 @@ export const ImageAltTextField: FC<{
|
|||||||
const altLimit = useAppSelector(
|
const altLimit = useAppSelector(
|
||||||
(state) =>
|
(state) =>
|
||||||
state.server.getIn(
|
state.server.getIn(
|
||||||
['server', 'configuration', 'media_attachments', 'description_limit'],
|
[
|
||||||
|
'server',
|
||||||
|
'configuration',
|
||||||
|
'accounts',
|
||||||
|
'max_header_description_length',
|
||||||
|
],
|
||||||
150,
|
150,
|
||||||
) as number,
|
) as number,
|
||||||
);
|
);
|
||||||
@@ -100,23 +106,26 @@ export const ImageAltTextField: FC<{
|
|||||||
<>
|
<>
|
||||||
<img src={imageSrc} alt='' className={classes.altImage} />
|
<img src={imageSrc} alt='' className={classes.altImage} />
|
||||||
|
|
||||||
<TextAreaField
|
<div>
|
||||||
label={
|
<TextAreaField
|
||||||
<FormattedMessage
|
label={
|
||||||
id='account_edit.image_alt_modal.text_label'
|
<FormattedMessage
|
||||||
defaultMessage='Alt text'
|
id='account_edit.image_alt_modal.text_label'
|
||||||
/>
|
defaultMessage='Alt text'
|
||||||
}
|
/>
|
||||||
hint={
|
}
|
||||||
<FormattedMessage
|
hint={
|
||||||
id='account_edit.image_alt_modal.text_hint'
|
<FormattedMessage
|
||||||
defaultMessage='Alt text helps screen reader users to understand your content.'
|
id='account_edit.image_alt_modal.text_hint'
|
||||||
/>
|
defaultMessage='Alt text helps screen reader users to understand your content.'
|
||||||
}
|
/>
|
||||||
onChange={handleChange}
|
}
|
||||||
value={altText}
|
onChange={handleChange}
|
||||||
maxLength={altLimit}
|
value={altText}
|
||||||
/>
|
maxLength={altLimit}
|
||||||
|
/>
|
||||||
|
<CharacterCounter currentString={altText} maxLength={altLimit} />
|
||||||
|
</div>
|
||||||
|
|
||||||
{!hideTip && (
|
{!hideTip && (
|
||||||
<Details
|
<Details
|
||||||
|
|||||||
Reference in New Issue
Block a user