diff --git a/app/soapbox/components/autosuggest-input.tsx b/app/soapbox/components/autosuggest-input.tsx index c4bf49d72..fe82744c1 100644 --- a/app/soapbox/components/autosuggest-input.tsx +++ b/app/soapbox/components/autosuggest-input.tsx @@ -8,6 +8,7 @@ import AutosuggestEmoji, { Emoji } from 'soapbox/components/autosuggest-emoji'; import Icon from 'soapbox/components/icon'; import { Input } from 'soapbox/components/ui'; import AutosuggestAccount from 'soapbox/features/compose/components/autosuggest-account'; +import { isRtl } from 'soapbox/rtl'; import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; import type { Menu, MenuItem } from 'soapbox/components/dropdown-menu'; @@ -263,8 +264,15 @@ export default class AutosuggestInput extends ImmutablePureComponent @@ -283,6 +291,7 @@ export default class AutosuggestInput extends ImmutablePureComponent render() { const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children, condensed, id } = this.props; const { suggestionsHidden } = this.state; + const style = { direction: 'ltr', minRows: 10 }; + + // TODO: convert to functional component and use `useLocale()` hook instead of checking placeholder text. + if (isRtl(value) || (!value && placeholder && isRtl(placeholder))) { + style.direction = 'rtl'; + } return [
@@ -250,6 +257,7 @@ class AutosuggestTextarea extends ImmutablePureComponent onFocus={this.onFocus} onBlur={this.onBlur} onPaste={this.onPaste} + style={style as any} aria-autocomplete='list' /> diff --git a/app/soapbox/components/status-action-button.tsx b/app/soapbox/components/status-action-button.tsx index 2f355211b..e0d23b98b 100644 --- a/app/soapbox/components/status-action-button.tsx +++ b/app/soapbox/components/status-action-button.tsx @@ -79,7 +79,7 @@ const StatusActionButton = React.forwardRef = (props) => { event.stopPropagation()} - className='hidden sm:flex items-center text-gray-700 dark:text-gray-600 text-xs font-medium space-x-1 hover:underline' + className='hidden sm:flex items-center text-gray-700 dark:text-gray-600 text-xs font-medium space-x-1 rtl:space-x-reverse hover:underline' > @@ -246,7 +246,7 @@ const Status: React.FC = (props) => { id='status.reblogged_by' defaultMessage='{name} reposted' values={{ - name: + name: , }} diff --git a/app/soapbox/features/compose/components/search.tsx b/app/soapbox/features/compose/components/search.tsx index f4b8c1876..796100440 100644 --- a/app/soapbox/features/compose/components/search.tsx +++ b/app/soapbox/features/compose/components/search.tsx @@ -127,6 +127,7 @@ const Search = (props: ISearch) => { onFocus: handleFocus, autoFocus: autoFocus, theme: 'search', + className: 'pr-10 rtl:pl-10 rtl:pr-3', }; if (autosuggest) { diff --git a/app/soapbox/features/ui/components/navbar.tsx b/app/soapbox/features/ui/components/navbar.tsx index 2fd186830..72ba8c792 100644 --- a/app/soapbox/features/ui/components/navbar.tsx +++ b/app/soapbox/features/ui/components/navbar.tsx @@ -71,7 +71,7 @@ const Navbar = () => {
{account && ( -
+
diff --git a/app/styles/components/detailed-status.scss b/app/styles/components/detailed-status.scss index e91dfb6f8..7b5086776 100644 --- a/app/styles/components/detailed-status.scss +++ b/app/styles/components/detailed-status.scss @@ -10,36 +10,11 @@ } .status__content-wrapper { - padding-left: calc(42px + 12px); + @apply pl-[calc(42px+12px)] rtl:pl-0 rtl:pr-[calc(42px+12px)]; } - // &__descendants &__status:first-child { - // margin-top: 10px; - - // .status__wrapper--filtered { - // margin-top: -10px; - // } - // } - - // &__status--focused:first-child, - // &__ancestors &__status:first-child { - // margin-top: 10px; - - // .status__wrapper--filtered { - // margin-top: -10px; - // } - // } - - // &__descendants &__status:last-child { - // margin-bottom: 10px; - - // .status__wrapper--filtered { - // margin-bottom: -10px; - // } - // } - &__connector { - @apply bg-gray-200 dark:bg-primary-800 absolute w-0.5 left-5 hidden z-[1]; + @apply bg-gray-200 dark:bg-primary-800 absolute w-0.5 left-5 hidden z-[1] rtl:right-5 rtl:left-auto; &--bottom { @apply block; diff --git a/app/styles/components/sidebar-menu.scss b/app/styles/components/sidebar-menu.scss index f3fd86032..10c960fc4 100644 --- a/app/styles/components/sidebar-menu.scss +++ b/app/styles/components/sidebar-menu.scss @@ -2,8 +2,7 @@ @apply flex inset-0 fixed flex-col w-80 bg-white dark:bg-primary-900 transition-all ease-linear -translate-x-80 rtl:translate-x-80 z-1000; @media (max-width: 400px) { - width: 90vw; - transform: translateX(-90vw); + @apply w-[90vw] -translate-x-[90vw] rtl:translate-x-[90vw]; } hr {