# lit-access-control-conditions-modal

> You can find an example implementation of this modal in the [lit-access-control-conditions-modal-example](https://github.com/LIT-Protocol/lit-access-control-conditions-modal-example) repository.

Latest version **1.1.34** (published 2022-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install lit-access-control-conditions-modal
pnpm add lit-access-control-conditions-modal
yarn add lit-access-control-conditions-modal
bun add lit-access-control-conditions-modal
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.34 |
| Published | 2022-03-10 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 16 |
| Unpacked size | 458.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | glitch003 |

## Links

- npm: https://www.npmjs.com/package/lit-access-control-conditions-modal
- npm.io page: https://npm.io/package/lit-access-control-conditions-modal

## Dependencies (16)

- [sass](https://npm.io/package/sass.md) ^1.42.0
- [ethers](https://npm.io/package/ethers.md) ^5.5.2
- [core-js](https://npm.io/package/core-js.md) ^3.19.1
- [node-sass](https://npm.io/package/node-sass.md) ^6.0.1
- [classnames](https://npm.io/package/classnames.md) ^2.3.1
- [react-select](https://npm.io/package/react-select.md) ^5.2.1
- [@mui/material](https://npm.io/package/@mui/material.md) ^5.2.3
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.7.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.6.0
- [react-virtualized](https://npm.io/package/react-virtualized.md) ^9.22.3
- [styled-components](https://npm.io/package/styled-components.md) ^5.3.3
- [@mui/icons-material](https://npm.io/package/@mui/icons-material.md) ^5.2.5
- [@mui/styled-engine-sc](https://npm.io/package/@mui/styled-engine-sc.md) ^5.1.0
- [react-windowed-select](https://npm.io/package/react-windowed-select.md) ^3.1.2
- [react-select-virtualized](https://npm.io/package/react-select-virtualized.md) ^4.2.0

## Recent versions

- 1.1.34 (latest) — 2022-03-10
- 1.1.33 — 2022-02-10
- 1.1.32 — 2022-02-10
- 1.1.31 — 2022-02-07
- 1.1.28 — 2022-01-11
- 1.1.27 — 2022-01-03
- 1.1.26 — 2022-01-03
- 1.1.25 — 2021-12-29
- 1.1.24 — 2021-12-22
- 1.1.23 — 2021-12-06
- 1.1.22 — 2021-12-02
- 1.1.21 — 2021-11-25
- 1.1.20 — 2021-11-24
- 1.1.19 — 2021-11-23
- 1.1.18 — 2021-11-23
- … 24 more at https://npm.io/package/lit-access-control-conditions-modal/versions

## README

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Usage](#usage)
- [Props](#props)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

This React package provides a modal for the use with Lit Protocol that lets the user choose the access control conditions under which to share content or data.

![Screenshot](https://github.com/LIT-Protocol/lit-access-control-conditions-modal/raw/main/assets/screenshot.png)

# Example

You can find an example implementation of this modal in the [lit-access-control-conditions-modal-example](https://github.com/LIT-Protocol/lit-access-control-conditions-modal-example) repository.

# Installation

`yarn add lit-access-control-conditions-modal`

Note: This project requires a few peer dependencies so make sure you install them in your main project:

- react
- lit-js-sdk

# Usage

`import { ShareModal } from 'lit-access-control-conditions-modal'`

```
<ShareModal
          onClose={() => closeShareModal()}
          sharingItems={selectedFiles}
          onAccessControlConditionsSelected={onAccessControlConditionsSelected}
          getSharingLink={getSharingLink}
          showStep={shareModalStep}
        />
```

# Props

- onClose: Pass a function. This will be called when the user clicks the "X" button on the modal
- sharingItems: An array of items being shared. Each item should have a "name" property.
- onAccessControlConditionsSelected: Pass a function. This will be called when the user has selected their access control requirements.
- getSharingLink: Pass a fuction. This will be used when the user clicks the "Copy share link" button. This function should return a string that is the url to be shared. This function will be called with the sharingItems[0] as a parameter. It is only used when sharingItems.length == 1
- showStep: Optional. Pass a string. If you'd like to force the modal into a specific step, you can use this function. It will immediately show this step when opened. The options you can choose from are the keys in src/ShareModal.jsx in the ModalComponents variable. I use this because when a user picks their access control conditions, and onAccessControlConditionsSelected is called, I close this modal, and open a "file upload progress" modal. When the upload is complete, I show this modal again, but I set showStep to "accessCreated" so the user sees the page that lets them copy the share link.

---
_Source: https://npm.io/package/lit-access-control-conditions-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
