Fix api url in prod

This commit is contained in:
pikiou
2022-01-11 21:46:37 +01:00
parent c7941aefc3
commit 15c6cc0be7
11 changed files with 75 additions and 44 deletions

View File

@@ -7,19 +7,31 @@ import { AppState, AppThunk } from "../../store"
import { LoginForm, Notifications } from "../../components"
import styles from "./styles.module.scss"
import { fetchVolunteerNotifsSetIfNeed } from "../../store/volunteerNotifsSet"
import { VolunteerNotifs } from "../../services/volunteers"
export type Props = RouteComponentProps
let prevNotifs: VolunteerNotifs | undefined
const HomePage: FC<Props> = (): JSX.Element => {
const dispatch = useDispatch()
const volunteerNotifs = useSelector((state: AppState) => {
const notifs = state.volunteerNotifsSet?.entity
if (notifs) {
prevNotifs = notifs
return notifs
}
return prevNotifs
}, shallowEqual)
const loginError = useSelector((state: AppState) => state.volunteerLogin.error, shallowEqual)
const jwt = useSelector((state: AppState) => state.auth.jwt, shallowEqual)
if (jwt === undefined) return <p>Loading...</p>
if (jwt) {
return <Notifications dispatch={dispatch} jwt={jwt} />
return <Notifications dispatch={dispatch} jwt={jwt} volunteerNotifs={volunteerNotifs} />
}
return (
<div>
@@ -30,7 +42,7 @@ const HomePage: FC<Props> = (): JSX.Element => {
</div>
</div>
<div className={styles.homePage}>
<div className={styles.preRegisterContent}>
<div className={styles.navigationLink}>
<Link to="/preRegister"> S&apos;informer sur le bénévolat </Link>
</div>
</div>

View File

@@ -15,3 +15,9 @@
.preRegisterContent {
@include page-content-wrapper;
}
.navigationLink {
@include page-content-wrapper;
text-align: center;
}