Mark some strings as translatable
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
925087024c
commit
e167ec8b6e
2 changed files with 16 additions and 4 deletions
|
@ -1,15 +1,21 @@
|
|||
import React from 'react';
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { CardTitle, HStack, IconButton, Stack } from 'soapbox/components/ui';
|
||||
|
||||
import ChatSearch from '../../chat-search/chat-search';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'chat.new_message.title', defaultMessage: 'New Message' },
|
||||
});
|
||||
|
||||
interface IChatPageNew {
|
||||
}
|
||||
|
||||
/** New message form to create a chat. */
|
||||
const ChatPageNew: React.FC<IChatPageNew> = () => {
|
||||
const intl = useIntl();
|
||||
const history = useHistory();
|
||||
|
||||
return (
|
||||
|
@ -22,7 +28,7 @@ const ChatPageNew: React.FC<IChatPageNew> = () => {
|
|||
onClick={() => history.push('/chats')}
|
||||
/>
|
||||
|
||||
<CardTitle title='New Message' />
|
||||
<CardTitle title={intl.formatMessage(messages.title)} />
|
||||
</HStack>
|
||||
</Stack>
|
||||
|
||||
|
@ -31,4 +37,4 @@ const ChatPageNew: React.FC<IChatPageNew> = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default ChatPageNew;
|
||||
export default ChatPageNew;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { useMutation } from '@tanstack/react-query';
|
||||
import { AxiosError } from 'axios';
|
||||
import React, { useState } from 'react';
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { Icon, Input, Stack } from 'soapbox/components/ui';
|
||||
|
@ -17,11 +18,16 @@ import Blankslate from './blankslate';
|
|||
import EmptyResultsBlankslate from './empty-results-blankslate';
|
||||
import Results from './results';
|
||||
|
||||
const messages = defineMessages({
|
||||
placeholder: { id: 'chat_search.placeholder', defaultMessage: 'Type a name' },
|
||||
});
|
||||
|
||||
interface IChatSearch {
|
||||
isMainPage?: boolean
|
||||
}
|
||||
|
||||
const ChatSearch = (props: IChatSearch) => {
|
||||
const intl = useIntl();
|
||||
const { isMainPage = false } = props;
|
||||
|
||||
const debounce = useDebounce;
|
||||
|
@ -88,7 +94,7 @@ const ChatSearch = (props: IChatSearch) => {
|
|||
data-testid='search'
|
||||
type='text'
|
||||
autoFocus
|
||||
placeholder='Type a name'
|
||||
placeholder={intl.formatMessage(messages.placeholder)}
|
||||
value={value || ''}
|
||||
onChange={(event) => setValue(event.target.value)}
|
||||
outerClassName='mt-0'
|
||||
|
@ -112,4 +118,4 @@ const ChatSearch = (props: IChatSearch) => {
|
|||
);
|
||||
};
|
||||
|
||||
export default ChatSearch;
|
||||
export default ChatSearch;
|
||||
|
|
Loading…
Reference in a new issue