Skip to content

Commit

Permalink
Change l'infobulle
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-rutkowski committed Oct 9, 2024
1 parent 04a95cd commit a75e380
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions packages/panier/components/FiltresActions/BadgesFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ButtonMenu,
Checkbox,
Field,
Icon,
InfoTooltip,
OptionValue,
SelectMultiple,
SelectMultipleOnChangeArgs,
Expand Down Expand Up @@ -74,16 +74,16 @@ export const BadgesFilters = ({
badge.filter.onChange(badge.filter.value ?? false);
} else {
const values: OptionValue[] | undefined = badge.filter.values?.filter(
v => v !== badge.value,
(v) => v !== badge.value
);

badge.filter.onChange({selectedValue, values});
badge.filter.onChange({ selectedValue, values });
}
};

/** Supprime tous les filtres sélectionnés */
const handleClearFilters = () => {
badgesList?.forEach(badge => {
badgesList?.forEach((badge) => {
if (badge.filter.type === 'checkbox') {
badge.filter.onChange(false);
} else {
Expand All @@ -99,16 +99,16 @@ export const BadgesFilters = ({
useEffect(() => {
const newList: BadgeType[] = [];

filters.forEach(filter => {
filters.forEach((filter) => {
if (filter.type === 'checkbox') {
if (filter.value)
newList.push({filter, value: 'true', label: filter.title});
newList.push({ filter, value: 'true', label: filter.title });
} else {
if (filter.values !== undefined) {
const options = getFlatOptions(filter.options);

filter.values.forEach(value => {
const option = options.find(opt => opt.value === value);
filter.values.forEach((value) => {
const option = options.find((opt) => opt.value === value);

option &&
newList.push({
Expand Down Expand Up @@ -176,19 +176,19 @@ export const BadgesFilters = ({
}
>
<div className="flex flex-col gap-4 w-72 p-4">
{filters.map(filter =>
{filters.map((filter) =>
filter.type === 'checkbox' ? (
<div className="flex flex-row" key={filter.title}>
<div className="flex flex-row items-end" key={filter.title}>
<Checkbox
label={filter.title}
checked={filter.value}
onChange={evt => filter.onChange(evt.currentTarget.checked)}
onChange={(evt) => filter.onChange(evt.currentTarget.checked)}
/>
{!!filter.tooltip && (
<Icon
icon="information-line"
className="cursor-pointer"
title={filter.tooltip}
<InfoTooltip
iconClassName="text-primary-8"
label={filter.tooltip}
size="md"
/>
)}
</div>
Expand All @@ -201,7 +201,7 @@ export const BadgesFilters = ({
small
/>
</Field>
),
)
)}
</div>
</ButtonMenu>
Expand Down

0 comments on commit a75e380

Please sign in to comment.