mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-11 10:26:21 +00:00
Update imports and add sort menu to NoteModal component
This commit is contained in:
parent
f1e1d2c2d0
commit
caec2ca309
1 changed files with 9 additions and 4 deletions
|
@ -8,7 +8,7 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||||
import { findByProps } from "@webpack";
|
import { findByProps } from "@webpack";
|
||||||
import { ContextMenuApi, Flex, Menu, React, TabBar, Text, TextInput } from "@webpack/common";
|
import { ContextMenuApi, Flex, FluxDispatcher, Menu, React, TabBar, Text, TextInput } from "@webpack/common";
|
||||||
import noteHandler from "plugins/holynotes/noteHandler";
|
import noteHandler from "plugins/holynotes/noteHandler";
|
||||||
import { HolyNotes } from "plugins/holynotes/types";
|
import { HolyNotes } from "plugins/holynotes/types";
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<ModalRoot {...props} className={classes("vc-notebook")} size={ModalSize.LARGE} style={{ borderRadius: "8px" }}>
|
<ModalRoot {...props} className={classes("vc-notebook")} size={ModalSize.LARGE}>
|
||||||
<Flex className={classes("vc-notebook-flex")} direction={Flex.Direction.VERTICAL} style={{ width: "100%" }}>
|
<Flex className={classes("vc-notebook-flex")} direction={Flex.Direction.VERTICAL} style={{ width: "100%" }}>
|
||||||
<div className={classes("vc-notebook-top-section")}>
|
<div className={classes("vc-notebook-top-section")}>
|
||||||
<ModalHeader className={classes("vc-notebook-header-main")}>
|
<ModalHeader className={classes("vc-notebook-header-main")}>
|
||||||
|
@ -131,7 +131,11 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
||||||
className={quickSelect}
|
className={quickSelect}
|
||||||
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
|
onClick={(event: React.MouseEvent<HTMLDivElement>) => {
|
||||||
ContextMenuApi.openContextMenu(event, () => (
|
ContextMenuApi.openContextMenu(event, () => (
|
||||||
<>
|
<Menu.Menu
|
||||||
|
navId="sort-menu"
|
||||||
|
onClose={() => FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })}
|
||||||
|
aria-label="Sort Menu"
|
||||||
|
>
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
label="Ascending / Date Added"
|
label="Ascending / Date Added"
|
||||||
id="ada"
|
id="ada"
|
||||||
|
@ -157,7 +161,8 @@ export const NoteModal = (props: ModalProps & { onClose: () => void; }) => {
|
||||||
setSortDirection(false);
|
setSortDirection(false);
|
||||||
setSortType(false);
|
setSortType(false);
|
||||||
}} />
|
}} />
|
||||||
</>
|
</Menu.Menu>
|
||||||
|
|
||||||
));
|
));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue