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