tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

disable-backup-encryption.stories.mjs (1371B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 // eslint-disable-next-line import/no-unresolved
      6 import { html } from "lit.all.mjs";
      7 import "chrome://global/content/elements/moz-card.mjs";
      8 import { ERRORS } from "chrome://browser/content/backup/backup-constants.mjs";
      9 import "./disable-backup-encryption.mjs";
     10 
     11 window.MozXULElement.insertFTLIfNeeded("browser/backupSettings.ftl");
     12 window.MozXULElement.insertFTLIfNeeded("branding/brand.ftl");
     13 
     14 const SELECTABLE_ERRORS = {
     15  "(none)": 0,
     16  ...ERRORS,
     17 };
     18 
     19 export default {
     20  title: "Domain-specific UI Widgets/Backup/Disable Encryption",
     21  component: "disable-backup-encryption",
     22  argTypes: {
     23    disableEncryptionErrorCode: {
     24      options: Object.keys(SELECTABLE_ERRORS),
     25      mapping: SELECTABLE_ERRORS,
     26      control: { type: "select" },
     27    },
     28  },
     29 };
     30 
     31 const Template = ({ disableEncryptionErrorCode }) => html`
     32  <moz-card style="width: 23.94rem;">
     33    <disable-backup-encryption
     34      .disableEncryptionErrorCode=${disableEncryptionErrorCode}
     35    ></disable-backup-encryption>
     36  </moz-card>
     37 `;
     38 
     39 export const Default = Template.bind({});
     40 
     41 export const DisableError = Template.bind({});
     42 DisableError.args = {
     43  disableEncryptionErrorCode: ERRORS.UNKNOWN,
     44 };