From 8657cdbfcfff3577edc6ff17c04590fcd2e635c3 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Sat, 26 Aug 2023 14:20:33 +0200 Subject: [PATCH] Some imrpvements --- Website/src/activitys/DescriptonActivity.tsx | 2 +- Website/src/activitys/ModuleViewActivity.tsx | 303 ++++++++++++------- Website/src/components/ExploreModule.tsx | 38 +-- Website/src/components/onsenui/Toolbar.tsx | 21 +- Website/src/hooks/useCategory.ts | 18 +- Website/src/hooks/useSupportIconForUrl.tsx | 36 ++- Website/src/typings/global.d.ts | 2 +- 7 files changed, 253 insertions(+), 167 deletions(-) diff --git a/Website/src/activitys/DescriptonActivity.tsx b/Website/src/activitys/DescriptonActivity.tsx index c2f39086..f7c3ff6d 100644 --- a/Website/src/activitys/DescriptonActivity.tsx +++ b/Website/src/activitys/DescriptonActivity.tsx @@ -274,7 +274,7 @@ function DescriptonActivity() { }} > - + {/* */} Support diff --git a/Website/src/activitys/ModuleViewActivity.tsx b/Website/src/activitys/ModuleViewActivity.tsx index 716121c2..0b6e4362 100644 --- a/Website/src/activitys/ModuleViewActivity.tsx +++ b/Website/src/activitys/ModuleViewActivity.tsx @@ -38,13 +38,22 @@ import { os } from "@Native/Os"; import { Markup } from "@Components/Markdown"; import Alert from "@mui/material/Alert"; import AlertTitle from "@mui/material/AlertTitle"; -import { useCategory } from "@Hooks/useCategory"; +import { useFilterCategory } from "@Hooks/useCategory"; +import { useFormatDate } from "@Hooks/useFormatDate"; +import Chip from "@mui/material/Chip"; +import CodeRoundedIcon from "@mui/icons-material/CodeRounded"; +import Icon from "@Components/Icon"; +import CardMedia from "@mui/material/CardMedia"; +import DevicesIcon from "@mui/icons-material/Devices"; +import ButtonGroup from "@mui/material/ButtonGroup"; +import { useSupportIconForUrl } from "@Hooks/useSupportIconForUrl"; type Extra = { module: ModuleProps; notes_url: string; zip_url: string; authorData?: any; + last_update: string; }; const ModuleViewActivity = () => { @@ -55,7 +64,7 @@ const ModuleViewActivity = () => { const [open, setOpen] = React.useState(false); const [scroll, setScroll] = React.useState("paper"); - const { notes_url, zip_url, authorData } = extra; + const { notes_url, zip_url, authorData, last_update } = extra; const { name, author, @@ -69,14 +78,16 @@ const ModuleViewActivity = () => { minMagisk, minApi, maxApi, + mmrlCover, needRamdisk, - mmrlCaregory, + mmrlCategory, changeBoot, } = extra.module; - const { category, validCategory } = useCategory(mmrlCaregory); - + const categories = useFilterCategory(mmrlCategory); const { data } = useFetch(notes_url); + const formatLastUpdate = useFormatDate(last_update); + const { SupportIcon, supportText } = useSupportIconForUrl(support); const handleClickOpen = (scrollType: DialogProps["scroll"]) => () => { setOpen(true); @@ -87,13 +98,30 @@ const ModuleViewActivity = () => { setOpen(false); }; + console.log(categories); + const renderToolbar = () => { return ( - - - {name} - + + + + MMRL + @@ -105,53 +133,132 @@ const ModuleViewActivity = () => { return ( ({ - pt: 0, - pl: 2, - pr: 2, - pb: 2, + // pt: 0, + // pl: 2, + // pr: 2, + // pb: 2, + position: "relative", + zIndex: 9, backgroundColor: theme.palette.primary.main, color: "white", - display: "flex", + // display: "flex", })} - wrapper="div" - onDisappear={(visible) => { - setTitleShow(!visible); - }} > - ({ + //background: '-webkit-gradient(linear,left bottom,left top,from(rgb(32,33,36)),color-stop(56%,rgba(0,0,0,0)))', + //background: '-webkit-linear-gradient(bottom,rgb(32,33,36) 0,rgba(0,0,0,0) 56%)', + background: `linear-gradient(to top,${theme.palette.primary.main} 0,rgba(0,0,0,0) 56%)`, + })} + > + ({ + zIndex: -1, + display: "block", + position: "relative", + height: "calc(calc(100vw - 48px)*9/16)", + objectFit: "cover", + // width: "calc(100% - 16px)", + })} + image={mmrlCover} + alt={name} + /> + + )} + + ({ - bgcolor: scheme[300], - width: 100, - height: 100, - boxShadow: "0 -1px 5px rgba(0,0,0,.09), 0 3px 5px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.15)", - borderRadius: theme.shape.borderRadius, - mr: 1.5, - fontSize: 50, + pt: mmrlCover ? 0 : 2, + pl: 2, + pr: 2, + pb: 2, + backgroundColor: theme.palette.primary.main, + color: "white", + display: "flex", + flexDirection: "column", + alignItems: "flex-start", })} - src={mmrlLogo} > - {name.charAt(0).toUpperCase()} - + + ({ + bgcolor: scheme[300], + width: 100, + height: 100, + boxShadow: "0 -1px 5px rgba(0,0,0,.09), 0 3px 5px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.15)", + borderRadius: "20%", + mr: 1.5, + fontSize: 50, + })} + src={mmrlLogo} + > + {name.charAt(0).toUpperCase()} + - - - {name} - - - {mmrlAuthor && authorData ? {authorData.username ? authorData.username : author} : {author}} - {authorData?.options?.roles?.verified && } - - - - - {version} ({versionCode}) + + + {name} - + + {mmrlAuthor && authorData ? {authorData.username ? authorData.username : author} : {author}} + {authorData?.options?.roles?.verified && } + + + + + + + {version} ({versionCode}) + + + + {support && ( + + )} -