sforkowany z mirror/soapbox
Merge branch 'compose-icon' into 'develop'
ComposeForm: fix publish icon Closes #1319 See merge request soapbox-pub/soapbox!2165bosnian
commit
613a0077d3
|
@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Modals: fix "View context" button in media modal.
|
- Modals: fix "View context" button in media modal.
|
||||||
- Posts: let unauthenticated users to translate posts if allowed by backend.
|
- Posts: let unauthenticated users to translate posts if allowed by backend.
|
||||||
- Chats: fix jumpy scrollbar.
|
- Chats: fix jumpy scrollbar.
|
||||||
|
- Composer: fix alignment of icon in submit button.
|
||||||
|
|
||||||
## [3.0.0] - 2022-12-25
|
## [3.0.0] - 2022-12-25
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import {
|
||||||
} from 'soapbox/actions/compose';
|
} from 'soapbox/actions/compose';
|
||||||
import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input';
|
import AutosuggestInput, { AutoSuggestion } from 'soapbox/components/autosuggest-input';
|
||||||
import AutosuggestTextarea from 'soapbox/components/autosuggest-textarea';
|
import AutosuggestTextarea from 'soapbox/components/autosuggest-textarea';
|
||||||
import Icon from 'soapbox/components/icon';
|
|
||||||
import { Button, HStack, Stack } from 'soapbox/components/ui';
|
import { Button, HStack, Stack } from 'soapbox/components/ui';
|
||||||
import { useAppDispatch, useAppSelector, useCompose, useFeatures, useInstance, usePrevious } from 'soapbox/hooks';
|
import { useAppDispatch, useAppSelector, useCompose, useFeatures, useInstance, usePrevious } from 'soapbox/hooks';
|
||||||
import { isMobile } from 'soapbox/is-mobile';
|
import { isMobile } from 'soapbox/is-mobile';
|
||||||
|
@ -241,25 +240,18 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
|
||||||
const disabledButton = disabled || isUploading || isChangingUpload || length(countedText) > maxTootChars || (countedText.length !== 0 && countedText.trim().length === 0 && !anyMedia);
|
const disabledButton = disabled || isUploading || isChangingUpload || length(countedText) > maxTootChars || (countedText.length !== 0 && countedText.trim().length === 0 && !anyMedia);
|
||||||
const shouldAutoFocus = autoFocus && !showSearch && !isMobile(window.innerWidth);
|
const shouldAutoFocus = autoFocus && !showSearch && !isMobile(window.innerWidth);
|
||||||
|
|
||||||
let publishText: string | JSX.Element = '';
|
let publishText: string = '';
|
||||||
|
let publishIcon: string | undefined;
|
||||||
let textareaPlaceholder: MessageDescriptor;
|
let textareaPlaceholder: MessageDescriptor;
|
||||||
|
|
||||||
if (isEditing) {
|
if (isEditing) {
|
||||||
publishText = intl.formatMessage(messages.saveChanges);
|
publishText = intl.formatMessage(messages.saveChanges);
|
||||||
} else if (privacy === 'direct') {
|
} else if (privacy === 'direct') {
|
||||||
publishText = (
|
publishText = intl.formatMessage(messages.message);
|
||||||
<>
|
publishIcon = require('@tabler/icons/mail.svg');
|
||||||
<Icon src={require('@tabler/icons/mail.svg')} />
|
|
||||||
{intl.formatMessage(messages.message)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else if (privacy === 'private') {
|
} else if (privacy === 'private') {
|
||||||
publishText = (
|
publishText = intl.formatMessage(messages.publish);
|
||||||
<>
|
publishIcon = require('@tabler/icons/lock.svg');
|
||||||
<Icon src={require('@tabler/icons/lock.svg')} />
|
|
||||||
{intl.formatMessage(messages.publish)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
publishText = privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish);
|
publishText = privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish);
|
||||||
}
|
}
|
||||||
|
@ -355,7 +347,7 @@ const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickab
|
||||||
</HStack>
|
</HStack>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Button type='submit' theme='primary' text={publishText} disabled={disabledButton} />
|
<Button type='submit' theme='primary' text={publishText} icon={publishIcon} disabled={disabledButton} />
|
||||||
</HStack>
|
</HStack>
|
||||||
{/* <HStack alignItems='center' space={4}>
|
{/* <HStack alignItems='center' space={4}>
|
||||||
</HStack> */}
|
</HStack> */}
|
||||||
|
|
Ładowanie…
Reference in New Issue