From 907346695340dd5120fc1200a1abd70a1c0ece71 Mon Sep 17 00:00:00 2001 From: Lucieo Date: Thu, 22 Feb 2024 21:32:06 +0000 Subject: [PATCH] Fix/style fixes 22 02 (#80) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Lieu Admin Listing des espaces fix * Lieu fiche détail d'un lieu fix * Public listing des lieux en mode candidatures ouvertes fix * Home encart dispositif emergence --- .../1.0.0/full_documentation.json | 2 +- .../Place/ApplicationPlaceList.tsx | 2 +- .../DisponibilitiesSelector.tsx | 2 -- .../Account/Place/ListItem/PlaceListItem.tsx | 11 ++++++-- .../Campaign/ApplicationCounter.tsx | 6 ++++- .../Campaign/Home/HomeCampaignInsert.tsx | 6 +++++ .../CampaignApplicationSchedule.tsx | 26 ++++++++++++------- .../CampaignApplicationScheduleItem.tsx | 16 ++++++++++-- .../Places/Detail/CampaignPlaceDetail.tsx | 6 +++-- .../Places/PlacesListCampaignHelper.tsx | 21 ++++++++++++--- web/components/Home/HomeActions.tsx | 3 ++- web/components/Home/HomePlaces.tsx | 2 +- web/components/Place/PlaceGridCard.tsx | 6 ++++- web/components/Place/PlaceListCard.tsx | 13 ++++------ web/components/Place/PlaceSearch.tsx | 6 ++++- web/components/Place/PlacesPage.tsx | 4 +-- web/pages/compte/mes-candidatures/index.tsx | 6 ++++- 17 files changed, 99 insertions(+), 39 deletions(-) diff --git a/back/extensions/documentation/documentation/1.0.0/full_documentation.json b/back/extensions/documentation/documentation/1.0.0/full_documentation.json index 15cdf43a..426a7745 100644 --- a/back/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/back/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "02/22/2024 6:38:10 PM" + "x-generation-date": "02/22/2024 8:24:57 PM" }, "x-strapi-config": { "path": "/documentation", diff --git a/web/components/Account/Application/Place/ApplicationPlaceList.tsx b/web/components/Account/Application/Place/ApplicationPlaceList.tsx index ad184d02..9a2c6cda 100644 --- a/web/components/Account/Application/Place/ApplicationPlaceList.tsx +++ b/web/components/Account/Application/Place/ApplicationPlaceList.tsx @@ -12,8 +12,8 @@ import { Application } from '~typings/api' import Chevron from 'public/assets/img/chevron-down.svg' import Cell from '~components/Account/Booking/Cell' import useCampaignContext from '~components/Campaign/useCampaignContext' -import ApplicationPlaceListItem from '~components/Account/Application/Place/ApplicationPlaceListItem' import ApplicationPlaceHelper from '~components/Account/Application/Place/ApplicationsHelpers/ApplicationPlaceHelper' +import ApplicationPlaceListItem from '~components/Account/Application/Place/ApplicationPlaceListItem' interface Props { applications: Application[] diff --git a/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx b/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx index a9864cbc..caa572b3 100644 --- a/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx +++ b/web/components/Account/Application/Place/DisponibilitiesSelector/DisponibilitiesSelector.tsx @@ -18,8 +18,6 @@ const DisponibilitiesSelector = () => { ['myPlaces', query.campaign as string], ) - console.log(query.campaign, places) - useEffect(() => { const search = {} if (query.disponibility) { diff --git a/web/components/Account/Place/ListItem/PlaceListItem.tsx b/web/components/Account/Place/ListItem/PlaceListItem.tsx index 1e852af4..f736bac0 100644 --- a/web/components/Account/Place/ListItem/PlaceListItem.tsx +++ b/web/components/Account/Place/ListItem/PlaceListItem.tsx @@ -21,7 +21,7 @@ interface Props { const PlaceListItem = ({ place, setVisible, isFirst }: Props) => { const isComplete = useIsComplete(place) - const { hasActiveCampaign } = useCampaignContext() + const { currentCampaign } = useCampaignContext() useEffect(() => { if (!isComplete) { @@ -29,6 +29,13 @@ const PlaceListItem = ({ place, setVisible, isFirst }: Props) => { } }, [isComplete]) + const showCampaignDisponibilities = + currentCampaign?.mode === 'disponibilities' || + (place?.disponibilities && + place?.disponibilities?.some( + (d) => d?.campaign?.toString() === currentCampaign?.id.toString(), + )) + return ( { - {hasActiveCampaign && ( + {showCampaignDisponibilities && ( )} diff --git a/web/components/Campaign/ApplicationCounter.tsx b/web/components/Campaign/ApplicationCounter.tsx index a21dd813..46172148 100644 --- a/web/components/Campaign/ApplicationCounter.tsx +++ b/web/components/Campaign/ApplicationCounter.tsx @@ -13,7 +13,11 @@ const ApplicationCounter = ({ const { currentCampaign } = useCampaignContext() const { data: user, applications } = useCurrentUser() - if (user?.type === 'company' && currentCampaign?.applications_max > 0) { + if ( + user?.type === 'company' && + currentCampaign?.applications_max > 0 && + applications?.length > 0 + ) { return ( diff --git a/web/components/Campaign/Home/HomeCampaignInsert.tsx b/web/components/Campaign/Home/HomeCampaignInsert.tsx index 78c60055..57679809 100644 --- a/web/components/Campaign/Home/HomeCampaignInsert.tsx +++ b/web/components/Campaign/Home/HomeCampaignInsert.tsx @@ -21,6 +21,12 @@ const HomeCampaignInsert = () => { p={4} paddingBottom={{ base: 8, md: 2 }} height="100%" + _hover={{ lg: { borderColor: 'rgba(235, 164, 10, 0.3)' } }} + border={{ + base: 'none', + lg: '2px solid transparent', + }} + transition="border 0.3s ease-in-out" > {title} diff --git a/web/components/Campaign/Places/Application/CampaignApplicationSchedule.tsx b/web/components/Campaign/Places/Application/CampaignApplicationSchedule.tsx index 6f240d26..6c6877a6 100644 --- a/web/components/Campaign/Places/Application/CampaignApplicationSchedule.tsx +++ b/web/components/Campaign/Places/Application/CampaignApplicationSchedule.tsx @@ -74,15 +74,23 @@ const CampaignApplicationSchedule = ({ })} {currentCampaign?.description} - {t('detail.campaign.eligibility')} - {currentCampaign?.eligibility} - + {currentCampaign?.eligibility && ( + <> + {t('detail.campaign.eligibility')} + + {currentCampaign?.eligibility} + + + )} + {currentCampaign?.article_link && ( + + )} diff --git a/web/components/Campaign/Places/Application/CampaignApplicationScheduleItem.tsx b/web/components/Campaign/Places/Application/CampaignApplicationScheduleItem.tsx index c6182d43..3040c131 100644 --- a/web/components/Campaign/Places/Application/CampaignApplicationScheduleItem.tsx +++ b/web/components/Campaign/Places/Application/CampaignApplicationScheduleItem.tsx @@ -77,7 +77,8 @@ const CampaignApplicationScheduleItem = ({ [selected, disponibility], ) - const handleClick = () => { + const handleClick = (e) => { + console.log('click') if (isSelected) { setSelected( //@ts-expect-error @@ -111,13 +112,24 @@ const CampaignApplicationScheduleItem = ({ border={isSelected ? '2px solid #6EAE7F' : '2px solid transparent'} borderRadius="8px" opacity={isDisabled ? 0.5 : 1} + cursor="pointer" + onClick={(e) => { + e.stopPropagation() + handleClick(e) + }} + _hover={{ border: '2px solid #6EAE7F' }} + transition="border 0.3s ease-in-out" > { + e.stopPropagation() + e.preventDefault() + handleClick(e) + }} isDisabled={isDisabled} /> diff --git a/web/components/Campaign/Places/Detail/CampaignPlaceDetail.tsx b/web/components/Campaign/Places/Detail/CampaignPlaceDetail.tsx index 44bcca24..68812937 100644 --- a/web/components/Campaign/Places/Detail/CampaignPlaceDetail.tsx +++ b/web/components/Campaign/Places/Detail/CampaignPlaceDetail.tsx @@ -19,6 +19,7 @@ import { useRouter } from 'next/router' import CampaignApplicationSchedule from '~components/Campaign/Places/Application/CampaignApplicationSchedule' import PlaceDetailCalendar from '~components/Place/PlaceDetailPage/PlaceDetailCalendar' import CampaignDetailSwitcher from '~components/Campaign/Places/Detail/CampaignDetailSwitcher' +import useCampaignContext from '~components/Campaign/useCampaignContext' interface Props { place: Espace @@ -28,6 +29,7 @@ const CampaignPlaceDetail = ({ place }: Props) => { const isMobile = useBreakpointValue({ base: true, lg: false }) const router = useRouter() const isCampaignTab = router.query.tab === '1' + const { currentCampaign } = useCampaignContext() const displayPrecise = useMemo(() => { if (!place) return false @@ -68,8 +70,8 @@ const CampaignPlaceDetail = ({ place }: Props) => { {isCampaignTab ? ( - Boolean(d?.campaign), + disponibilities={place?.disponibilities?.filter( + (d) => d?.campaign?.toString() === currentCampaign?.id.toString(), )} /> ) : ( diff --git a/web/components/Campaign/Places/PlacesListCampaignHelper.tsx b/web/components/Campaign/Places/PlacesListCampaignHelper.tsx index d0dabe3a..a59d40a1 100644 --- a/web/components/Campaign/Places/PlacesListCampaignHelper.tsx +++ b/web/components/Campaign/Places/PlacesListCampaignHelper.tsx @@ -26,12 +26,17 @@ const PlacesListCampaignHelper = ({ paddingY={4} marginBottom={4} spacing={'1rem'} + height={!isHome ? '100%' : 'auto'} {...props} > {campaign && !isHome && ( )} - + {campaign @@ -42,13 +47,21 @@ const PlacesListCampaignHelper = ({ {campaign ? campaign.description : t('solidarity.helper')} - +