diff --git a/app/assets/mui/themes/home.ts b/app/assets/mui/themes/home.ts
index e43fe21..06c93d0 100644
--- a/app/assets/mui/themes/home.ts
+++ b/app/assets/mui/themes/home.ts
@@ -67,6 +67,17 @@ const customTheme = (outerTheme: Theme) =>
},
}
}
+ },
+ MuiPaper: {
+ styleOverrides: {
+ root: {
+ '--TextField-brandBorderColor': '#E0E3E7',
+ backgroundColor: '#282c34',
+ color: 'var(--TextField-brandBorderColor)',
+ width: '90%',
+ maxWidth: '90%!important'
+ }
+ }
}
}
});
diff --git a/app/assets/styles/home.css b/app/assets/styles/home.css
index decc0e6..7fc93b8 100644
--- a/app/assets/styles/home.css
+++ b/app/assets/styles/home.css
@@ -32,4 +32,50 @@
.loader {
text-align: center;
+}
+
+.report-tag {
+ --main-color: #E0E3E7;
+ --hover-color: #6F7E8C;
+ --tag-color-good: #25cc00;
+ --tag-color-ok: #ffdf00;
+ --tag-color-bad: #cc5e00;
+ --tag-color-very-bad: #d10000;
+ border-radius: 20px;
+ padding: 5px 10px;
+ cursor: default;
+ border: 1px solid var(--main-color);
+ color: var(--main-color);
+ margin-right: 10px;
+ &:hover {
+ border: 1px solid var(--hover-color);
+ color: var(--hover-color);
+ > .report-tag-count-good {
+ color: var(--tag-color-good);
+ }
+ > .report-tag-count-ok {
+ color: var(--tag-color-ok);
+ }
+ > .report-tag-count-bad {
+ color: var(--tag-color-bad);
+ }
+ > .report-tag-count-very-bad {
+ color: var(--tag-color-very-bad);
+ }
+ }
+}
+
+.report-tag-list {
+ display: flex;
+ margin-top: 10px;
+}
+
+.report-comment:hover {
+ background-color: #383d49;
+ cursor: default;
+}
+
+.report-nickname:hover {
+ background-color: #383d49;
+ cursor: default;
}
\ No newline at end of file
diff --git a/app/components/itemDialog.tsx b/app/components/itemDialog.tsx
new file mode 100644
index 0000000..f1a85f9
--- /dev/null
+++ b/app/components/itemDialog.tsx
@@ -0,0 +1,107 @@
+import type {BlacklistItem} from "~/classes/blacklistItem";
+import {List, Dialog, DialogContent, DialogTitle, ListItem, ListItemText, Divider} from "@mui/material";
+
+function NicknameList({nicknames}: {nicknames: string[]|undefined}){
+ if (!nicknames){
+ return (<>>)
+ }
+ if (nicknames.length > 0){
+ return (
+ <>
+
Nicknames:
+
+ {nicknames.map((item) => {
+ return {item}
+ })}
+
+ >
+ )
+ } else {
+ return (<>>)
+ }
+}
+
+function CommentsList({comments}: {comments: string[]|undefined}){
+ if (!comments){
+ return (<>>)
+ }
+ if (comments.length > 0){
+ return (
+ <>
+ Comments:
+
+ {comments.map((item) => {
+ return {item}
+ })}
+
+ >
+ )
+ } else {
+ return (<>>)
+ }
+}
+
+function Tag({tag, name}:{tag: number|undefined, name: string}){
+ let classColor = "report-tag-count-good";
+ if (tag){
+ if (tag <= 10){
+ classColor = "report-tag-count-good";
+ } else if (tag > 10 && tag <= 25) {
+ classColor = "report-tag-count-ok";
+ } else if (tag > 25 && tag <= 50) {
+ classColor = "report-tag-count-bad";
+ } else {
+ classColor = "report-tag-count-very-bad";
+ }
+ }
+
+ return (
+ <>
+
+ {tag}
+ {name}
+
+ >
+ )
+}
+
+function TagList({afk, cheater, griefer, toxic, useless, smurf}:{afk: number|undefined, cheater: number|undefined, griefer: number|undefined, toxic: number|undefined, useless: number|undefined, smurf: number|undefined}){
+ return (
+ <>
+
+
+
+
+
+
+
+
+ >
+ )
+}
+
+export default function ItemDialog({ blacklistItem, open, handleClose }: { blacklistItem: BlacklistItem|null, open: boolean, handleClose: Function }){
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/app/components/itemList.tsx b/app/components/itemList.tsx
index 40f78f9..14a8568 100644
--- a/app/components/itemList.tsx
+++ b/app/components/itemList.tsx
@@ -1,7 +1,7 @@
import {BlacklistItem} from "~/classes/blacklistItem";
import {Button, CircularProgress} from "@mui/material";
-export default function ItemList({ isFetching, blacklistItems }: { isFetching: boolean, blacklistItems: BlacklistItem[] }) {
+export default function ItemList({ isFetching, blacklistItems, showDialog }: { isFetching: boolean, blacklistItems: BlacklistItem[], showDialog: Function }) {
if (isFetching){
return(
@@ -13,7 +13,7 @@ export default function ItemList({ isFetching, blacklistItems }: { isFetching: b
{blacklistItems.map((item) => {
- return
+ return
})}
diff --git a/app/routes/home.tsx b/app/routes/home.tsx
index 0bd9f53..f69388c 100644
--- a/app/routes/home.tsx
+++ b/app/routes/home.tsx
@@ -11,6 +11,7 @@ import customTheme from "~/assets/mui/themes/home";
import {BlacklistItem} from "~/classes/blacklistItem";
import {ResponseError} from "~/classes/responseError";
import ItemList from "~/components/itemList";
+import ItemDialog from "~/components/itemDialog";
export default function Home() {
const outerTheme = useTheme();
@@ -18,6 +19,8 @@ export default function Home() {
const [searchText, setSearchText] = useState('');
const [isFetchingList, setIsFetchingList] = useState(false);
const [blacklistItems, setBlacklistItems] = useState
([]);
+ const [showDialog, setShowDialog] = useState(false);
+ const [currentDialogBlacklistItem, setCurrentDialogBlacklistItem] = useState(null);
useEffect(() => {
let isIgnore = false;
@@ -42,6 +45,16 @@ export default function Home() {
setSearchText(text);
}
+ function handleItemClick(item: BlacklistItem){
+ setCurrentDialogBlacklistItem(item);
+ console.log(item);
+ setShowDialog(true);
+ }
+
+ const handleDialogClose = () => {
+ setShowDialog(false);
+ };
+
return (
@@ -58,14 +71,8 @@ export default function Home() {
-
- {/*
*/}
- {/*
*/}
- {/* {blacklistItems.map((item, i) => {*/}
- {/* return */}
- {/* })}*/}
- {/*
*/}
- {/*
*/}
+
+
);