Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

refactor(paste): clean up code formatting in PasteCreatePanel and PasteLinkCard

Aswin Asok1c0e2c5980cd
diff --git a/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx b/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
index 2134ae1965..d41556d99e 100644
--- a/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteCreatePanel.tsx
@@ -1,6 +1,12 @@
import { Navigation06Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
-import { Box, CircularProgress, IconButton, TextField, Typography } from "@mui/material";
+import {
+ Box,
+ CircularProgress,
+ IconButton,
+ TextField,
+ Typography,
+} from "@mui/material";
import useMediaQuery from "@mui/material/useMediaQuery";
import { MAX_PASTE_CHARS } from "../constants";
import { PasteLinkCard } from "./PasteLinkCard";
@@ -45,7 +51,7 @@ export const PasteCreatePanel = ({
];
return (
- <>
+ <Box sx={{ width: "100%", maxWidth: "100%", minWidth: 0 }}>
<Box
sx={{
position: "relative",
@@ -84,7 +90,8 @@ export const PasteCreatePanel = ({
// Keep only the minimum reserve needed for the footer row.
paddingBottom: { xs: "50px", sm: "56px" },
backdropFilter: "blur(9px) saturate(112%)",
- WebkitBackdropFilter: "blur(9px) saturate(112%)",
+ WebkitBackdropFilter:
+ "blur(9px) saturate(112%)",
background:
"linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 58%, rgba(255, 255, 255, 0.015) 100%)",
boxShadow:
@@ -210,7 +217,7 @@ export const PasteCreatePanel = ({
</Box>
<Box
sx={{
- mt: { xs: "72px", sm: "84px", md: "116px" },
+ mt: { xs: "16px" },
display: "flex",
flexDirection: "column",
alignItems: "center",
@@ -260,10 +267,12 @@ export const PasteCreatePanel = ({
</Box>
</Box>
- {createError && <Typography color="error">{createError}</Typography>}
+ {createError && (
+ <Typography color="error">{createError}</Typography>
+ )}
{createdLink && (
- <Box sx={{ mt: { xs: 4.4, sm: 5.2 }, width: "100%", minWidth: 0 }}>
+ <Box sx={{ mt: 0, width: "100%", minWidth: 0 }}>
<PasteLinkCard
link={createdLink}
onCopy={onCopyLink}
@@ -271,6 +280,6 @@ export const PasteCreatePanel = ({
/>
</Box>
)}
- </>
+ </Box>
);
};
diff --git a/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx b/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
index f045803558..b87c113b23 100644
--- a/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
+++ b/web/apps/paste/src/features/paste/components/PasteLinkCard.tsx
@@ -127,9 +127,7 @@ export const PasteLinkCard = ({
path,
};
})
- .filter(
- (item): item is MeasuredPath => item.parsed !== undefined,
- );
+ .filter((item): item is MeasuredPath => item.parsed !== undefined);
for (const { path, len, parsed } of measured) {
const isSecondaryStroke = /shape\s*2/i.test(parsed.name);
@@ -333,9 +331,7 @@ export const PasteLinkCard = ({
display: { xs: "block", sm: "none" },
position: "absolute",
left: { xs: 18 },
- "@media (max-width:449.95px)": {
- left: 6,
- },
+ "@media (max-width:449.95px)": { left: 6 },
top: "100%",
mt: "-22px",
width: 132,