-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad0ea38
commit 6104972
Showing
22 changed files
with
200 additions
and
173 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,23 @@ | ||
import { Fragment } from "react" | ||
|
||
export const withDesktopOnly = (Component: React.FC<any>) => { | ||
const WithDesktopOnly = (props: any) => { | ||
return ( | ||
<Fragment> | ||
<div className="hidden md:block"> | ||
<Component {...props} /> | ||
</div> | ||
<div className="flex flex-col items-center px-6 py-32 md:hidden"> | ||
<p className="mb-4 text-center text-2xl">🙂</p> | ||
<p className="text-center text-muted-foreground"> | ||
This page is not available on mobile due to the editor's | ||
complexity and screen size limitations. Please access it on a | ||
desktop. | ||
</p> | ||
</div> | ||
</Fragment> | ||
) | ||
} | ||
|
||
return WithDesktopOnly | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,11 @@ | ||
import React from "react" | ||
|
||
const SectionLoading = () => { | ||
return ( | ||
<div className="absolute left-0 top-0 flex h-full w-full items-center justify-center"> | ||
Loading... | ||
</div> | ||
) | ||
} | ||
|
||
export default SectionLoading |
This file contains 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,48 +1,31 @@ | ||
import React from "react" | ||
import React, { Fragment } from "react" | ||
import { MoonIcon, SunIcon } from "lucide-react" | ||
import { useTheme } from "next-themes" | ||
|
||
import { Button } from "./ui/button" | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from "./ui/dropdown-menu" | ||
|
||
function ModeToggle() { | ||
const { setTheme } = useTheme() | ||
const { setTheme, resolvedTheme } = useTheme() | ||
|
||
const toggleTheme = (value: string) => { | ||
setTheme(value) | ||
} | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button | ||
variant="ghost" | ||
size="sm" | ||
className="flex h-8 w-8 items-center justify-center px-0 " | ||
> | ||
<SunIcon className="h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
<MoonIcon className="absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
<span className="sr-only">Toggle theme</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align="end"> | ||
<DropdownMenuItem onClick={() => toggleTheme("light")}> | ||
<span className="flex"> | ||
<SunIcon className="mr-2 h-4 w-4" /> Light | ||
</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => toggleTheme("dark")}> | ||
<span className="flex"> | ||
<MoonIcon className="mr-2 h-4 w-4" /> Dark | ||
</span> | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
<Fragment> | ||
<Button | ||
variant="ghost" | ||
size="sm" | ||
className="flex h-8 w-8 items-center justify-center px-0" | ||
onClick={() => { | ||
toggleTheme(resolvedTheme === "dark" ? "light" : "dark") | ||
}} | ||
> | ||
<SunIcon className="h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
<MoonIcon className="absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
<span className="sr-only">Toggle theme</span> | ||
</Button> | ||
</Fragment> | ||
) | ||
} | ||
export default ModeToggle |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
6104972
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
markdx – ./
markdx-arshadpro.vercel.app
markdx-git-main-arshadpro.vercel.app
markdx.vercel.app
www.markdx.site
markdx.site