Skip to content

Commit

Permalink
Merge pull request #113 from tgxn/develop
Browse files Browse the repository at this point in the history
Release [1.3.9]
  • Loading branch information
tgxn authored Nov 7, 2023
2 parents c8c5eff + a558e89 commit 17d4ca7
Show file tree
Hide file tree
Showing 40 changed files with 1,270 additions and 237 deletions.
19 changes: 17 additions & 2 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lemmy-modder",
"version": "1.3.8",
"version": "1.3.9",
"description": "Lemmy Moderation App",
"author": "tgxn",
"license": "MIT",
Expand Down Expand Up @@ -45,6 +45,8 @@
"react-redux": "^8.1.1",
"react-router-dom": "^6.18.0",
"redux": "^4.2.1",
"remove-markdown": "^0.5.0",
"redux-persist": "^6.0.0",
"sass": "^1.69.5",
"sass-loader": "^13.3.2",
"sonner": "^1.1.0",
Expand Down
51 changes: 47 additions & 4 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import Dashboard from "./pages/Dashboard";
import Actions from "./pages/Actions";
import Approvals from "./pages/Approvals";
import Reports from "./pages/Reports";
import Messages from "./pages/Messages";
import Login from "./pages/Login";

import AppStore from "./store";
import { selectIsInElectron } from "./reducers/configReducer";
import { selectCurrentUser } from "./reducers/accountReducer";
import { store } from "./redux/store";
import { selectIsInElectron } from "./redux/reducer/configReducer";
import { selectCurrentUser } from "./redux/reducer/accountReducer";

function PageRouter() {
const theme = useTheme();
Expand Down Expand Up @@ -182,6 +183,48 @@ function PageRouter() {
</Box>
}
/>
<Route
path="/messages"
element={
<Box
sx={{
overflow: "auto",
height: "calc(100% - 50px)",
width: "100%",
}}
>
<Container
maxWidth={"lg"}
sx={{
py: 2,
}}
>
<Messages />
</Container>
</Box>
}
/>
<Route
path="/messages/:user"
element={
<Box
sx={{
overflow: "auto",
height: "calc(100% - 50px)",
width: "100%",
}}
>
<Container
maxWidth={"lg"}
sx={{
py: 2,
}}
>
<Messages />
</Container>
</Box>
}
/>
</Routes>
</Box>
</HashRouter>
Expand All @@ -195,7 +238,7 @@ export default function App() {
<QueryClientProvider client={queryClient}>
<ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-left" />

<Provider store={AppStore}>
<Provider store={store}>
<PageRouter />
</Provider>
</QueryClientProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Actions/CommentButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useLemmyHttpAction } from "../../hooks/useLemmyHttp.js";

import { BaseActionButton, ActionConfirmButton, InputElement, ConfirmDialog } from "./BaseElements.jsx";
import { getSiteData } from "../../hooks/getSiteData";
import { selectShowResolved, selectMandatoryModComment } from "../../reducers/configReducer.js";
import { selectShowResolved, selectMandatoryModComment } from "../../redux/reducer/configReducer.js";

export const ResolveCommentReportButton = ({ report, ...props }) => {
const queryClient = useQueryClient();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Actions/GenButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ConfirmDialog,
} from "./BaseElements.jsx";

import { selectMandatoryModComment } from "../../reducers/configReducer";
import { selectMandatoryModComment } from "../../redux/reducer/configReducer";

// banFromCommunity
export const BanUserCommunityButton = ({ person, community, isBanned, ...props }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Actions/PMButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useLemmyHttpAction } from "../../hooks/useLemmyHttp.js";

import { BaseActionButton, ActionConfirmButton, InputElement, ConfirmDialog } from "./BaseElements.jsx";
import { getSiteData } from "../../hooks/getSiteData";
import { selectShowResolved, selectMandatoryModComment } from "../../reducers/configReducer.js";
import { selectShowResolved, selectMandatoryModComment } from "../../redux/reducer/configReducer.js";

// allow resolving / unresolving a post report
// resolvePrivateMessageReport
Expand Down
4 changes: 2 additions & 2 deletions src/components/Actions/PostButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { useLemmyHttpAction } from "../../hooks/useLemmyHttp.js";

import { BaseActionButton, ActionConfirmButton, InputElement, ConfirmDialog } from "./BaseElements.jsx";
import { getSiteData } from "../../hooks/getSiteData";
import { selectShowResolved } from "../../reducers/configReducer.js";
import { selectShowResolved } from "../../redux/reducer/configReducer.js";

import { selectMandatoryModComment } from "../../reducers/configReducer";
import { selectMandatoryModComment } from "../../redux/reducer/configReducer";

// allow resolving / unresolving a post report
export const ResolvePostReportButton = ({ report, ...props }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Actions/RegistrationButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useLemmyHttpAction } from "../../hooks/useLemmyHttp.js";
import { getSiteData } from "../../hooks/getSiteData";

import { BaseActionButton, ActionConfirmButton, InputElement, ConfirmDialog } from "./BaseElements.jsx";
import { selectHideReadApprovals } from "../../reducers/configReducer.js";
import { selectHideReadApprovals } from "../../redux/reducer/configReducer.js";

export const ApproveButton = ({ registration, ...props }) => {
const queryClient = useQueryClient();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Content/PostThumb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import LaunchIcon from "@mui/icons-material/Launch";
import { SanitizedLink } from "../Display.jsx";
import { Image, Video } from "./Image.jsx";

import { selectBlurNsfw, selectNsfwWords } from "../../reducers/configReducer";
import { selectBlurNsfw, selectNsfwWords } from "../../redux/reducer/configReducer";

function ThumbWrapper({ width = 200, tooltip, modal = null, children }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Checkbox from "@mui/joy/Checkbox";

import Chip from "@mui/joy/Chip";

import { selectFilterCommunity, selectFilterType, selectHideReadApprovals, selectModLogType, selectShowRemoved, selectShowResolved, setConfigItem } from "../reducers/configReducer";
import { selectFilterCommunity, selectFilterType, selectHideReadApprovals, selectModLogType, selectShowRemoved, selectShowResolved, setConfigItem } from "../redux/reducer/configReducer";

import { getSiteData } from "../hooks/getSiteData";
import { getModLogTypeNames } from "../utils";
Expand Down
16 changes: 4 additions & 12 deletions src/components/Header/AccountMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { useQueryClient } from "@tanstack/react-query";
import { LemmyHttp } from "lemmy-js-client";
import { Toaster, toast } from "sonner";

import Button from "@mui/joy/Button";
import Menu from "@mui/joy/Menu";
import MenuList from "@mui/joy/MenuList";
import MenuButton from "@mui/joy/MenuButton";
import Dropdown from "@mui/joy/Dropdown";
import MenuItem from "@mui/joy/MenuItem";
Expand All @@ -19,10 +17,9 @@ import ListItemContent from "@mui/joy/ListItemContent";
// 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 ArrowDropDown from "@mui/icons-material/ArrowDropDown";

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

import { getSiteData } from "../../hooks/getSiteData";

Expand All @@ -31,7 +28,7 @@ import { BasicInfoTooltip } from "../Tooltip.jsx";

import { parseActorId, getUserRole } from "../../utils.js";

import { setAccountIsLoading, setCurrentUser } from "../../reducers/accountReducer";
import { setAccountIsLoading, setCurrentUser } from "../../redux/reducer/accountReducer";

import { RoleIcons } from "../Shared/Icons.jsx";
import { Typography } from "@mui/material";
Expand Down Expand Up @@ -78,7 +75,7 @@ function UserListItem({ user }) {
}

// TODO we need to update the user's details in the saved accounts array too, if this is a saved session
dispatch(setCurrentUser(user.base, user.jwt, getSite));
dispatch(setCurrentUser({base: user.base, jwt: user.jwt, site: getSite}));
} catch (e) {
toast(typeof e == "string" ? e : e.message);
} finally {
Expand Down Expand Up @@ -125,16 +122,11 @@ export default function AccountMenu() {
startDecorator={<UserAvatar size="20px" source={localPerson?.avatar} />}
endDecorator={<ArrowDropDown />}
sx={{
mx: 1,
mx: 1, // margin on both sides of the button
borderRadius: 4,

// fontSize: "14px",
// overflow: "hidden",
display: "flex",
// flexDirection: "row",
alignItems: "center",
justifyContent: "center",
// gap: 1,
}}
>
<Typography sx={{ pr: 1 }}>
Expand Down
5 changes: 2 additions & 3 deletions src/components/Header/ConfigModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ import Divider from "@mui/joy/Divider";
import {
selectMandatoryModComment,
setConfigItem,
setConfigItemJson,
selectBlurNsfw,
selectShowAvatars,
selectNsfwWords,
} from "../../reducers/configReducer";
} from "../../redux/reducer/configReducer";

function BooleanSetting({ label, subtext, value, onChange }) {
return (
Expand Down Expand Up @@ -133,7 +132,7 @@ export default function ConfigModal({ open, onClose }) {
label="NSFW Words List"
subtext="list of words to also mark as NSFW"
value={nsfwWords}
onChange={(e) => dispatch(setConfigItemJson("nsfwWords", e))}
onChange={(e) => dispatch(setConfigItem("nsfwWords", e))}
/>
)}
</Box>
Expand Down
Loading

0 comments on commit 17d4ca7

Please sign in to comment.