Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

share art redirection to log in #149

Merged
merged 6 commits into from
Nov 27, 2023
Merged
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
14 changes: 12 additions & 2 deletions src/components/userHub/AddArtButton.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import React from "react";
import styles from "./AddArtButton.module.css";
import { Box } from "@mui/material";
import { useAuth0 } from "@auth0/auth0-react";
import { useNavigate } from 'react-router-dom';

const AddArtButton = () => {
const { isAuthenticated } = useAuth0();
const { loginWithRedirect } = useAuth0();
const navigate = useNavigate();

const handleCheckLogIn = () => {
isAuthenticated ? navigate("/VideoUpload") : loginWithRedirect();
}

return (
<Box className={styles.box} >
<a href="#">
<Box className={styles.box}>
<a href="" onClick={handleCheckLogIn}>
<span></span>
<span></span>
<span></span>
Expand Down
1 change: 0 additions & 1 deletion src/components/userHub/UserVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import VideoBoxWithDecor from "./VideoBoxWithDecor";

const UserVideo = ({ video, maxWidth, withVideoInfo }) => {
const { videoUrl, videoImg, ...videoInfo } = video;
console.log(videoInfo)
return (
<Card variant="outlined" sx={{ width: "100%", height: "100%", backgroundColor: "black", p: 2, maxWidth }}>
<VideoBoxWithDecor videoUrl={videoUrl} videoImg={videoImg} maxWidth={maxWidth} />
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import Home from "./pages/HomePage";
import Error from "./pages/ErrorPage";
import Multimedia from "./pages/MultimediaPage";
import Profile from "./pages/ProfilePage";
import DummyHomePage from "./pages/DummyHomePage";

import DummyHomePage from "./pages/DummyHomePage"
import VideoUploadPage from "./pages/VideoUpload/VideoUpload";
import Theme from "./theme";
import App from "./App";

import PostAuthentication from "./components/PostAuthentication";
import reportWebVitals from "./reportWebVitals";
import Episode from "./pages/EpisodePage";
Expand Down Expand Up @@ -60,7 +59,9 @@ root.render(
/>
<Route path="login" element={<PostAuthentication />} />
<Route path="dummyHomePage" element={<DummyHomePage />}></Route>
<Route path="Dashboard" element={<Dashboard />}></Route>
<Route path="dashboard" element={<Dashboard />}></Route>
<Route path="VideoUpload" element={<VideoUploadPage />}></Route>

<Route path="profile" element={<Profile />} />
<Route path="*" element={<Error />} />
</Route>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/DummyHomePage/PageTitleComponent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import { Grid, Typography } from "@mui/material";
import AddArtButton from "../../components/userHub/AddArtButton";

const PageTitleComponent = ({ title, fontSize }) => {
const { mainTitle, subtitle } = title;
Expand Down Expand Up @@ -43,7 +42,7 @@ const PageTitleComponent = ({ title, fontSize }) => {
{subtitle}
</Typography>

<AddArtButton />

</Grid>
);
};
Expand Down
107 changes: 46 additions & 61 deletions src/pages/DummyHomePage/index.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,49 @@
import { Grid } from "@mui/material";
import UserVideo from "../../components/userHub/UserVideo";
import { userHubVideoListMocks } from "../../api/mocks";
import PageTitleComponent from "./PageTitleComponent";

import { Grid } from "@mui/material"
import UserVideo from "../../components/userHub/UserVideo"
import { userHubVideoListMocks } from "../../api/mocks"
import PageTitleComponent from "./PageTitleComponent"
import AddArtButton from "../../components/userHub/AddArtButton";



const DummyHomePage = () => {
let title = {
mainTitle: "Welcome to VideoHub",
subtitle: "Your Ultimate Destination for Awesome Content Experiences!",
};
let fontSize = {
titleFontSize: "50pt",
subtitleFontSize: "24pt",
};
return (
<Grid
container
direction="column"
justifyContent="center"
alignItems="center"
>
<Grid
item
lg={12}
sx={{ mt: { xs: "2rem", lg: "2rem" }, mb: { xs: "1rem", lg: "2rem" } }}
>
<PageTitleComponent title={title} fontSize={fontSize} />
</Grid>
<Grid item sx={{ width: "90%", marginTop: "2rem", marginBottom: "2rem" }}>
<Grid
container
justifyContent="center"
sx={{ marginBottom: { lg: "4rem", sm: 0 } }}
>
{userHubVideoListMocks.map((video) => {
let withVideoInfo = true;
let maxWidth = "800px";
return (
<Grid
item
lg={4}
md={6}
xs={12}
key={video.id}
sx={{
padding: { lg: "1rem", md: "1rem", sm: 0 },
paddingBottom: { sm: "2rem", xs: "1rem" },
}}
>
<UserVideo
video={video}
maxWidth={maxWidth}
withVideoInfo={withVideoInfo}
/>
</Grid>
);
})}
</Grid>
</Grid>
</Grid>
);
};
let title =
{
mainTitle: "Welcome to VideoHub",
subtitle: "Your Ultimate Destination for Awesome Content Experiences!"
}
let fontSize =
{
titleFontSize: "50pt",
subtitleFontSize: "24pt"
}

return (

<Grid container direction="column" justifyContent="center" alignItems="center">
<Grid item lg={12} sx={{ mt: { xs: "2rem", lg: "2rem" }, mb: "1rem" }} >
<PageTitleComponent title={title} fontSize={fontSize} />
</Grid>
<Grid item>
<AddArtButton />
</Grid>
<Grid item sx={{ width: "90%", marginTop: "2rem", marginBottom: "2rem" }}>
<Grid container justifyContent="center" sx={{ marginBottom: { lg: "4rem", sm: 0 } }}>
{userHubVideoListMocks.map((video) => {
let withVideoInfo = true;
let maxWidth = "800px";
return (
<Grid item lg={4} md={6} xs={12} key={video.id} sx={{ padding: { lg: "1rem", md: "1rem", sm: 0 }, paddingBottom: { sm: "2rem", xs: "1rem" } }}>
<UserVideo video={video} maxWidth={maxWidth} withVideoInfo={withVideoInfo} />
</Grid>
)
})}
</Grid>

</Grid>
</Grid >
)
}

export default DummyHomePage;
export default DummyHomePage