npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tntd/user-status-modal

v2.0.1

Published

用户状态弹窗

Downloads

30

Readme

组件背景:用户在一定状态下弹窗提示

  • noOperate长时间未操作;停留在页面(30分钟)后未进行任何页面操作(例如点击、滚动、鼠标移动)等,弹窗提示用户。
  • multiUser多终端用户登录;当前账号在其他设备中登录,弹窗提示用户。

使用方法

npm install @tntd/user-status-modal --save

参数

| 参数 | 作用 | | ---- | ---- | | lang | 国际化cn|en | | modalShowEvent | 显示弹窗时回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/signOut" }); | | modalCloseEvent | 关闭弹窗回调。结合当前业务:如果未传此回调方法但传dispatch函数,默认执行 dispatch({ type: "login/goLogin" }); | | noOperateTime | 停留页面时间设置,noOperate场景中可按照实际情况设置,默认30分钟 | | showModal | multiUser多终端登录时可以根据用户传递控制是否显示弹窗,默认弹窗 | | childrenDom | 自定义弹窗内容 | | closeModal | 子组件暴露closeModal方法可供调用方关闭弹窗 |

// 长时间未操作
 <NoOperate
    lang="cn"
    noOperateTime="100" // 静置时间
    modalShowEvent={()=>{ // 弹窗回调
        console.log(1)
    }}
    modalCloseEvent={()=>{ // 点击弹窗确定回调
        console.log(2)
    }}
    ref={noOperateRef}
    childrenDom={
        <div>
            <p>dsada</p>
            <p>dsada</p>
            <button onClick={()=>{
                noOperateRef?.current?.closeModal();
            }}>hahah</button>
        </div>
    }
/>


// 多用户登录
<MultiUser
    lang="cn"
    showModal={multiUserModal}
    modalShowEvent={() => {
        // 弹窗回调
        console.log(1)
    }}
    modalCloseEvent={() => {
        // 点击弹窗确定回调
        console.log(2)
    }}
/>