Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { ColorSchemeScript, MantineProvider } from '@mantine/core';
import './index.css';
import HomePage from './pages/HomePage';
import SplitPdfPanel from './tools/Split';
import reportWebVitals from './reportWebVitals';

export default function App() {
return (
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/split" element={<SplitPdfPanel />} />
</Routes>
);
export default function App({ colorScheme, toggleColorScheme }) {
return <HomePage colorScheme={colorScheme} toggleColorScheme={toggleColorScheme} />;
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<ColorSchemeScript />
<MantineProvider withGlobalStyles withNormalizeCSS>
<BrowserRouter>
<App />
</BrowserRouter>
</MantineProvider>
</React.StrictMode>
);

reportWebVitals();
18 changes: 14 additions & 4 deletions frontend/src/components/FileManager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState, useEffect } from "react";
import { Card, Group, Text, Stack, Image, Badge, Button, Box, Flex } from "@mantine/core";
import { Card, Group, Text, Stack, Image, Badge, Button, Box, Flex, ThemeIcon } from "@mantine/core";
import { Dropzone, MIME_TYPES } from "@mantine/dropzone";
import { GlobalWorkerOptions, getDocument } from "pdfjs-dist";
import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";

GlobalWorkerOptions.workerSrc =
(import.meta as any).env?.PUBLIC_URL
Expand Down Expand Up @@ -93,7 +94,15 @@ function FileCard({ file, onRemove, onDoubleClick }: FileCardProps) {
{thumb ? (
<Image src={thumb} alt="PDF thumbnail" height={110} width={80} fit="contain" radius="sm" />
) : (
<Image src="/images/pdf-placeholder.svg" alt="PDF" height={60} width={60} fit="contain" radius="sm" />
<ThemeIcon
variant="light"
color="red"
size={60}
radius="sm"
style={{ display: "flex", alignItems: "center", justifyContent: "center" }}
>
<PictureAsPdfIcon style={{ fontSize: 40 }} />
</ThemeIcon>
)}
</Box>
<Text fw={500} size="sm" lineClamp={1} ta="center">
Expand Down Expand Up @@ -145,21 +154,22 @@ const FileManager: React.FC<FileManagerProps> = ({
};

return (
<div style={{ width: "100%", margin: "0 auto" }}>
<div style={{ width: "100%", margin: "0 auto", justifyContent: "center", display: "flex", flexDirection: "column", alignItems: "center", padding: "20px" }}>
<Dropzone
onDrop={handleDrop}
accept={[MIME_TYPES.pdf]}
multiple={allowMultiple}
maxSize={20 * 1024 * 1024}
style={{
marginTop: 16,
marginBottom: 16,
border: "2px dashed rgb(202, 202, 202)",
background: "#f8fafc",
borderRadius: 8,
minHeight: 120,
display: "flex",
alignItems: "center",
justifyContent: "center",
width:"90%"
}}
>
<Group justify="center" gap="xl" style={{ pointerEvents: "none" }}>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/ToolPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const ToolPicker: React.FC<ToolPickerProps> = ({ selectedToolKey, onSelect, tool
<Box
style={{
width: 220,
background: "#f8f9fa",
borderRight: "1px solid #e9ecef",
minHeight: "100vh",
padding: 16,
Expand Down
Loading