diff --git a/.changeset/quiet-mails-attend.md b/.changeset/quiet-mails-attend.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/quiet-mails-attend.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/clerk-js/sandbox/app.ts b/packages/clerk-js/sandbox/app.ts index 73946bf476..606a2e0d4c 100644 --- a/packages/clerk-js/sandbox/app.ts +++ b/packages/clerk-js/sandbox/app.ts @@ -98,6 +98,24 @@ function mountIndex(element: HTMLDivElement) { element.innerHTML = `
${JSON.stringify({ user }, null, 2)}
`;
}
+function mountOpenSignInButton(element: HTMLDivElement, props) {
+ const button = document.createElement('button');
+ button.textContent = 'Open Sign In';
+ button.onclick = () => {
+ Clerk?.openSignUp(props);
+ };
+ element.appendChild(button);
+}
+
+function mountOpenSignUpButton(element: HTMLDivElement, props) {
+ const button = document.createElement('button');
+ button.textContent = 'Open Sign Up';
+ button.onclick = () => {
+ Clerk?.openSignUp(props);
+ };
+ element.appendChild(button);
+}
+
function addCurrentRouteIndicator(currentRoute: string) {
const link = document.querySelector(`a[href="${currentRoute}"]`);
if (!link) {
@@ -144,6 +162,12 @@ function addCurrentRouteIndicator(currentRoute: string) {
'/accountless': () => {
Clerk.__unstable__updateProps({ options: { __internal_claimAccountlessKeysUrl: '/test-url' } });
},
+ '/open-sign-in': () => {
+ mountOpenSignInButton(app, componentControls.signIn.getProps() ?? {});
+ },
+ '/open-sign-up': () => {
+ mountOpenSignUpButton(app, componentControls.signUp.getProps() ?? {});
+ },
};
const route = window.location.pathname;
diff --git a/packages/clerk-js/sandbox/template.html b/packages/clerk-js/sandbox/template.html
index eee3b5867e..356b25b08b 100644
--- a/packages/clerk-js/sandbox/template.html
+++ b/packages/clerk-js/sandbox/template.html
@@ -159,7 +159,7 @@
>