Skip to content

Commit

Permalink
fix modal switch and decryption functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
SammCheese committed Jan 14, 2023
1 parent d806df1 commit b8f6f80
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 74 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"discordID": "372148345894076416",
"github": "SammCheese"
},
"version": "1.1.1",
"version": "1.1.2",
"updater": {
"type": "github",
"id": "SammCheese/invisible-chat"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "invisible-chat",
"version": "1.1.1",
"version": "1.1.2",
"description": "Encrypt your Discord Messages",
"engines": {
"node": ">=14.0.0"
Expand Down Expand Up @@ -33,7 +33,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-react": "^7.31.10",
"prettier": "^2.8.1",
"replugged": "4.0.0-beta0.20",
"replugged": "4.0.0-beta0.21",
"tsx": "^3.10.3",
"typescript": "^4.8.4"
}
Expand Down
212 changes: 208 additions & 4 deletions pnpm-lock.yaml

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

31 changes: 10 additions & 21 deletions src/components/DecryptionModal.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import { common, components, webpack } from "replugged";
import { common, components } from "replugged";

import { buildEmbed, decrypt } from "../index";

const { React } = common;
const { Button, Modal } = components;
const { Button, Modal, Input, Text } = components;
const { closeModal, openModal } = common.modal;

const FormText = components.FormText.DEFAULT;

const rawTextInput: any = webpack.waitForModule(
webpack.filters.byProps("defaultProps", "Sizes", "contextType"),
);

let TextInput: any;

export async function initDecModal() {
TextInput = webpack.getExportsForProps(await rawTextInput, ["contextType"]);
}

let modalKey: any;

interface ModalProps {
Expand All @@ -33,17 +21,18 @@ function DecModal(props: ModalProps) {
return (
<Modal.ModalRoot {...props}>
<Modal.ModalHeader>
<FormText style={{ fontSize: "30px" }}>Decrypt Message</FormText>
<Text.H1 style={{ fontSize: "30px" }}>Decrypt Message</Text.H1>
</Modal.ModalHeader>
<Modal.ModalContent>
<FormText>Secret</FormText>
<TextInput defaultValue={secret} disabled={true}></TextInput>
<FormText>Password</FormText>
<TextInput
defaultValue={"password"}
<Text>Secret</Text>
{/* @ts-expect-error faulty type */}
<Input defaultValue={secret} disabled={true}></Input>
<Text>Password</Text>
<Input
placeholder="password"
onChange={(e: string) => {
setPassword(e);
}}></TextInput>
}}></Input>
<div style={{ marginTop: 10 }} />
</Modal.ModalContent>
<Modal.ModalFooter>
Expand Down
Loading

0 comments on commit b8f6f80

Please sign in to comment.