1.0.4 • Published 1 year ago

@samakunchan/oc-modal v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

oc-modal

Simple modal for the final project OpenClassroom.

NPM JavaScript Style Guide

Install

npm install --save @samakunchan/oc-modal
yarn add --save @samakunchan/oc-modal

Usage

import { useState } from 'react';
import { OCModalComponent } from '@samakunchan/oc-modal';
import '@samakunchan/oc-modal/dist/index.css';

const MyComponent = () => {
  const [isOpenModal, setIsOpenModal] = useState(false);
  const message = 'This is my modal';
  const closeModal = () => setIsOpenModal(false);

  return (
    <div>
      <button onClick={() => setIsOpenModal(true)}>Open my modal</button>
      <OCModalComponent
        message={message}
        isModalActive={isOpenModal}
        closeModal={closeModal}
      />
    </div>
  );
}

export default MyComponent;

License

MIT © samakunchan

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago