can hide nsfw in MangaSources
This commit is contained in:
@@ -38,6 +38,7 @@ export default function MangaSources() {
|
||||
const { setTitle, setAction } = useContext(NavbarContext);
|
||||
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', defualtLangs());
|
||||
const [showNsfw] = useLocalStorage<boolean>('showNsfw', false);
|
||||
|
||||
const [sources, setSources] = useState<ISource[]>([]);
|
||||
const [fetched, setFetched] = useState<boolean>(false);
|
||||
@@ -70,7 +71,9 @@ export default function MangaSources() {
|
||||
shownLangs.indexOf(lang) !== -1 && (
|
||||
<React.Fragment key={lang}>
|
||||
<h1 key={lang} style={{ marginLeft: 25 }}>{langCodeToName(lang)}</h1>
|
||||
{(list as ISource[]).map((source) => (
|
||||
{(list as ISource[])
|
||||
.filter((source) => showNsfw || !source.isNsfw)
|
||||
.map((source) => (
|
||||
<SourceCard
|
||||
key={source.id}
|
||||
source={source}
|
||||
|
||||
1
src/typings.d.ts
vendored
1
src/typings.d.ts
vendored
@@ -27,6 +27,7 @@ interface ISource {
|
||||
supportsLatest: boolean
|
||||
history: any
|
||||
isConfigurable: boolean
|
||||
isNsfw: boolean
|
||||
}
|
||||
|
||||
interface IMangaCard {
|
||||
|
||||
Reference in New Issue
Block a user