diff --git a/public/widget.html b/public/widget.html index 33a95353..e21f6fd2 100644 --- a/public/widget.html +++ b/public/widget.html @@ -13,6 +13,8 @@ #root { height: 100%; background: transparent; + width: auto; + height: auto; }
diff --git a/public/widget.js b/public/widget.js index 69e6d750..7c1107da 100644 --- a/public/widget.js +++ b/public/widget.js @@ -11,7 +11,8 @@ const styles = { position: "fixed", right: "15px", bottom: "15px", - border: "none" + border: "none", + zIndex: 9999 }; Object.assign(wrapper.style, styles); wrapper.src = `${domain}/widget.html?host=${hostId}`; @@ -31,6 +32,14 @@ window.addEventListener( wrapper.setAttribute("width", closeWidth); wrapper.setAttribute("height", closeHeight); break; + case "RELOAD_WITH_OPEN": + { + const url = new URL(wrapper.src); + url.searchParams.append("open", new Date().getTime()); + console.log("new src", url.href); + wrapper.src = url.href; + } + break; default: break; } diff --git a/src/common/component/GithubLoginButton.tsx b/src/common/component/GithubLoginButton.tsx index f3869ba3..91514264 100644 --- a/src/common/component/GithubLoginButton.tsx +++ b/src/common/component/GithubLoginButton.tsx @@ -1,12 +1,7 @@ -import { useEffect, FC } from "react"; +import { FC, useEffect } from "react"; import IconGithub from "../../assets/icons/github.svg"; import styled from "styled-components"; -import { KEY_LOCAL_MAGIC_TOKEN } from "../../app/config"; - import Button from "./styled/Button"; -import { useLoginMutation } from "../../app/services/auth"; -import toast from "react-hot-toast"; -import { FetchBaseQueryError } from "@reduxjs/toolkit/dist/query"; const StyledSocialButton = styled(Button)` width: 100%; @@ -25,52 +20,42 @@ const StyledSocialButton = styled(Button)` `; type Props = { + source?: "widget" | "webapp", client_id?: string; type?: "login" | "register"; }; -const GithubLoginButton: FC{compact && ( -