Skip to content

Commit

Permalink
fix: update mui and plausible
Browse files Browse the repository at this point in the history
  • Loading branch information
LowderPlay committed Jan 22, 2025
1 parent 4ec8aeb commit 6011b15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 14 additions & 6 deletions src/components/AccountSelectButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import {Box, ButtonBase, CircularProgress, Stack, SvgIcon, SxProps, Theme, Typography} from "@mui/material";
import {
Box,
ButtonBase,
CircularProgress,
Stack,
SvgIcon,
SxProps,
Theme,
TouchRippleActions,
Typography
} from "@mui/material";
import {FC, useContext, useEffect, useRef, useState} from "react";
import { icons } from "../globals";
import SVG from 'react-inlinesvg';
Expand All @@ -9,7 +19,6 @@ import {DragTypes, wobbleAnimation} from "../drag.ts";
import {getEmptyImage} from "react-dnd-html5-backend";
import {StorageManagerContext} from "../managers/storage/storage.tsx";
import useTelegramHaptics from "../hooks/telegram/useTelegramHaptics.ts";
import TouchRipple, {TouchRippleActions} from "@mui/material/ButtonBase/TouchRipple.js";

export interface AccountSelectButtonProps {
id: string;
Expand Down Expand Up @@ -44,7 +53,7 @@ const AccountSelectButton: FC<AccountSelectButtonProps> = (props) => {
const storageManager = useContext(StorageManagerContext);
const { impactOccurred } = useTelegramHaptics();

const rippleRef = useRef<TouchRippleActions>();
const rippleRef = useRef<TouchRippleActions>(null);

const [isHolding, setHolding] = useState<boolean>(false);
const [isTouching, setTouching] = useState<boolean>(false);
Expand Down Expand Up @@ -94,7 +103,7 @@ const AccountSelectButton: FC<AccountSelectButtonProps> = (props) => {
}
},
});
const ref = useRef();
const ref = useRef(null);
drag(drop(ref));

return <ButtonBase component="div"
Expand All @@ -104,7 +113,7 @@ const AccountSelectButton: FC<AccountSelectButtonProps> = (props) => {
opacity: isDragging ? 0: 1,
...(isHolding ? wobbleAnimation : {})
}}
disableRipple={true}
touchRippleRef={rippleRef}
onClick={onClick}
onTouchMove={() => {
if(!isHolding) {
Expand All @@ -118,7 +127,6 @@ const AccountSelectButton: FC<AccountSelectButtonProps> = (props) => {
onTouchEnd={() => { setTouching(false); }}
onTouchStart={() => { setTouching(true); }}
>
<TouchRipple ref={rippleRef}/>
<Box sx={{bgcolor: selected ? theme.palette.primary.main : theme.palette.background.paper,
padding: theme.spacing(1), borderRadius: "6px"}} ref={ref}>
<Stack alignItems="center" spacing={1} justifyContent="space-between">
Expand Down
4 changes: 1 addition & 3 deletions src/components/PlausibleAnalytics.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {createContext, FC, PropsWithChildren, useEffect, useMemo} from "react";
import Plausible from "plausible-tracker";
import {EventOptions} from "plausible-tracker/src/lib/request.ts";
import {PlausibleOptions} from "plausible-tracker/src/lib/tracker.ts";
import Plausible, {EventOptions, PlausibleOptions} from "plausible-tracker";

/**
* PlausibleAnalytics is responsible for tracking custom event goals.
Expand Down

0 comments on commit 6011b15

Please sign in to comment.