-
Notifications
You must be signed in to change notification settings - Fork 0
Add welcome popup for unsigned users to encourage sign-in #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SjxSubham
merged 4 commits into
main
from
copilot/fix-30696859-2412-414a-9fc2-7fd5c00f8fa0
Sep 20, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| // { | ||
| // "extends": ["next/core-web-vitals", "next/typescript"] | ||
| // } | ||
|
|
||
|
|
||
| { | ||
| "extends": ["next/core-web-vitals", "next/typescript"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,10 @@ share | |
| # production | ||
| /build | ||
|
|
||
| # PWA | ||
| /public/workbox-*.js | ||
| /public/sw.js | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| "use client"; | ||
|
|
||
| import { useState, useEffect } from "react"; | ||
| import { SignedOut, SignInButton } from "@clerk/nextjs"; | ||
| import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; | ||
| import { Button } from "@/components/ui/button"; | ||
| import { Code2, X } from "lucide-react"; | ||
|
|
||
| function SignInPopup() { | ||
| const [isOpen, setIsOpen] = useState(false); | ||
| const [hasShown, setHasShown] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| // Check if popup has been shown before | ||
| const popupShown = localStorage.getItem("zitacode-signin-popup-shown"); | ||
|
|
||
| if (!popupShown && !hasShown) { | ||
| // Show popup after a brief delay to allow page to load | ||
| const timer = setTimeout(() => { | ||
| setIsOpen(true); | ||
| setHasShown(true); | ||
| }, 1500); | ||
|
|
||
| return () => clearTimeout(timer); | ||
| } | ||
| }, [hasShown]); | ||
|
|
||
| const handleClose = () => { | ||
| setIsOpen(false); | ||
| // Mark popup as shown so it doesn't appear again in this session | ||
| localStorage.setItem("zitacode-signin-popup-shown", "true"); | ||
| }; | ||
|
|
||
| const handleRemindLater = () => { | ||
| setIsOpen(false); | ||
| // Don't set localStorage so it can show again in future sessions | ||
| }; | ||
|
|
||
| return ( | ||
| <SignedOut> | ||
| <Dialog open={isOpen} onOpenChange={setIsOpen}> | ||
| <DialogContent className="sm:max-w-md bg-gradient-to-br from-gray-900 to-gray-950 border-gray-700"> | ||
| <DialogHeader className="text-center space-y-3"> | ||
| <div className="mx-auto w-16 h-16 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full flex items-center justify-center"> | ||
| <Code2 className="w-8 h-8 text-white" /> | ||
| </div> | ||
| <DialogTitle className="text-2xl font-bold text-white"> | ||
| Welcome to ZitaCode! | ||
| </DialogTitle> | ||
| <DialogDescription className="text-gray-300 text-base"> | ||
| Sign in to unlock the full power of our code editor. Get access to advanced features, save your projects, and join our community of developers. | ||
| </DialogDescription> | ||
| </DialogHeader> | ||
|
|
||
| <div className="flex flex-col gap-3 mt-6"> | ||
| <SignInButton mode="modal"> | ||
| <Button className="w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-semibold py-3 rounded-lg transition-all duration-200"> | ||
| Sign In to Get Started | ||
| </Button> | ||
| </SignInButton> | ||
|
|
||
| <div className="flex gap-2"> | ||
| <Button | ||
| variant="outline" | ||
| onClick={handleRemindLater} | ||
| className="flex-1 border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white" | ||
| > | ||
| Maybe Later | ||
| </Button> | ||
| <Button | ||
| variant="outline" | ||
| onClick={handleClose} | ||
| className="flex-1 border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white" | ||
| > | ||
| Don't Show Again | ||
| </Button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <button | ||
| onClick={handleClose} | ||
| className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-gray-400 hover:text-white" | ||
| > | ||
| <X className="h-4 w-4" /> | ||
| <span className="sr-only">Close</span> | ||
| </button> | ||
| </DialogContent> | ||
| </Dialog> | ||
| </SignedOut> | ||
| ); | ||
| } | ||
|
|
||
| export default SignInPopup; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.