import ShareLayer from "../components/ShareLayer";
import layers from "../views/layers";

let inited = false;
let _shareLayer: ShareLayer;

const initShare = () => {
    if (!inited) {
        inited = true;
        const sharelayer = new ShareLayer();
        sharelayer.loadSkin();
        sharelayer.start();
        layers.shareLayer.addChild(sharelayer);
        _shareLayer = sharelayer;
    }
    return _shareLayer;
}



export const showShare = () => {
    initShare();
    layers.shareLayer.visible = true;
}

export const hideShare = () => {
    initShare();
    layers.shareLayer.visible = false;
}