-
Notifications
You must be signed in to change notification settings - Fork 678
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <i@innei.in>
- Loading branch information
Showing
13 changed files
with
207 additions
and
105 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
55 changes: 55 additions & 0 deletions
55
src/renderer/src/components/ui/modal/inspire/PeekModal.tsx
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,55 @@ | ||
import { m } from "framer-motion" | ||
import type { PropsWithChildren } from "react" | ||
import { Link } from "react-router-dom" | ||
|
||
import { microReboundPreset } from "../../constants/spring" | ||
import { useModalStack } from "../stacked" | ||
|
||
export const PeekModal = ( | ||
props: PropsWithChildren<{ | ||
to: string | ||
}>, | ||
) => { | ||
const { dismissAll, dismissTop } = useModalStack() | ||
const { to, children } = props | ||
|
||
return ( | ||
<div className="relative mx-auto mt-[10vh] max-w-full overflow-auto px-2 scrollbar-none lg:max-w-[65rem] lg:p-0"> | ||
<m.div | ||
initial={{ opacity: 0.5, y: 50 }} | ||
animate={{ opacity: 1, y: 0 }} | ||
exit={{ opacity: 0, y: 50 }} | ||
transition={microReboundPreset} | ||
className="scrollbar-none" | ||
> | ||
{children} | ||
</m.div> | ||
|
||
<m.div | ||
initial={true} | ||
exit={{ | ||
opacity: 0, | ||
}} | ||
className="fixed right-3 top-2 flex items-center gap-4" | ||
> | ||
<Link | ||
className="center flex size-8 rounded-full p-1 shadow-sm ring-1 ring-zinc-200 dark:ring-neutral-800" | ||
to={to} | ||
onClick={dismissAll} | ||
> | ||
<i className="i-mgc-fullscreen-2-cute-re text-lg" /> | ||
<span className="sr-only">Go to this link</span> | ||
</Link> | ||
|
||
<button | ||
type="button" | ||
className="center flex size-8 rounded-full p-1 shadow-sm ring-1 ring-zinc-200 dark:ring-neutral-800" | ||
onClick={dismissTop} | ||
> | ||
<i className="i-mgc-close-cute-re text-lg" /> | ||
<span className="sr-only">Dimiss</span> | ||
</button> | ||
</m.div> | ||
</div> | ||
) | ||
} |
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,20 @@ | ||
import { cn } from "@renderer/lib/utils" | ||
import type { JSX } from "react" | ||
|
||
export const Paper: Component<{ | ||
as?: keyof JSX.IntrinsicElements | Component | ||
}> = ({ children, className, as: As = "main" }) => ( | ||
<As | ||
className={cn( | ||
"relative bg-white dark:bg-zinc-900 md:col-start-1 lg:col-auto", | ||
"-m-4 p-[2rem_1rem] md:m-0 lg:p-[30px_45px]", | ||
"rounded-[0_6px_6px_0] border-zinc-200/70 dark:border-neutral-800 lg:border", | ||
"shadow-perfect perfect-sm", | ||
"min-w-0", | ||
"print:!border-none print:!bg-transparent print:!shadow-none", | ||
className, | ||
)} | ||
> | ||
{children} | ||
</As> | ||
) |
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 @@ | ||
export * from "./Paper" |
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.