diff --git a/README.md b/README.md
index 567f125..86edcc0 100644
--- a/README.md
+++ b/README.md
@@ -65,9 +65,9 @@ services:
POSTGRES_USER: picsur
restart: unless-stopped
volumes:
- - db-data:/var/lib/postgresql/data
+ - picsur-data:/var/lib/postgresql/data
volumes:
- db-data:
+ picsur-data:
```
## Api
diff --git a/frontend/craco.config.js b/frontend/craco.config.js
index 14045c4..ca8883d 100644
--- a/frontend/craco.config.js
+++ b/frontend/craco.config.js
@@ -1,5 +1,4 @@
const scopedcss = require('craco-plugin-scoped-css');
-const path = require('path');
const webpack = require('webpack');
module.exports = {
@@ -17,7 +16,7 @@ module.exports = {
port: 3300,
liveReload: true,
- hot: true,
+ hot: false,
open: false,
},
plugins: [
diff --git a/frontend/src/app.scss b/frontend/src/app.scss
index 6a64dd7..6d27fd9 100644
--- a/frontend/src/app.scss
+++ b/frontend/src/app.scss
@@ -1,8 +1,21 @@
+html,
+body,
+#root {
+ height: 100%;
+}
+
+#root {
+ display: flex;
+ flex-direction: column;
+}
+
+.main-container {
+ flex-grow: 1;
+}
+
.contentwindow {
- width: 85vw;
- height: 80vh;
- margin: auto;
border-radius: 20px;
+ height: 100%;
border-style: solid;
border-width: 5px;
diff --git a/frontend/src/app.tsx b/frontend/src/app.tsx
index 84e4135..dad2d1b 100644
--- a/frontend/src/app.tsx
+++ b/frontend/src/app.tsx
@@ -4,6 +4,9 @@ import Centered from './components/centered/centered';
import './app.scss';
import AppRouter from './routes/router';
import { SnackbarProvider } from 'notistack';
+import Header from './components/header/header';
+import { Container } from '@mui/material';
+import Footer from './components/footer/footer';
export default function App() {
const darkTheme = createTheme({
@@ -15,11 +18,12 @@ export default function App() {
return (
-
-
+
+
-
+
+
);
diff --git a/frontend/src/components/centered/centered.scoped.scss b/frontend/src/components/centered/centered.scoped.scss
index 4bd1394..af2da08 100644
--- a/frontend/src/components/centered/centered.scoped.scss
+++ b/frontend/src/components/centered/centered.scoped.scss
@@ -5,14 +5,7 @@
align-items: center;
text-align: center;
-}
-.centered-screen {
- width: 100vw;
- height: 100vh;
-}
-
-.centered-normal {
height: 100%;
width: 100%;
}
diff --git a/frontend/src/components/centered/centered.tsx b/frontend/src/components/centered/centered.tsx
index d27b8df..1977051 100644
--- a/frontend/src/components/centered/centered.tsx
+++ b/frontend/src/components/centered/centered.tsx
@@ -5,21 +5,13 @@ import './centered.scoped.scss';
type PropsType = React.DetailedHTMLProps<
React.HTMLAttributes,
HTMLDivElement
-> & { fullScreen?: boolean };
+>;
const Centered = forwardRef(
(props: PropsType, ref: ForwardedRef) => {
- let clss = 'centered';
- if (props.fullScreen) {
- clss += ' centered-screen';
- } else {
- clss += ' centered-normal';
- }
-
let filteredProps = { ...props };
- delete filteredProps.fullScreen;
- return ;
+ return ;
},
);
diff --git a/frontend/src/components/footer/footer.scoped.scss b/frontend/src/components/footer/footer.scoped.scss
new file mode 100644
index 0000000..ba1784a
--- /dev/null
+++ b/frontend/src/components/footer/footer.scoped.scss
@@ -0,0 +1,3 @@
+.footer-container {
+ margin-top: 32px;
+}
diff --git a/frontend/src/components/footer/footer.tsx b/frontend/src/components/footer/footer.tsx
new file mode 100644
index 0000000..8eaf5ee
--- /dev/null
+++ b/frontend/src/components/footer/footer.tsx
@@ -0,0 +1,10 @@
+import { Box, Container } from '@mui/material';
+import './footer.scoped.scss';
+
+export default function Footer() {
+ return (
+
+
+
+ );
+}
diff --git a/frontend/src/components/header/header.scoped.scss b/frontend/src/components/header/header.scoped.scss
new file mode 100644
index 0000000..b0adbab
--- /dev/null
+++ b/frontend/src/components/header/header.scoped.scss
@@ -0,0 +1,14 @@
+.svg-logo {
+ height: 48px;
+ width: 48px;
+ border-radius: 20%;
+}
+
+.text-link {
+ color: inherit;
+ text-decoration: inherit;
+}
+
+.header {
+ margin-bottom: 32px;
+}
diff --git a/frontend/src/components/header/header.tsx b/frontend/src/components/header/header.tsx
new file mode 100644
index 0000000..ac1c6c8
--- /dev/null
+++ b/frontend/src/components/header/header.tsx
@@ -0,0 +1,34 @@
+import { AppBar, Toolbar, IconButton, Typography, Button } from '@mui/material';
+import { Box } from '@mui/system';
+import { Link } from 'react-router-dom';
+import './header.scoped.scss';
+
+export default function Header() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ Picsur
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/routes/view/view.scoped.scss b/frontend/src/routes/view/view.scoped.scss
index f8d863a..4fcf095 100644
--- a/frontend/src/routes/view/view.scoped.scss
+++ b/frontend/src/routes/view/view.scoped.scss
@@ -1,8 +1,6 @@
.uploadedimage {
- max-height: 100%;
- max-width: 100%;
-
- height: 0;
+ width: 100%;
+ height: auto;
border-radius: 20px;
}
diff --git a/frontend/src/routes/view/view.tsx b/frontend/src/routes/view/view.tsx
index 3efe56f..ec9e3f0 100644
--- a/frontend/src/routes/view/view.tsx
+++ b/frontend/src/routes/view/view.tsx
@@ -1,4 +1,11 @@
-import { Button, Grid, IconButton, TextField } from '@mui/material';
+import {
+ Box,
+ Button,
+ Container,
+ Grid,
+ IconButton,
+ TextField,
+} from '@mui/material';
import { useEffect, useRef } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
@@ -19,31 +26,11 @@ export default function ViewView() {
const { enqueueSnackbar } = useSnackbar();
const hash = useParams().hash ?? '';
- const contentRef = useRef(null);
- const gridRef = useRef(null);
- const imgRef = useRef(null);
-
- const resizeImage = () => {
- if (imgRef.current) imgRef.current.style.height = '0';
-
- const contentHeight = contentRef.current?.offsetHeight ?? 0;
- const gridHeight = gridRef.current?.offsetHeight ?? 0;
- const newImgHeight = contentHeight - gridHeight;
-
- if (imgRef.current) imgRef.current.style.height = newImgHeight + 'px';
- };
-
const effectHandler = async () => {
if (!isHash(hash, 'sha256')) return exitError('Invalid image link');
const imageMeta = await ImagesApi.I.GetImageMeta(hash);
if (HasFailed(imageMeta)) return exitError(imageMeta.getReason());
-
- resizeImage();
- const resizeImageDebounced = Debounce(resizeImage, 100);
- window.addEventListener('resize', resizeImageDebounced);
-
- return () => window.removeEventListener('resize', resizeImageDebounced);
};
useEffect(() => {
@@ -77,18 +64,15 @@ export default function ViewView() {
return (
-
-
+
+
Uploaded Image
-
+
+
+
{createCopyField('Image URL', imageURL)}