rtl.ts -> utils/rtl.ts
This commit is contained in:
parent
207e93b6a8
commit
ae63d37d78
|
@ -7,7 +7,7 @@ import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji';
|
||||||
import Icon from 'soapbox/components/icon';
|
import Icon from 'soapbox/components/icon';
|
||||||
import { Input, Portal } from 'soapbox/components/ui';
|
import { Input, Portal } from 'soapbox/components/ui';
|
||||||
import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account';
|
import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account';
|
||||||
import { isRtl } from 'soapbox/rtl';
|
import { isRtl } from 'soapbox/utils/rtl';
|
||||||
import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions';
|
import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions';
|
||||||
|
|
||||||
import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu';
|
import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Textarea from 'react-textarea-autosize';
|
||||||
|
|
||||||
import { Portal } from 'soapbox/components/ui';
|
import { Portal } from 'soapbox/components/ui';
|
||||||
import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account';
|
import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account';
|
||||||
import { isRtl } from 'soapbox/rtl';
|
import { isRtl } from 'soapbox/utils/rtl';
|
||||||
import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions';
|
import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions';
|
||||||
|
|
||||||
import AutosuggestEmoji from './autosuggest-emoji';
|
import AutosuggestEmoji from './autosuggest-emoji';
|
||||||
|
|
|
@ -5,8 +5,8 @@ import React, { useState, useEffect } from 'react';
|
||||||
import Blurhash from 'soapbox/components/blurhash';
|
import Blurhash from 'soapbox/components/blurhash';
|
||||||
import { HStack, Stack, Text, Icon } from 'soapbox/components/ui';
|
import { HStack, Stack, Text, Icon } from 'soapbox/components/ui';
|
||||||
import { normalizeAttachment } from 'soapbox/normalizers';
|
import { normalizeAttachment } from 'soapbox/normalizers';
|
||||||
import { getTextDirection } from 'soapbox/rtl';
|
|
||||||
import { addAutoPlay } from 'soapbox/utils/media';
|
import { addAutoPlay } from 'soapbox/utils/media';
|
||||||
|
import { getTextDirection } from 'soapbox/utils/rtl';
|
||||||
|
|
||||||
import type { Card as CardEntity, Attachment } from 'soapbox/types/entities';
|
import type { Card as CardEntity, Attachment } from 'soapbox/types/entities';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom';
|
||||||
import Icon from 'soapbox/components/icon';
|
import Icon from 'soapbox/components/icon';
|
||||||
import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content';
|
import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content';
|
||||||
|
|
||||||
import { isRtl } from '../rtl';
|
import { getTextDirection } from '../utils/rtl';
|
||||||
|
|
||||||
import Markup from './markup';
|
import Markup from './markup';
|
||||||
import Poll from './polls/poll';
|
import Poll from './polls/poll';
|
||||||
|
@ -142,7 +142,7 @@ const StatusContent: React.FC<IStatusContent> = ({
|
||||||
const baseClassName = 'text-gray-900 dark:text-gray-100 break-words text-ellipsis overflow-hidden relative focus:outline-none';
|
const baseClassName = 'text-gray-900 dark:text-gray-100 break-words text-ellipsis overflow-hidden relative focus:outline-none';
|
||||||
|
|
||||||
const content = { __html: parsedHtml };
|
const content = { __html: parsedHtml };
|
||||||
const direction = isRtl(status.search_index) ? 'rtl' : 'ltr';
|
const direction = getTextDirection(status.search_index);
|
||||||
const className = clsx(baseClassName, {
|
const className = clsx(baseClassName, {
|
||||||
'cursor-pointer': onClick,
|
'cursor-pointer': onClick,
|
||||||
'whitespace-normal': withSpoiler,
|
'whitespace-normal': withSpoiler,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import AttachmentThumbs from 'soapbox/components/attachment-thumbs';
|
||||||
import Markup from 'soapbox/components/markup';
|
import Markup from 'soapbox/components/markup';
|
||||||
import { Stack } from 'soapbox/components/ui';
|
import { Stack } from 'soapbox/components/ui';
|
||||||
import AccountContainer from 'soapbox/containers/account-container';
|
import AccountContainer from 'soapbox/containers/account-container';
|
||||||
import { isRtl } from 'soapbox/rtl';
|
import { getTextDirection } from 'soapbox/utils/rtl';
|
||||||
|
|
||||||
import type { Status } from 'soapbox/types/entities';
|
import type { Status } from 'soapbox/types/entities';
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ const ReplyIndicator: React.FC<IReplyIndicator> = ({ className, status, hideActi
|
||||||
className='break-words'
|
className='break-words'
|
||||||
size='sm'
|
size='sm'
|
||||||
dangerouslySetInnerHTML={{ __html: status.contentHtml }}
|
dangerouslySetInnerHTML={{ __html: status.contentHtml }}
|
||||||
direction={isRtl(status.search_index) ? 'rtl' : 'ltr'}
|
direction={getTextDirection(status.search_index)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{status.media_attachments.size > 0 && (
|
{status.media_attachments.size > 0 && (
|
||||||
|
|
Loading…
Reference in New Issue