RTL document support (#2263)

* Basic RTL support in documents

* fix: DocumentListItem and ReferenceListItem for RTL content
This commit is contained in:
Tom Moor
2021-07-03 07:00:10 -07:00
committed by GitHub
parent 04eabe68a7
commit a1d5ac0907
10 changed files with 53 additions and 13 deletions

View File

@@ -69,6 +69,7 @@ function DocumentListItem(props: Props, ref) {
return (
<DocumentLink
ref={ref}
dir={document.dir}
$isStarred={document.isStarred}
$menuOpen={menuOpen}
to={{
@@ -77,8 +78,12 @@ function DocumentListItem(props: Props, ref) {
}}
>
<Content>
<Heading>
<Title text={document.titleWithDefault} highlight={highlight} />
<Heading dir={document.dir}>
<Title
text={document.titleWithDefault}
highlight={highlight}
dir={document.dir}
/>
{document.isNew && document.createdBy.id !== currentUser.id && (
<Badge yellow>{t("New")}</Badge>
)}
@@ -222,6 +227,7 @@ const DocumentLink = styled(Link)`
const Heading = styled.h3`
display: flex;
justify-content: ${(props) => (props.rtl ? "flex-end" : "flex-start")};
align-items: center;
height: 24px;
margin-top: 0;