Skip to content

Commit

Permalink
fixes for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tgxn committed Nov 4, 2023
1 parent 2e49f96 commit 1fd15f9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 43 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lemmy-modder",
"version": "1.3.5",
"version": "1.3.7",
"description": "Lemmy Moderation App",
"author": "tgxn",
"license": "MIT",
Expand Down
10 changes: 1 addition & 9 deletions src/components/Content/Image.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useState, useEffect, useRef } from "react";
import React, { useState } from "react";

import { useImage } from "react-image";

import Box from "@mui/joy/Box";
import Modal from "@mui/joy/Modal";
import CircularProgress from "@mui/joy/CircularProgress";

const ContentSkeleton = React.memo(function ({ radius = "4px" }) {
Expand Down Expand Up @@ -68,13 +67,6 @@ export const Image = React.memo(({ imageSrc, blurPreview, onClick }) => {
useSuspense: false,
});

const [open, setOpen] = useState(false);
// const [image, setImage] = useState("false");

const handleClose = () => {
setOpen(false);
};

return (
<Box
sx={{
Expand Down
4 changes: 1 addition & 3 deletions src/components/Header/ConfigModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useDispatch, useSelector } from "react-redux";
import FormControl from "@mui/joy/FormControl";
import FormLabel from "@mui/joy/FormLabel";
import FormHelperText from "@mui/joy/FormHelperText";
import TextField from "@mui/joy/TextField";
import Autocomplete from "@mui/joy/Autocomplete";
import Box from "@mui/joy/Box";
import Button from "@mui/joy/Button";
import Modal from "@mui/joy/Modal";
import ModalDialog from "@mui/joy/ModalDialog";
import Switch from "@mui/joy/Switch";
Expand Down Expand Up @@ -70,7 +68,7 @@ function ArraySetting({ label, subtext, value, onChange }) {
placeholder={subtext}
options={[]}
getOptionLabel={(option) => option}
defaultValue={value}
defaultValue={[...value]}
onChange={(e, newval, reason) => {
console.log("onChange", newval, reason);
onChange(newval);
Expand Down
30 changes: 4 additions & 26 deletions src/components/Header/UserMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,42 @@ import React from "react";

import { useDispatch, useSelector } from "react-redux";

import { useQueryClient } from "@tanstack/react-query";
import { useQueryClient, useIsFetching } from "@tanstack/react-query";

import { Toaster, toast } from "sonner";

import { BrowserRouter as Router, useNavigate, useLocation } from "react-router-dom";

import Typography from "@mui/joy/Typography";
import Chip from "@mui/joy/Chip";
import Sheet from "@mui/joy/Sheet";
import Box from "@mui/joy/Box";
import Button from "@mui/joy/Button";
import Menu from "@mui/joy/Menu";
import MenuItem from "@mui/joy/MenuItem";
import IconButton from "@mui/joy/IconButton";
import CircularProgress from "@mui/joy/CircularProgress";

import CachedIcon from "@mui/icons-material/Cached";
import LogoutIcon from "@mui/icons-material/Logout";
import ArrowDropDown from "@mui/icons-material/ArrowDropDown";
import OpenInNewIcon from "@mui/icons-material/OpenInNew";

// user role icons
import VerifiedUserIcon from "@mui/icons-material/VerifiedUser";
import SupervisedUserCircleIcon from "@mui/icons-material/SupervisedUserCircle";
import AccountBoxIcon from "@mui/icons-material/AccountBox";
import DashboardIcon from "@mui/icons-material/Dashboard";
import SwitchAccountIcon from "@mui/icons-material/SwitchAccount";

import GitHubIcon from "@mui/icons-material/GitHub";

import FlagIcon from "@mui/icons-material/Flag";
import HowToRegIcon from "@mui/icons-material/HowToReg";

import { logoutCurrent, selectUsers } from "../../reducers/accountReducer";

import { LemmyHttp } from "lemmy-js-client";

import { useLemmyHttp, refreshAllData } from "../../hooks/useLemmyHttp";
import { getSiteData } from "../../hooks/getSiteData";

import { HeaderChip } from "../Display.jsx";
import { BasicInfoTooltip } from "../Tooltip.jsx";

import { parseActorId } from "../../utils.js";
import AccountMenu from "./AccountMenu.jsx";

import { addUser, setAccountIsLoading, setUsers, setCurrentUser } from "../../reducers/accountReducer";
import { selectAccountIsLoading } from "../../reducers/accountReducer";

export default function UserMenu() {
const dispatch = useDispatch();

const queryClient = useQueryClient();

const users = useSelector(selectUsers);
const accountIsLoading = useSelector(selectAccountIsLoading);

const { mutate: refreshMutate } = refreshAllData();

const [isLoading, setIsLoading] = React.useState(false);
const isFetching = useIsFetching();

const { baseUrl, siteData, localPerson, userRole } = getSiteData();

Expand Down
2 changes: 1 addition & 1 deletion src/components/ListItem/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default function CommentListItem({ report }) {
{/* <DeletePostButton report={report} /> */}
<RemoveCommentButton report={report} />

<Divider orientation="vertical" flexItem />
<Divider orientation="vertical" />

<BanUserCommunityButton person={report.comment_creator} community={report.community} />
<BanUserSiteButton person={report.comment_creator} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListItem/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function PostListItem({ report }) {
{/* @TODO Maybe only show purge is post is deleted?? */}
<PurgePostButton report={report} />

<Divider orientation="vertical" flexItem />
<Divider orientation="vertical" />

<BanUserCommunityButton person={report.post_creator} community={report.community} />
<BanUserSiteButton person={report.post_creator} />
Expand Down

0 comments on commit 1fd15f9

Please sign in to comment.