Skip to content

Commit

Permalink
fix(ci/cd): Correct toaster examples
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Mar 14, 2024
1 parent 3332f3e commit af5e34d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
20 changes: 10 additions & 10 deletions dist/dsfr-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8933,19 +8933,19 @@ const nr = me, rr = ({ className: t, color: e, icon: n, iconPosition: r, size: o
const r = ie(), o = x("fr-tags-group", t);
return /* @__PURE__ */ m("ul", { className: o, ...je(n), children: et(e, [Xc, Zc, Jc]).map((i, l) => /* @__PURE__ */ m("li", { children: i }, `${r}-${l}`)) });
}, to = ({
as: t = "p",
size: e,
alt: n,
bold: r,
className: o,
alt: t,
as: e = "p",
bold: n,
className: r,
size: o,
...i
}) => {
const l = x(o, {
"fr-text--alt": e !== "lead" && n,
"fr-text--heavy": r,
[`fr-text--${e}`]: e && e !== "md"
const l = x(r, {
"fr-text--alt": o !== "lead" && t,
"fr-text--heavy": n,
[`fr-text--${o}`]: o && o !== "md"
});
return /* @__PURE__ */ m(t, { className: l, ...i });
return /* @__PURE__ */ m(e, { className: l, ...i });
}, Bd = ({
as: t = "h1",
className: e,
Expand Down
60 changes: 33 additions & 27 deletions example-ts/src/pages/components/Toasts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,40 @@ const toaster = `
export function Toasts() {
const { toast } = useToast();

const displayToastError = () => {
toast({
description: 'Toast - Error - AutoDismissAfter 3 seconds',
id: 'toast-error',
title: 'Error',
type: 'error',
});
};
let displayToastError = () => {};
let displayToastSuccess = () => {};
let displayToastWarning = () => {};

const displayToastSuccess = () => {
toast({
autoDismissAfter: 0,
description: 'Toast - Success - No AutoDismiss',
id: 'toast-success',
title: 'Success',
type: 'success',
});
};
if (toast) {
displayToastError = () => {
toast({
description: 'Toast - Error - AutoDismissAfter 3 seconds',
id: 'toast-error',
title: 'Error',
type: 'error',
});
};

const displayToastWarning = () => {
toast({
autoDismissAfter: 10000,
description: 'Toast - Warning - AutoDismissAfter 10 seconds',
id: 'toast-warning',
title: 'Warning',
type: 'warning',
});
};
displayToastSuccess = () => {
toast({
autoDismissAfter: 0,
description: 'Toast - Success - No AutoDismiss',
id: 'toast-success',
title: 'Success',
type: 'success',
});
};

displayToastWarning = () => {
toast({
autoDismissAfter: 10000,
description: 'Toast - Warning - AutoDismissAfter 10 seconds',
id: 'toast-warning',
title: 'Warning',
type: 'warning',
});
};
}

return (
<Container fluid className="fr-mb-5w">
Expand All @@ -78,7 +84,7 @@ export function Toasts() {
<Col xs={12}>
<Title as="h1">Toaster - Toaster</Title>
<Text>
Message éphémère pouvant afficher une error, un warning, un succès ou encore une information.
Message éphémère pouvant afficher une erreur, un warning, un succès ou encore une information.
</Text>
<Playground code={toaster} scope={{ Button, displayToastError, displayToastSuccess, displayToastWarning }} defaultShowCode />
</Col>
Expand Down

0 comments on commit af5e34d

Please sign in to comment.