diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/mobile-magic/apps/frontend/app/layout.tsx b/mobile-magic/apps/frontend/app/layout.tsx index f14e802..176ff11 100644 --- a/mobile-magic/apps/frontend/app/layout.tsx +++ b/mobile-magic/apps/frontend/app/layout.tsx @@ -6,6 +6,7 @@ import { meta } from '@/lib/constants' import { Particles } from '@repo/ui/particles' import { SidebarProvider } from '@/components/ui/sidebar' import { AppSidebar } from "@/components/app-sidebar" +import { Toaster } from 'sonner' import "./globals.css" @@ -48,7 +49,7 @@ export default function RootLayout({ enableSystem disableTransitionOnChange > - + {children} @@ -61,4 +62,3 @@ export default function RootLayout({ } // grid px-4 grid-cols-[1fr_min(640px,100%)_1fr] xl:grid-cols-[1fr_minmax(auto,10rem)_min(640px,100%)_minmax(auto,10rem)_1fr] xl:gap-x-9 xl:px-0 [&>*]:col-start-2 xl:[&>*]:col-start-3 - diff --git a/mobile-magic/apps/frontend/components/Appbar.tsx b/mobile-magic/apps/frontend/components/Appbar.tsx index 5053343..f6133e3 100644 --- a/mobile-magic/apps/frontend/components/Appbar.tsx +++ b/mobile-magic/apps/frontend/components/Appbar.tsx @@ -13,6 +13,8 @@ import { containerVariants, itemVariants } from '@/lib/animation-variants' import { ThemeButton } from '@/components/theme-button' export function Appbar() { + const repoUrl = `https://github.com/VarshanMaj1/mobile-magic`; + return ( -
+
@@ -50,4 +52,3 @@ export function Appbar() { ); } - diff --git a/mobile-magic/apps/frontend/components/ExportOptions.tsx b/mobile-magic/apps/frontend/components/ExportOptions.tsx new file mode 100644 index 0000000..a8c804f --- /dev/null +++ b/mobile-magic/apps/frontend/components/ExportOptions.tsx @@ -0,0 +1,78 @@ +import { Button } from '@/components/ui/button' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu' +import { GitHubLogoIcon, FileIcon, DownloadIcon } from '@radix-ui/react-icons' +import { toast } from 'sonner' + +interface ExportOptionsProps { + repoUrl?: string + onExport?: (type: 'github' | 'https' | 'ssh' | 'cli') => void +} + +export const ExportOptions = ({ repoUrl, onExport }: ExportOptionsProps) => { + const handleCopy = (text: string, type: string) => { + navigator.clipboard.writeText(text) + toast.success(`Copied ${type} URL to clipboard`) + } + + return ( + + + + + +
+
+ + Clone +
+
+ Select a cloning method to get the project URL +
+
+ { + handleCopy(`${repoUrl || ''}`, 'HTTPS'); + onExport?.('https'); + }} + > + HTTPS + + + { + handleCopy(`git@github.com:${repoUrl?.split('github.com/')[1]}`, 'SSH'); + onExport?.('ssh'); + }} + > + SSH + + + { + handleCopy(`gh repo clone ${repoUrl?.split('github.com/')[1]}`, 'GitHub CLI'); + onExport?.('cli'); + }} + > + GitHub CLI + + +
+
+
+
+ ) +} diff --git a/mobile-magic/apps/frontend/components/Header.tsx b/mobile-magic/apps/frontend/components/Header.tsx index 1ce3890..ca37ecd 100644 --- a/mobile-magic/apps/frontend/components/Header.tsx +++ b/mobile-magic/apps/frontend/components/Header.tsx @@ -4,12 +4,14 @@ import { cn } from '@/lib/utils' import Image from 'next/image' import Link from 'next/link' import { motion } from 'motion/react' -import { itemVariants } from '@/lib/animation-variants' +import { itemVariants } from '@/lib/animation-variants' +import { ExportOptions } from './ExportOptions' -export const Header = ({ children, className, onClick }: { +export const Header = ({ children, className, onClick, repoUrl }: { children?: React.ReactNode, className?: string, - onClick?: () => void + onClick?: () => void, + repoUrl?: string }) => { return ( @@ -20,6 +22,8 @@ export const Header = ({ children, className, onClick }: { logo +
+ {children &&