Compare commits
2 commits
refactor
...
max/misc-i
Author | SHA1 | Date | |
---|---|---|---|
|
18bc4c219f | ||
|
92e16cde18 |
7 changed files with 24 additions and 20 deletions
|
@ -51,14 +51,14 @@ export default function DocumentTabs({
|
|||
{isEditing ? "Preview" : "Rendered"}
|
||||
</TabsTrigger>
|
||||
</div>
|
||||
{isEditing && (
|
||||
{isEditing ? (
|
||||
<FormattingIcons
|
||||
textareaRef={codeEditorRef}
|
||||
className={`ml-auto ${
|
||||
activeTab === "preview" ? "hidden" : "hidden sm:block"
|
||||
}`}
|
||||
/>
|
||||
)}
|
||||
) : null}
|
||||
</TabsList>
|
||||
<TabsContent value="edit">
|
||||
<div
|
||||
|
@ -68,14 +68,16 @@ export default function DocumentTabs({
|
|||
flexDirection: "column"
|
||||
}}
|
||||
>
|
||||
<FormattingIcons
|
||||
textareaRef={codeEditorRef}
|
||||
className={`ml-auto ${
|
||||
activeTab === "preview"
|
||||
? "hidden"
|
||||
: "block text-muted-foreground sm:hidden"
|
||||
}`}
|
||||
/>
|
||||
{isEditing ? (
|
||||
<FormattingIcons
|
||||
textareaRef={codeEditorRef}
|
||||
className={`ml-auto ${
|
||||
activeTab === "preview"
|
||||
? "hidden"
|
||||
: "block text-muted-foreground sm:hidden"
|
||||
}`}
|
||||
/>
|
||||
) : null}
|
||||
<TextareaMarkdown.Wrapper ref={codeEditorRef}>
|
||||
<Textarea
|
||||
readOnly={!isEditing}
|
||||
|
|
|
@ -14,6 +14,7 @@ import { useState } from "react"
|
|||
import styles from "./api-keys.module.css"
|
||||
import { useSessionSWR } from "@lib/use-session-swr"
|
||||
import { TypographyH4 } from "@components/typography"
|
||||
import FadeIn from "@components/fade-in"
|
||||
|
||||
// need to pass in the accessToken
|
||||
const APIKeys = ({
|
||||
|
@ -121,12 +122,12 @@ const APIKeys = ({
|
|||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<p className="p-4 text-center text-muted-foreground">
|
||||
<FadeIn className="mt-4 text-center text-muted-foreground">
|
||||
No API keys found.
|
||||
</p>
|
||||
</FadeIn>
|
||||
)
|
||||
) : (
|
||||
<div style={{ marginTop: "var(--gap-quarter)" }}>
|
||||
<div className="mt-4 text-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -6,11 +6,11 @@ import { cn } from "@lib/cn"
|
|||
import { Spinner } from "@components/spinner"
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-75 disabled:pointer-events-none ring-offset-background",
|
||||
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-65 disabled:pointer-events-none ring-offset-background",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary/80 text-primary-foreground/80 hover:bg-primary/70",
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||
destructive:
|
||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||
outline:
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
// https://www.joshwcomeau.com/snippets/react-components/fade-in/
|
||||
import React from "react"
|
||||
import styles from "./fade.module.css"
|
||||
import { cn } from "@lib/cn"
|
||||
|
||||
function FadeIn({
|
||||
duration = 300,
|
||||
delay = 0,
|
||||
children,
|
||||
as,
|
||||
className,
|
||||
...delegated
|
||||
}: {
|
||||
duration?: number
|
||||
|
@ -16,7 +18,7 @@ function FadeIn({
|
|||
} & React.HTMLAttributes<HTMLElement>) {
|
||||
if (as !== null && typeof as === "object") {
|
||||
return React.cloneElement(as, {
|
||||
className: styles.fadeIn,
|
||||
className: cn(as.props.className, styles.fadeIn, className),
|
||||
style: {
|
||||
...(as.props.style || {}),
|
||||
animationDuration: duration + "ms",
|
||||
|
@ -28,7 +30,7 @@ function FadeIn({
|
|||
return (
|
||||
<Element
|
||||
{...delegated}
|
||||
className={styles.fadeIn}
|
||||
className={cn(styles.fadeIn, className)}
|
||||
style={{
|
||||
...(delegated.style || {}),
|
||||
animationDuration: duration + "ms",
|
||||
|
|
|
@ -17,7 +17,6 @@ import { Button } from "@components/button"
|
|||
import Link from "@components/link"
|
||||
import { useSessionSWR } from "@lib/use-session-swr"
|
||||
import { useTheme } from "next-themes"
|
||||
import styles from "./buttons.module.css"
|
||||
import { useEffect, useState } from "react"
|
||||
import { cn } from "@lib/cn"
|
||||
|
||||
|
|
|
@ -156,7 +156,6 @@ const ListItem = ({
|
|||
return (
|
||||
<li key={file.id} className="text-black">
|
||||
<Link
|
||||
colored
|
||||
href={`/post/${post.id}#${file.title}`}
|
||||
className="flex items-center gap-2 font-mono text-sm text-foreground"
|
||||
>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.spinner {
|
||||
border: 4px solid var(--light-gray);
|
||||
@apply border-muted-foreground;
|
||||
border: 4px solid;
|
||||
border-top: 4px solid var(--gray);
|
||||
border-radius: 50%;
|
||||
width: 24px;
|
||||
|
|
Loading…
Reference in a new issue