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

Feature : désactiver les widgets météo et réservation en mode offline #691

Merged
merged 5 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
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
33 changes: 18 additions & 15 deletions frontend/src/components/pages/details/Details.tsx
Original file line number Diff line number Diff line change
@@ -235,7 +235,8 @@ export const DetailsUIWithoutContext: React.FC<Props> = ({ detailsId, parentId,
</div>
)}
{getGlobalConfig().enableMeteoWidget &&
navigator && navigator.onLine &&
typeof navigator !== 'undefined' &&
navigator.onLine &&
details.cities_raw &&
details.cities_raw[0] && (
<DetailsSection>
@@ -434,20 +435,22 @@ export const DetailsUIWithoutContext: React.FC<Props> = ({ detailsId, parentId,
</div>
)}

{details.reservation && details.reservation_id &&
navigator && navigator.onLine && (
<DetailsSection
className={marginDetailsChild}
htmlId="details_reservation"
titleId="details.reservation"
>
<DetailsReservationWidget
language={language}
reservation={details.reservation}
id={details.reservation_id}
/>
</DetailsSection>
)}
{details.reservation &&
details.reservation_id &&
typeof navigator !== 'undefined' &&
navigator.onLine && (
<DetailsSection
className={marginDetailsChild}
htmlId="details_reservation"
titleId="details.reservation"
>
<DetailsReservationWidget
language={language}
reservation={details.reservation}
id={details.reservation_id}
/>
</DetailsSection>
)}
</div>
<Footer />
</div>
3 changes: 2 additions & 1 deletion frontend/src/components/pages/site/OutdoorCourseUI.tsx
Original file line number Diff line number Diff line change
@@ -314,7 +314,8 @@ export const OutdoorCourseUIWithoutContext: React.FC<Props> = ({ outdoorCourseUr
)}

{getGlobalConfig().enableMeteoWidget &&
navigator && navigator.onLine &&
typeof navigator !== 'undefined' &&
navigator.onLine &&
outdoorCourseContent.cities_raw &&
outdoorCourseContent.cities_raw[0] && (
<DetailsSection>
3 changes: 2 additions & 1 deletion frontend/src/components/pages/site/OutdoorSiteUI.tsx
Original file line number Diff line number Diff line change
@@ -334,7 +334,8 @@ const OutdoorSiteUIWithoutContext: React.FC<Props> = ({ outdoorSiteUrl, language
)}

{getGlobalConfig().enableMeteoWidget &&
navigator && navigator.onLine &&
typeof navigator !== 'undefined' &&
navigator.onLine &&
outdoorSiteContent.cities_raw &&
outdoorSiteContent.cities_raw[0] && (
<DetailsSection>
Original file line number Diff line number Diff line change
@@ -189,7 +189,8 @@ export const TouristicContentUI: React.FC<TouristicContentUIProps> = ({
</DetailsSection>
)}
{getGlobalConfig().enableMeteoWidget &&
navigator && navigator.onLine &&
typeof navigator !== 'undefined' &&
navigator.onLine &&
touristicContent.cities_raw &&
touristicContent.cities_raw[0] && (
<DetailsSection>
Original file line number Diff line number Diff line change
@@ -262,7 +262,8 @@ export const TouristicEventUIWithoutContext: React.FC<Props> = ({
)}

{getGlobalConfig().enableMeteoWidget &&
navigator && navigator.onLine &&
typeof navigator !== 'undefined' &&
navigator.onLine &&
touristicEventContent.cities_raw &&
touristicEventContent.cities_raw[0] && (
<DetailsSection>