feat: add close notice on github integration

This commit is contained in:
2024-12-21 23:55:32 +01:00
parent 9b8900ebee
commit c5f2dce36e
3 changed files with 35 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ export async function GET(request: Request): Promise<Response> {
return new Response(null, {
status: 302,
headers: {
Location: '/',
Location: '/?close',
},
});
}

View File

@@ -1,12 +1,14 @@
// https://v0.dev/r/DxCSk58T8pM
import CloseTabNotice from '@/components/app/CloseTabNotice/CloseTabNotice';
import LandingStepper from '@/components/app/LandingStepper/LandingStepper';
import Video from '@/components/app/Video/Video';
import { Button } from '@/components/ui/button';
import Link from 'next/link';
import React from 'react';
export default function Home() {
return (
<>
<CloseTabNotice />
<main className="flex-1">
<section className="w-full py-12 md:py-24 lg:py-32 xl:py-48">
<div className="container px-4 md:px-6">

View File

@@ -0,0 +1,31 @@
'use client';
import { useSearchParams } from 'next/navigation';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
export default function CloseTabNotice() {
const searchParams = useSearchParams();
const close = searchParams.has('close');
if (!close) return null;
return (
<Dialog open>
<DialogContent>
<DialogHeader>
<DialogTitle>You are back!</DialogTitle>
<DialogDescription>
Now that the github integration is installed, you can close this tab and refresh the
other tab to see the repos! (or maybe not, in case of an organization it may need
approval)
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
);
}