HTML auto direction for specific textual content
This commit is contained in:
parent
9e8a8c1fac
commit
31cde43278
@ -128,7 +128,7 @@ export default function Text({ content, tags, creator, users }: TextProps) {
|
||||
function transformParagraph(frag: TextFragment) {
|
||||
const fragments = transformText(frag);
|
||||
if (fragments.every(f => typeof f === "string")) {
|
||||
return <p>{fragments}</p>;
|
||||
return <p dir="auto">{fragments}</p>;
|
||||
}
|
||||
return <>{fragments}</>;
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ const Textarea = (props: TextareaProps) => {
|
||||
return (
|
||||
// @ts-expect-error If anybody can figure out how to type this, please do
|
||||
<ReactTextareaAutocomplete
|
||||
dir="auto"
|
||||
{...props}
|
||||
loadingComponent={() => <span>Loading...</span>}
|
||||
placeholder={formatMessage(messages.NotePlaceholder)}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import "./ProfilePage.css";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import { useIntl, FormattedMessage } from "react-intl";
|
||||
import { useSelector } from "react-redux";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
@ -150,10 +150,12 @@ export default function ProfilePage() {
|
||||
|
||||
function bio() {
|
||||
return (
|
||||
aboutText.length > 0 && (
|
||||
<>
|
||||
<div className="details">{about}</div>
|
||||
</>
|
||||
aboutText.length && (
|
||||
<React.Fragment>
|
||||
<div dir="auto" className="details">
|
||||
{about}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user