Skip to content

Commit

Permalink
bug fix (my bad) and fix in visibility of animated banner according t…
Browse files Browse the repository at this point in the history
…o context
  • Loading branch information
bandinopla committed Dec 23, 2024
1 parent f8bed00 commit 1dfc43f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,14 @@ const AppSideBar = ()=>{

<ServiceWorkerStatusDisplay/>
<Route path="/" component={VisualPreferencesSwitcher}/>
<Route path="/" component={DonationSoftbox}/>
<Route path="/" exact component={SideVideoBanner}/>

<Route path="/journal/:uname" component={JournalSideBar} />
<Route path="/" component={DonationSoftbox}/>
<Route path="/" component={SideVideoBanner}/>



<Suspense fallback={<LinearProgress />}>
<Switch>

<Route path="/journal/:uname" component={JournalSideBar} />
<Route path="/explore" component={HomeSidebar}/>
<Route path="/community-stats/:filtermask([\w-]+)?" component={CommunityStatsSoftBox} />
<Route path="/sbd-stats" component={SBDRankSidebar} />
Expand Down
13 changes: 12 additions & 1 deletion src/componentes/SideVideoBanner.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@

import {
useLocation
useLocation,
useRouteMatch
} from "react-router-dom";
import { useGetSession } from "../session/session-handler";

export const SideVideoBanner = ()=>{
const location = useLocation();
const $session = useGetSession();
let match = useRouteMatch("/journal/:username");

//if( location.pathname=="/") return "";
if( location.pathname=="/") {
if( !$session.session ) return "";
}

if( $session.session && match?.params?.username.toLowerCase()===$session.session.user.uname.toLowerCase()) return "";

return <div style={{ position:"relative", width:"100%", paddingBottom:"177.78%" }}>
<iframe title="banner" src="https://www.youtube.com/embed/HVW5AjECvV8?autoplay=1&controls=0&loop=1&mute=1&playlist=HVW5AjECvV8"
style={{ position:"absolute", top:0, left:0, width:"100%", height:"100%", border:"none" }}
Expand Down
6 changes: 5 additions & 1 deletion src/componentes/quick-range-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Box, Button, Grid, LinearProgress, Typography, makeStyles } from "@mate
import WeightValue from "./weight-value";
import DateRangeIcon from '@material-ui/icons/DateRange';
import { Alert } from "@material-ui/lab";
import { useHistory } from "react-router-dom";
import { useHistory, useParams } from "react-router-dom";

const ranges = [
{ range:1 },
Expand Down Expand Up @@ -49,6 +49,8 @@ export const QuickRangeOverview = ()=>{
const user = useGetSession();
const classes = useStyles();
const history = useHistory();
const $params = useParams();


const overview = useMemo(()=>
{
Expand Down Expand Up @@ -102,6 +104,8 @@ export const QuickRangeOverview = ()=>{

},[range, user.session ]);

if( $params?.uname.toLowerCase() !==user.session?.user?.uname.toLowerCase() ) return;


return <SoftBox title="YOU DID" Icon={<DateRangeIcon/>} style={{ border:"3px solid #333"}}>

Expand Down

0 comments on commit 1dfc43f

Please sign in to comment.