increase prettier line length to 120 (#233)
* [Prettier] Increase max line length to 120 100 is quite low, especially on modern monitors. The length is also reached quite quickly with 4 spaces per tab depending on the indentation depth * [Prettier] Increase max line length to 120 - Fix formatting
This commit is contained in:
@@ -97,9 +97,7 @@ const DownloadQueue: React.FC = () => {
|
||||
>
|
||||
<Card
|
||||
sx={{
|
||||
backgroundColor: snapshot.isDragging
|
||||
? 'custom.light'
|
||||
: undefined,
|
||||
backgroundColor: snapshot.isDragging ? 'custom.light' : undefined,
|
||||
}}
|
||||
>
|
||||
<CardActionArea
|
||||
@@ -117,18 +115,9 @@ const DownloadQueue: React.FC = () => {
|
||||
<IconButton sx={{ pointerEvents: 'none' }}>
|
||||
<DragHandle />
|
||||
</IconButton>
|
||||
<Stack
|
||||
sx={{ flex: 1, ml: 1 }}
|
||||
direction="column"
|
||||
>
|
||||
<Typography variant="h6">
|
||||
{item.manga.title}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
display="block"
|
||||
gutterBottom
|
||||
>
|
||||
<Stack sx={{ flex: 1, ml: 1 }} direction="column">
|
||||
<Typography variant="h6">{item.manga.title}</Typography>
|
||||
<Typography variant="caption" display="block" gutterBottom>
|
||||
{item.chapter.name}
|
||||
</Typography>
|
||||
</Stack>
|
||||
|
||||
@@ -67,10 +67,7 @@ function groupExtensions(extensions: IExtension[]) {
|
||||
export default function MangaExtensions() {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const { setTitle, setAction } = useContext(NavbarContext);
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>(
|
||||
'shownExtensionLangs',
|
||||
extensionDefaultLangs(),
|
||||
);
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownExtensionLangs', extensionDefaultLangs());
|
||||
const [showNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
|
||||
@@ -84,20 +81,12 @@ export default function MangaExtensions() {
|
||||
<IconButton onClick={() => inputRef.current?.click()} size="large">
|
||||
<AddIcon />
|
||||
</IconButton>
|
||||
<LangSelect
|
||||
shownLangs={shownLangs}
|
||||
setShownLangs={setShownLangs}
|
||||
allLangs={allLangs}
|
||||
/>
|
||||
<LangSelect shownLangs={shownLangs} setShownLangs={setShownLangs} allLangs={allLangs} />
|
||||
</>,
|
||||
);
|
||||
}, [shownLangs]);
|
||||
|
||||
const {
|
||||
data: allExtensions,
|
||||
mutate,
|
||||
loading,
|
||||
} = useQuery<IExtension[]>('/api/v1/extension/list');
|
||||
const { data: allExtensions, mutate, loading } = useQuery<IExtension[]>('/api/v1/extension/list');
|
||||
|
||||
const filteredExtensions = useMemo(
|
||||
() =>
|
||||
@@ -113,11 +102,7 @@ export default function MangaExtensions() {
|
||||
() =>
|
||||
groupExtensions(filteredExtensions)
|
||||
.filter((group) => group[EXTENSIONS].length > 0)
|
||||
.filter((group) =>
|
||||
['installed', 'updates pending', 'all', ...shownLangs].includes(
|
||||
group[LANGUAGE],
|
||||
),
|
||||
),
|
||||
.filter((group) => ['installed', 'updates pending', 'all', ...shownLangs].includes(group[LANGUAGE])),
|
||||
[shownLangs, filteredExtensions],
|
||||
);
|
||||
|
||||
|
||||
@@ -60,12 +60,7 @@ export default function Library() {
|
||||
};
|
||||
|
||||
if (tabsError != null) {
|
||||
return (
|
||||
<EmptyView
|
||||
message="Could not load categories"
|
||||
messageExtra={tabsError?.message ?? tabsError}
|
||||
/>
|
||||
);
|
||||
return <EmptyView message="Could not load categories" messageExtra={tabsError?.message ?? tabsError} />;
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
|
||||
@@ -38,9 +38,7 @@ const Manga: React.FC = () => {
|
||||
const [refresh, { loading: refreshing }] = useRefreshManga(id);
|
||||
|
||||
useSetDefaultBackTo(
|
||||
manga?.inLibrary === false && manga.sourceId != null
|
||||
? `/sources/${manga.sourceId}/popular`
|
||||
: '/library',
|
||||
manga?.inLibrary === false && manga.sourceId != null ? `/sources/${manga.sourceId}/popular` : '/library',
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -89,13 +87,7 @@ const Manga: React.FC = () => {
|
||||
<CircularProgress size={16} />
|
||||
</IconButton>
|
||||
)}
|
||||
{manga && (
|
||||
<MangaToolbarMenu
|
||||
manga={manga}
|
||||
onRefresh={refresh}
|
||||
refreshing={refreshing}
|
||||
/>
|
||||
)}
|
||||
{manga && <MangaToolbarMenu manga={manga} onRefresh={refresh} refreshing={refreshing} />}
|
||||
</Stack>
|
||||
</NavbarToolbar>
|
||||
|
||||
|
||||
@@ -75,8 +75,7 @@ export default function Reader() {
|
||||
const [curPage, setCurPage] = useState<number>(0);
|
||||
const { setOverride, setTitle } = useContext(NavbarContext);
|
||||
|
||||
const { settings: defaultSettings, loading: areDefaultSettingsLoading } =
|
||||
useDefaultReaderSettings();
|
||||
const { settings: defaultSettings, loading: areDefaultSettingsLoading } = useDefaultReaderSettings();
|
||||
const [settings, setSettings] = useState(getReaderSettingsFor(manga, defaultSettings));
|
||||
const [isMangaLoading, setIsMangaLoading] = useState(true);
|
||||
|
||||
@@ -97,9 +96,7 @@ export default function Reader() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!areDefaultSettingsLoading && !isMangaLoading) {
|
||||
checkAndHandleMissingStoredReaderSettings(manga, 'manga', defaultSettings).catch(
|
||||
() => {},
|
||||
);
|
||||
checkAndHandleMissingStoredReaderSettings(manga, 'manga', defaultSettings).catch(() => {});
|
||||
setSettings(getReaderSettingsFor(manga, defaultSettings));
|
||||
}
|
||||
}, [areDefaultSettingsLoading, isMangaLoading]);
|
||||
|
||||
@@ -16,12 +16,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import client from 'util/client';
|
||||
import {
|
||||
langCodeToName,
|
||||
langSortCmp,
|
||||
sourceDefualtLangs,
|
||||
sourceForcedDefaultLangs,
|
||||
} from 'util/language';
|
||||
import { langCodeToName, langSortCmp, sourceDefualtLangs, sourceForcedDefaultLangs } from 'util/language';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
|
||||
function sourceToLangList(sources: ISource[]) {
|
||||
@@ -43,10 +38,7 @@ const SearchAll: React.FC = () => {
|
||||
const [triggerUpdate, setTriggerUpdate] = useState<number>(2);
|
||||
const [mangas, setMangas] = useState<any>({});
|
||||
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>(
|
||||
'shownSourceLangs',
|
||||
sourceDefualtLangs(),
|
||||
);
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', sourceDefualtLangs());
|
||||
const [showNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
||||
|
||||
const [sources, setSources] = useState<ISource[]>([]);
|
||||
@@ -210,9 +202,7 @@ const SearchAll: React.FC = () => {
|
||||
sx={{ p: 3 }}
|
||||
>
|
||||
<Typography variant="h5">{displayName}</Typography>
|
||||
<Typography variant="caption">
|
||||
{langCodeToName(lang)}
|
||||
</Typography>
|
||||
<Typography variant="caption">{langCodeToName(lang)}</Typography>
|
||||
</CardActionArea>
|
||||
</Card>
|
||||
<MangaGrid
|
||||
|
||||
@@ -118,11 +118,7 @@ export default function Settings() {
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Dark Theme" />
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
edge="end"
|
||||
checked={darkTheme}
|
||||
onChange={() => setDarkTheme(!darkTheme)}
|
||||
/>
|
||||
<Switch edge="end" checked={darkTheme} onChange={() => setDarkTheme(!darkTheme)} />
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItemButton>
|
||||
@@ -141,16 +137,9 @@ export default function Settings() {
|
||||
<ListItemIcon>
|
||||
<FavoriteIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary="Show NSFW"
|
||||
secondary="Hide NSFW extensions and sources"
|
||||
/>
|
||||
<ListItemText primary="Show NSFW" secondary="Hide NSFW extensions and sources" />
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
edge="end"
|
||||
checked={showNsfw}
|
||||
onChange={() => setShowNsfw(!showNsfw)}
|
||||
/>
|
||||
<Switch edge="end" checked={showNsfw} onChange={() => setShowNsfw(!showNsfw)} />
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
@@ -163,11 +152,7 @@ export default function Settings() {
|
||||
but uses it much more internet traffic in turn"
|
||||
/>
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
edge="end"
|
||||
checked={useCache}
|
||||
onChange={() => setUseCache(!useCache)}
|
||||
/>
|
||||
<Switch edge="end" checked={useCache} onChange={() => setUseCache(!useCache)} />
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
|
||||
@@ -9,10 +9,7 @@ import React, { useContext, useEffect } from 'react';
|
||||
import NavbarContext from 'components/context/NavbarContext';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import client, { useQuery } from 'util/client';
|
||||
import {
|
||||
SwitchPreferenceCompat,
|
||||
CheckBoxPreference,
|
||||
} from 'components/sourceConfiguration/TwoStatePreference';
|
||||
import { SwitchPreferenceCompat, CheckBoxPreference } from 'components/sourceConfiguration/TwoStatePreference';
|
||||
import ListPreference from 'components/sourceConfiguration/ListPreference';
|
||||
import EditTextPreference from 'components/sourceConfiguration/EditTextPreference';
|
||||
import MultiSelectListPreference from 'components/sourceConfiguration/MultiSelectListPreference';
|
||||
|
||||
@@ -221,9 +221,7 @@ export default function SourceMangas(props: { popular: boolean }) {
|
||||
messageExtra = (
|
||||
<>
|
||||
<span>Check out </span>
|
||||
<a href="https://github.com/Suwayomi/Tachidesk-Server/wiki/Local-Source">
|
||||
Local source guide
|
||||
</a>
|
||||
<a href="https://github.com/Suwayomi/Tachidesk-Server/wiki/Local-Source">Local source guide</a>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,7 @@ import React, { useContext, useEffect } from 'react';
|
||||
import LangSelect from 'components/navbar/action/LangSelect';
|
||||
import SourceCard from 'components/SourceCard';
|
||||
import NavbarContext from 'components/context/NavbarContext';
|
||||
import {
|
||||
sourceDefualtLangs,
|
||||
sourceForcedDefaultLangs,
|
||||
langCodeToName,
|
||||
langSortCmp,
|
||||
} from 'util/language';
|
||||
import { sourceDefualtLangs, sourceForcedDefaultLangs, langCodeToName, langSortCmp } from 'util/language';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
||||
import { IconButton } from '@mui/material';
|
||||
@@ -50,10 +45,7 @@ function groupByLang(sources: ISource[]) {
|
||||
export default function Sources() {
|
||||
const { setTitle, setAction } = useContext(NavbarContext);
|
||||
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>(
|
||||
'shownSourceLangs',
|
||||
sourceDefualtLangs(),
|
||||
);
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', sourceDefualtLangs());
|
||||
const [showNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
||||
|
||||
const { data: sources, loading } = useQuery<ISource[]>('/api/v1/source/list');
|
||||
|
||||
@@ -46,9 +46,7 @@ function getDateString(date: Date) {
|
||||
return date.toLocaleDateString();
|
||||
}
|
||||
|
||||
function groupByDate(
|
||||
updates: IMangaChapter[],
|
||||
): [string, { item: IMangaChapter; globalIdx: number }[]][] {
|
||||
function groupByDate(updates: IMangaChapter[]): [string, { item: IMangaChapter; globalIdx: number }[]][] {
|
||||
if (updates.length === 0) return [];
|
||||
|
||||
const groups = {};
|
||||
@@ -64,10 +62,7 @@ function groupByDate(
|
||||
return Object.keys(groups).map((key) => [key, groups[key]]);
|
||||
}
|
||||
|
||||
const baseWebsocketUrl = JSON.parse(window.localStorage.getItem('serverBaseURL')!).replace(
|
||||
'http',
|
||||
'ws',
|
||||
);
|
||||
const baseWebsocketUrl = JSON.parse(window.localStorage.getItem('serverBaseURL')!).replace('http', 'ws');
|
||||
const initialQueue = {
|
||||
status: 'Stopped',
|
||||
queue: [],
|
||||
@@ -205,11 +200,7 @@ const Updates: React.FC = () => {
|
||||
<Typography variant="h5" component="h2">
|
||||
{manga.title}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
display="block"
|
||||
gutterBottom
|
||||
>
|
||||
<Typography variant="caption" display="block" gutterBottom>
|
||||
{chapter.name}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -74,10 +74,7 @@ export default function Backup() {
|
||||
<>
|
||||
<List sx={{ padding: 0 }}>
|
||||
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`} directLink>
|
||||
<ListItemText
|
||||
primary="Create Backup"
|
||||
secondary="Backup library as a Tachiyomi backup"
|
||||
/>
|
||||
<ListItemText primary="Create Backup" secondary="Backup library as a Tachiyomi backup" />
|
||||
</ListItemLink>
|
||||
<ListItem button onClick={() => document.getElementById('backup-file')?.click()}>
|
||||
<ListItemText
|
||||
|
||||
@@ -139,11 +139,7 @@ export default function Categories() {
|
||||
{(provided) => (
|
||||
<List ref={provided.innerRef}>
|
||||
{categories.map((item, index) => (
|
||||
<Draggable
|
||||
key={item.id}
|
||||
draggableId={item.id.toString()}
|
||||
index={index}
|
||||
>
|
||||
<Draggable key={item.id} draggableId={item.id.toString()} index={index}>
|
||||
{(provided, snapshot) => (
|
||||
<ListItem
|
||||
ContainerProps={{ ref: provided.innerRef } as any}
|
||||
|
||||
@@ -51,11 +51,7 @@ export default function DefaultReaderSettings() {
|
||||
);
|
||||
}
|
||||
|
||||
checkAndHandleMissingStoredReaderSettings(
|
||||
{ meta: metadata },
|
||||
'server',
|
||||
getDefaultSettings(),
|
||||
).catch(() => {});
|
||||
checkAndHandleMissingStoredReaderSettings({ meta: metadata }, 'server', getDefaultSettings()).catch(() => {});
|
||||
|
||||
return (
|
||||
<ReaderSettingsOptions
|
||||
|
||||
Reference in New Issue
Block a user