Skip to content

Commit

Permalink
Migrate Ons.Fab
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Oct 31, 2023
1 parent cdffc76 commit f1f4f47
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 1 addition & 4 deletions Website/src/activitys/MainApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import FetchTextActivity from "./FetchTextActivity";
import ModuleFragment from "./fragments/ModuleFragment";
import TerminalActivity from "./TerminalActivity";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import DeviceModule from "@Components/DeviceModule";
import ModuleViewActivity from "./ModuleViewActivity";
import CreateNewFolderIcon from "@mui/icons-material/CreateNewFolder";
Expand All @@ -26,12 +24,12 @@ import { useNewerVersion } from "@Hooks/useNewerVersion";
import { ExploreModule } from "@Components/ExploreModule";
import { useSettings } from "@Hooks/useSettings";
import { useTheme } from "@Hooks/useTheme";
import { Fab } from "react-onsenui";
import { AnimatePresence, motion } from "framer-motion";
import InputBase from "@mui/material/InputBase";
import SearchIcon from "@mui/icons-material/Search";
import ClearIcon from "@mui/icons-material/Clear";
import { useModConf } from "@Hooks/useModConf";
import Fab from "@Components/onsenui/Fab";

interface SearchbarRef {
clear(): void;
Expand Down Expand Up @@ -159,7 +157,6 @@ const MainApplication = () => {
renderItem={(module, key) => <DeviceModule key={key} module={module} />}
renderFixed={() => {
return (
// @ts-ignore
<Fab
onClick={() => {
Chooser.getFile(
Expand Down
14 changes: 14 additions & 0 deletions Website/src/components/onsenui/Fab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "onsenui/esm/elements/ons-fab";
import onsCustomElement from "@Util/onsCustomElement";

export interface FabProps extends React.PropsWithChildren {
modifier?: string;
ripple?: boolean;
position?: string;
disabled?: boolean;
onClick?: React.MouseEventHandler<HTMLElement>;
}

export const Fab = onsCustomElement<HTMLElement, FabProps>("ons-fab")({});

export default Fab;
1 change: 1 addition & 0 deletions Website/src/typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ declare global {
"ons-tab": HTMLAttributes<HTMLElement>;
"ons-gesture-detector": HTMLAttributes<HTMLElement>;
"ons-bottom-toolbar": HTMLAttributes<HTMLElement>;
"ons-fab": HTMLAttributes<HTMLElement>;
}
}

Expand Down

0 comments on commit f1f4f47

Please sign in to comment.