Apply rtl styling for rtl languages

This commit is contained in:
schroda
2024-04-25 14:07:59 +02:00
parent 6788e284e9
commit 1626771e92
5 changed files with 77 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ import Divider from '@mui/material/Divider';
import FormControl from '@mui/material/FormControl';
import MenuItem from '@mui/material/MenuItem';
import Tooltip from '@mui/material/Tooltip';
import { styled } from '@mui/material/styles';
import { styled, useTheme } from '@mui/material/styles';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import Collapse from '@mui/material/Collapse';
@@ -132,6 +132,8 @@ interface IProps {
export function ReaderNavBar(props: IProps) {
const { t } = useTranslation();
const theme = useTheme();
const navigate = useNavigate();
const location = useLocation<{
prevDrawerOpen?: boolean;
@@ -308,7 +310,7 @@ export function ReaderNavBar(props: IProps) {
disabled={disableChapterNavButtons || chapter.sourceOrder <= 1}
onClick={() => openNextChapter(ChapterOffset.PREV)}
>
<KeyboardArrowLeftIcon />
{theme.direction === 'ltr' ? <KeyboardArrowLeftIcon /> : <KeyboardArrowRightIcon />}
</IconButton>
</Tooltip>
<FormControl
@@ -348,7 +350,7 @@ export function ReaderNavBar(props: IProps) {
}
onClick={() => openNextChapter(ChapterOffset.NEXT)}
>
<KeyboardArrowRightIcon />
{theme.direction === 'ltr' ? <KeyboardArrowRightIcon /> : <KeyboardArrowLeftIcon />}
</IconButton>
</Tooltip>
</ChapterNavigation>