mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-05 07:20:13 +01:00
refactor: run formatter
This commit is contained in:
parent
416eba6ae6
commit
e572506d4f
@ -139,7 +139,7 @@ export class AuthService {
|
||||
|
||||
async updatePassword(user: User, newPassword: string, oldPassword?: string) {
|
||||
const isPasswordValid =
|
||||
!user.password || await argon.verify(user.password, oldPassword);
|
||||
!user.password || (await argon.verify(user.password, oldPassword));
|
||||
|
||||
if (!isPasswordValid) throw new ForbiddenException("Invalid password");
|
||||
|
||||
|
@ -1,4 +1,11 @@
|
||||
import { Button, Center, Stack, Text, Title, useMantineTheme } from "@mantine/core";
|
||||
import {
|
||||
Button,
|
||||
Center,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
useMantineTheme,
|
||||
} from "@mantine/core";
|
||||
import { modals } from "@mantine/modals";
|
||||
import Link from "next/link";
|
||||
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
|
||||
@ -116,41 +123,38 @@ const ImagePreview = () => {
|
||||
|
||||
const TextPreview = () => {
|
||||
const { shareId, fileId } = React.useContext(FilePreviewContext);
|
||||
const [ text, setText ] = useState<string>("");
|
||||
const [text, setText] = useState<string>("");
|
||||
const { colorScheme } = useMantineTheme();
|
||||
|
||||
useEffect(() => {
|
||||
api
|
||||
.get(`/shares/${shareId}/files/${fileId}?download=false`)
|
||||
.then((res) => setText(res.data ?? "Preview couldn't be fetched."));
|
||||
}, [ shareId, fileId ]);
|
||||
}, [shareId, fileId]);
|
||||
|
||||
const options = {
|
||||
overrides: {
|
||||
pre: {
|
||||
props: {
|
||||
style: {
|
||||
backgroundColor: colorScheme == "dark"
|
||||
? "rgba(50, 50, 50, 0.5)"
|
||||
: "rgba(220, 220, 220, 0.5)",
|
||||
backgroundColor:
|
||||
colorScheme == "dark"
|
||||
? "rgba(50, 50, 50, 0.5)"
|
||||
: "rgba(220, 220, 220, 0.5)",
|
||||
padding: "0.75em",
|
||||
whiteSpace: "pre-wrap",
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
table: {
|
||||
props: {
|
||||
className: "md"
|
||||
}
|
||||
}
|
||||
}
|
||||
className: "md",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<Markdown options={options}>
|
||||
{text}
|
||||
</Markdown>
|
||||
);
|
||||
return <Markdown options={options}>{text}</Markdown>;
|
||||
};
|
||||
|
||||
const PdfPreview = () => {
|
||||
|
@ -8,11 +8,13 @@ const GlobalStyle = () => {
|
||||
color: "inherit",
|
||||
textDecoration: "none",
|
||||
},
|
||||
"table.md, table.md th:nth-of-type(odd), table.md td:nth-of-type(odd)": {
|
||||
background: theme.colorScheme == "dark"
|
||||
? "rgba(50, 50, 50, 0.5)"
|
||||
: "rgba(220, 220, 220, 0.5)",
|
||||
},
|
||||
"table.md, table.md th:nth-of-type(odd), table.md td:nth-of-type(odd)":
|
||||
{
|
||||
background:
|
||||
theme.colorScheme == "dark"
|
||||
? "rgba(50, 50, 50, 0.5)"
|
||||
: "rgba(220, 220, 220, 0.5)",
|
||||
},
|
||||
"table.md td": {
|
||||
paddingLeft: "0.5em",
|
||||
paddingRight: "0.5em",
|
||||
|
Loading…
Reference in New Issue
Block a user