Skip to content

Commit

Permalink
Merge branch 'main' into fix/obiz-create-order-accompte
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite authored Nov 15, 2024
2 parents 0d84e64 + f088cad commit a975972
Show file tree
Hide file tree
Showing 16 changed files with 423 additions and 149 deletions.
37 changes: 37 additions & 0 deletions webapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# [0.65.0](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.64.1...v0.65.0) (2024-11-15)

### Bug Fixes

- landing block description mobile ([ba76412](https://github.com/SocialGouv/carte-jeune-engage/commit/ba76412db59df5edcb3c8706943a8ba909066cb1))
- message triangle ([1e8f9df](https://github.com/SocialGouv/carte-jeune-engage/commit/1e8f9dfe488771b3c3e825b45a9dff106e7f650a))
- mobile logos ([8efae7e](https://github.com/SocialGouv/carte-jeune-engage/commit/8efae7e6c4d61c3cbbf7c4119f0e8f701a5447ab))

### Features

- landing block description desktop ([a124c89](https://github.com/SocialGouv/carte-jeune-engage/commit/a124c892c3e21ab22478c7eca8b2a0725f740ebe))

## [0.64.1](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.64.0...v0.64.1) (2024-11-15)


### Bug Fixes

- margin between blocs home ([92214ff](https://github.com/SocialGouv/carte-jeune-engage/commit/92214ff61bc23c50549ace6ac968403193a65fbd))

# [0.64.0](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.63.15...v0.64.0) (2024-11-15)

### Features

- add recap order email on payment_completed and fix cje logo on login email ([ef31a2a](https://github.com/SocialGouv/carte-jeune-engage/commit/ef31a2a730b3bb653e175fc193ee5106a48380cc))

## [0.63.15](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.63.14...v0.63.15) (2024-11-15)

### Bug Fixes

- AvatarGroup to Image for load optimizations ([c41fbfa](https://github.com/SocialGouv/carte-jeune-engage/commit/c41fbfa44f106fec0b2800b649d5bf287a7a39c8))

## [0.63.14](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.63.13...v0.63.14) (2024-11-15)

### Bug Fixes

- wait 5sc before reseting offer state after payment link ([81b18e8](https://github.com/SocialGouv/carte-jeune-engage/commit/81b18e8998212598e49c192b20b8b83d6f6aa388))

## [0.63.13](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.63.12...v0.63.13) (2024-11-15)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webapp",
"version": "0.63.13",
"version": "0.65.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion webapp/src/components/BottomNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ const BottomNavigation = () => {
width={6}
height={6}
/>
<Text fontSize={12} fontWeight={500} color="blackLight">
<Text
fontSize={12}
fontWeight={500}
color="blackLight"
userSelect="none"
>
{label}
</Text>
</Flex>
Expand Down
37 changes: 28 additions & 9 deletions webapp/src/components/lists/CategoriesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,38 @@ const CategoriesList = (props: CategoriesListProps) => {
>
{category.label}
</Text>
<AvatarGroup size="md" spacing={-6} alignSelf="start">
{filteredOffers.map((offer) => (
<Avatar
<Flex w="full">
{filteredOffers.map((offer, index) => (
<Flex
key={offer.id}
src={offer.partner.icon.url as string}
name={offer.partner.icon.alt as string}
width="44px"
height="44px"
rounded={"full"}
alignItems={"center"}
overflow={"hidden"}
bg="white"
borderWidth={2}
borderColor="bgGray"
/>
width={"44px"}
height={"44px"}
marginLeft={index !== 0 ? -6 : 0}
>
<Image
src={offer.partner.icon.url as string}
alt={offer.partner.icon.alt as string}
width={44}
height={44}
boxStyle={{
width: "100%",
height: "100%",
}}
imageStyle={{
width: "100%",
height: "100%",
objectFit: "cover",
}}
/>
</Flex>
))}
</AvatarGroup>
</Flex>
</Flex>
</Link>
);
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/modals/ObizOrderProcessModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ export default function ObizOrderProcessModal(
onMutate: () => setStep("payment"),
onSuccess: ({ data: { payment_url } }) => {
if (payment_url) {
window.location.href = payment_url;
setTimeout(() => {
onRedirectPayment();
setStep("amount");
}, 5000);
window.location.href = payment_url;
}
},
onError: () => router.push("/dashboard/order/error"),
Expand Down
5 changes: 3 additions & 2 deletions webapp/src/components/ui/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { CSSProperties, useState } from "react";

interface ImageProps extends NextImageProps {
imageStyle?: CSSProperties;
boxStyle?: CSSProperties;
}

const Image = (props: ImageProps) => {
const { imageStyle, ...nextImageProps } = props;
const { imageStyle, boxStyle, ...nextImageProps } = props;

return (
<Box>
<Box style={boxStyle}>
<NextImage
{...nextImageProps}
placeholder="blur"
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function Dashboard() {
mt={6}
px={8}
gap={2}
pb={14}
pb={10}
overflowX="auto"
sx={{
"::-webkit-scrollbar": {
Expand Down Expand Up @@ -134,7 +134,7 @@ export default function Dashboard() {
mt={6}
px={8}
gap={2}
pb={10}
pb={14}
overflowX="auto"
sx={{
"::-webkit-scrollbar": {
Expand Down
7 changes: 2 additions & 5 deletions webapp/src/pages/dashboard/offer/cje/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ type OfferCjePageProps = {
export default function OfferCjePage({ offer_id }: OfferCjePageProps) {
const router = useRouter();

const [isOfferNbSeenMutated, setIsOfferNbSeenMutated] = useState(false);

const { data: resultOffer, isLoading: isLoadingOffer } =
api.offer.getById.useQuery({ id: parseInt(offer_id), source: "cje" });

Expand Down Expand Up @@ -125,11 +123,10 @@ export default function OfferCjePage({ offer_id }: OfferCjePageProps) {

useEffect(() => {
const mutateData = async () => {
const { data } = await increaseNbSeen({ offer_id: parseInt(offer_id) });
setIsOfferNbSeenMutated(data);
await increaseNbSeen({ offer_id: parseInt(offer_id) });
};

if (!isOfferNbSeenMutated) mutateData();
mutateData();
}, []);

useEffect(() => {
Expand Down
6 changes: 2 additions & 4 deletions webapp/src/pages/dashboard/offer/obiz/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default function OfferObizPage({ offer_id }: OfferObizPageProps) {
onClose: onCloseOrderProcessModal,
} = useDisclosure();

const [isOfferNbSeenMutated, setIsOfferNbSeenMutated] = useState(false);
const [isDescriptionCollapsed, setIsDescriptionCollapsed] = useState(true);

const { mutateAsync: increaseNbSeen } =
Expand All @@ -69,11 +68,10 @@ export default function OfferObizPage({ offer_id }: OfferObizPageProps) {

useEffect(() => {
const mutateData = async () => {
const { data } = await increaseNbSeen({ offer_id: parseInt(offer_id) });
setIsOfferNbSeenMutated(data);
await increaseNbSeen({ offer_id: parseInt(offer_id) });
};

if (!isOfferNbSeenMutated) mutateData();
mutateData();
}, []);

if (isLoadingOffer || !router.isReady) {
Expand Down
Loading

0 comments on commit a975972

Please sign in to comment.