"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
require("./index.css");
var count = 0;
var SCOLL_LOCK_CLASSNAME = 'lock-scroll';
exports.default = (function (isOpen) {
    (0, react_1.useEffect)(function () {
        if (isOpen) {
            count++;
            if (count > 0 &&
                !document.documentElement.classList.contains(SCOLL_LOCK_CLASSNAME)) {
                document.documentElement.classList.add(SCOLL_LOCK_CLASSNAME);
            }
            return function () {
                count--;
                if (count <= 0) {
                    document.documentElement.classList.remove(SCOLL_LOCK_CLASSNAME);
                }
            };
        }
    }, [isOpen]);
});
//# sourceMappingURL=index.js.map