UNPKG

@pagopa/mui-italia

Version:

[Material-UI](https://mui.com/core/) theme inspired by [Bootstrap Italia](https://italia.github.io/bootstrap-italia/).

28 lines (27 loc) 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Default = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = tslib_1.__importDefault(require("react")); const _theme_1 = require("../../theme/index"); const material_1 = require("@mui/material"); const TOSAgreement_1 = require("./TOSAgreement"); exports.default = { title: 'Components/TOSAgreement', component: TOSAgreement_1.TOSAgreement, parameters: { chromatic: { viewports: _theme_1.breakpointsChromaticValues, }, }, }; const Default = () => { const [accepted, setAccepted] = react_1.default.useState(false); const handleChange = () => { setAccepted((prev) => !prev); }; const SwitchLabel = ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ color: "text.secondary" }, { children: ["Dichiaro di aver letto e accettato l\u2019", (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ underline: "hover", href: "#" }, { children: "Informativa Privacy" })), ' ', "e i", ' ', (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ underline: "hover", href: "#" }, { children: "Termini e condizioni d\u2019uso" })), ' ', "di MUI Italia"] }))); return ((0, jsx_runtime_1.jsx)(TOSAgreement_1.TOSAgreement, Object.assign({ productName: "MUI Italia", description: "Prima di entrare, leggi e accetta l\u2019Informativa Privacy e i Termini e condizioni d\u2019uso. Potrai consultarli di nuovo quando vuoi: li trovi sempre in fondo alla pagina.", onConfirm: () => console.log('Confermato'), confirmBtnDisabled: !accepted }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Switch, { sx: { margin: 2 }, checked: accepted, onChange: handleChange, name: "accepted" }), label: SwitchLabel }) }))); }; exports.Default = Default;