1
0
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:
Elias Schneider 2024-02-05 16:11:49 +01:00
parent 416eba6ae6
commit e572506d4f
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C
3 changed files with 29 additions and 23 deletions

View File

@ -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");

View File

@ -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 = () => {

View File

@ -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",