mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-06 15:18:48 +00:00
add and fix post creation route
This commit is contained in:
parent
2f8698751b
commit
d4bbb71fc3
4 changed files with 6 additions and 9 deletions
|
@ -34,6 +34,7 @@ function App() {
|
||||||
element={<LoginAndSignUpPage signupProp={true} />}
|
element={<LoginAndSignUpPage signupProp={true} />}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/profile/:username" element={<Profile />}></Route>
|
<Route path="/profile/:username" element={<Profile />}></Route>
|
||||||
|
<Route path="/createpost" element={<PostCreation />}></Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { useNavigate } from "react-router-dom";
|
||||||
import Chip from '@mui/material/Chip';
|
import Chip from '@mui/material/Chip';
|
||||||
import Autocomplete from '@mui/material/Autocomplete';
|
import Autocomplete from '@mui/material/Autocomplete';
|
||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
import Avatar from '@mui/material/Avatar';
|
|
||||||
import ButtonPrimary from "../components/ButtonRotkehlchen";
|
import ButtonPrimary from "../components/ButtonRotkehlchen";
|
||||||
|
|
||||||
import api from "../api/axios";
|
import api from "../api/axios";
|
||||||
|
@ -13,7 +12,6 @@ import { useAuth } from "../api/Auth";
|
||||||
import {Box,Card,CardMedia,CardActionArea,IconButton} from '@mui/material';
|
import {Box,Card,CardMedia,CardActionArea,IconButton} from '@mui/material';
|
||||||
import CloseIcon from '@mui/icons-material/Close';
|
import CloseIcon from '@mui/icons-material/Close';
|
||||||
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
||||||
import UserAvatar from "../components/UserAvatar";
|
|
||||||
|
|
||||||
const theme = createTheme({
|
const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
|
@ -112,13 +110,13 @@ function PostCreation(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.post("/posts/upload", fData)
|
await api.post("/posts/upload", fData)
|
||||||
navigate("/profile")
|
navigate(`/profile/${user?.username}`)
|
||||||
} catch (error:any) {
|
} catch (error:any) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onCancel= () => {
|
const onCancel= () => {
|
||||||
navigate("/profile")
|
navigate(`/profile/${user?.username}`)
|
||||||
};
|
};
|
||||||
|
|
||||||
const files = fileList ? [...fileList] : [];
|
const files = fileList ? [...fileList] : [];
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
input#create-file-upload[type="file"] {
|
input#create-file-upload[type="file"] {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -109,10 +110,7 @@ input#create-file-upload[type="file"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 768px) {
|
@media only screen and (min-width: 768px) {
|
||||||
.create-display{
|
|
||||||
padding-top: calc(var(--Header-height) + 1rem);
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
}
|
|
||||||
.create-part{
|
.create-part{
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2020",
|
"target": "es2021",
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"dom.iterable",
|
"dom.iterable",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue