@ant-design/icons#ChromeFilled TypeScript Examples

The following examples show how to use @ant-design/icons#ChromeFilled. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MITMChromeLauncher.tsx    From yakit with GNU Affero General Public License v3.0 6 votes vote down vote up
ChromeLauncherButton: React.FC<MITMChromeLauncherProp> = React.memo((props: MITMChromeLauncherProp) => {
    const [started, setStarted] = useState(false);

    useEffect(() => {
        const id = setInterval(() => {
            ipcRenderer.invoke("IsChromeLaunched").then(e => {
                setStarted(e)
            })
        }, 500)
        return () => {
            clearInterval(id);
        }
    }, [])

    return <Button.Group>
        <Button
            type={"primary"}
            onClick={() => {
                startChrome(props.host, props.port)
            }}
            icon={<ChromeFilled/>}
        >免配置启动</Button>
        {started && <Popconfirm
            title={"关闭所有免配置 Chrome"}
            onConfirm={() => {
                ipcRenderer.invoke("StopAllChrome").then(() => {
                    info("关闭所有免配置 Chrome 成功")
                }).catch(e => {
                    failed(`关闭所有 Chrome 失败: ${e}`)
                })
            }}
        >
            <Button danger={true}
                    type={"primary"}
                    icon={<StopOutlined/>}
            />
        </Popconfirm>}
    </Button.Group>
})