Skip to content

Commit

Permalink
Added module covers
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Jul 12, 2023
1 parent 8c7b127 commit 6d030d4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ description=<string>
# MMRL supported properties
mmrlConfig=<boolean>
mmrlNoComments=<boolean>
mmrlCover=<url>

# Fox's Mmm supported properties
minApi=<int>
Expand Down
17 changes: 17 additions & 0 deletions Website/src/activitys/SettingsActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ function SettingsActivity() {
}}
/>
</ListItem>
<ListItem>
<StyledListItemText
id="switch-list-_disable_module_covers"
primary={"Disable module covers"}
secondary="This may increase app performance"
/>
<Android12Switch
edge="end"
onChange={(e: any) => {
setSettings("_disable_module_covers", e.target.checked);
}}
checked={settings._disable_module_covers}
inputProps={{
"aria-labelledby": "switch-list-_disable_module_covers",
}}
/>
</ListItem>
{os.isAndroid && (
<ListItem>
<StyledListItemText
Expand Down
13 changes: 12 additions & 1 deletion Website/src/components/ExploreModule.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, AlertTitle, Box, Chip, Divider, Stack, Typography } from "@mui/material";
import { Alert, AlertTitle, Box, CardMedia, Chip, Divider, Stack, Typography } from "@mui/material";
import { useActivity } from "@Hooks/useActivity";
import { useStrings } from "@Hooks/useStrings";
import DescriptonActivity from "@Activitys/DescriptonActivity";
Expand All @@ -8,6 +8,7 @@ import { StyledCard } from "./StyledCard";
import { useLowQualityModule } from "@Hooks/useLowQualityModule";
import { StyledIconButton } from "./StyledIconButton";
import { useSettings } from "@Hooks/useSettings";
import { isDesktop } from "react-device-detect";

interface Props {
index: number;
Expand Down Expand Up @@ -65,6 +66,16 @@ export const ExploreModule = (props: Props) => {

return (
<StyledCard elevation={0}>
{!settings._disable_module_covers && prop_url.mmrlCover && (
// @ts-ignore
<CardMedia
component="img"
style={{ objectFit: "unset" }}
height={isDesktop ? "445px" : "181.500px"}
image={prop_url.mmrlCover}
alt={prop_url.name}
/>
)}
<Box sx={{ p: 2, display: "flex" }}>
<Stack spacing={0.5} style={{ flexGrow: 1 }} onClick={handleOpen}>
<Typography fontWeight={700} color="text.primary">
Expand Down
2 changes: 2 additions & 0 deletions Website/src/hooks/useSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export interface StorageDeclaration {
eruda_console_enabled: boolean;
disabled_repos: string[];
_low_quality_module: boolean;
_disable_module_covers: boolean;
__experimental_local_install: boolean;
repos: StoredRepo[];
test: any;
Expand All @@ -152,6 +153,7 @@ export const INITIAL_SETTINGS: StorageDeclaration = {
eruda_console_enabled: false,
disabled_repos: [],
_low_quality_module: true,
_disable_module_covers: false,
__experimental_local_install: false,
repos: [],
test: [],
Expand Down
2 changes: 1 addition & 1 deletion Website/src/typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ declare global {

// MMRL supported properties
mmrlConfig?: string;
mmrlChangelog?: string;
mmrlNoComments?: string;
mmrlCover?: string;

// Fox's Mmm supported properties
minApi?: string;
Expand Down

0 comments on commit 6d030d4

Please sign in to comment.