Compare commits

..

No commits in common. "max/misc-improvements" and "refactor" have entirely different histories.

7 changed files with 20 additions and 24 deletions

View file

@ -51,14 +51,14 @@ export default function DocumentTabs({
{isEditing ? "Preview" : "Rendered"} {isEditing ? "Preview" : "Rendered"}
</TabsTrigger> </TabsTrigger>
</div> </div>
{isEditing ? ( {isEditing && (
<FormattingIcons <FormattingIcons
textareaRef={codeEditorRef} textareaRef={codeEditorRef}
className={`ml-auto ${ className={`ml-auto ${
activeTab === "preview" ? "hidden" : "hidden sm:block" activeTab === "preview" ? "hidden" : "hidden sm:block"
}`} }`}
/> />
) : null} )}
</TabsList> </TabsList>
<TabsContent value="edit"> <TabsContent value="edit">
<div <div
@ -68,16 +68,14 @@ export default function DocumentTabs({
flexDirection: "column" flexDirection: "column"
}} }}
> >
{isEditing ? ( <FormattingIcons
<FormattingIcons textareaRef={codeEditorRef}
textareaRef={codeEditorRef} className={`ml-auto ${
className={`ml-auto ${ activeTab === "preview"
activeTab === "preview" ? "hidden"
? "hidden" : "block text-muted-foreground sm:hidden"
: "block text-muted-foreground sm:hidden" }`}
}`} />
/>
) : null}
<TextareaMarkdown.Wrapper ref={codeEditorRef}> <TextareaMarkdown.Wrapper ref={codeEditorRef}>
<Textarea <Textarea
readOnly={!isEditing} readOnly={!isEditing}

View file

@ -14,7 +14,6 @@ import { useState } from "react"
import styles from "./api-keys.module.css" import styles from "./api-keys.module.css"
import { useSessionSWR } from "@lib/use-session-swr" import { useSessionSWR } from "@lib/use-session-swr"
import { TypographyH4 } from "@components/typography" import { TypographyH4 } from "@components/typography"
import FadeIn from "@components/fade-in"
// need to pass in the accessToken // need to pass in the accessToken
const APIKeys = ({ const APIKeys = ({
@ -122,12 +121,12 @@ const APIKeys = ({
</tbody> </tbody>
</table> </table>
) : ( ) : (
<FadeIn className="mt-4 text-center text-muted-foreground"> <p className="p-4 text-center text-muted-foreground">
No API keys found. No API keys found.
</FadeIn> </p>
) )
) : ( ) : (
<div className="mt-4 text-center"> <div style={{ marginTop: "var(--gap-quarter)" }}>
<Spinner /> <Spinner />
</div> </div>
)} )}

View file

@ -6,11 +6,11 @@ import { cn } from "@lib/cn"
import { Spinner } from "@components/spinner" import { Spinner } from "@components/spinner"
const buttonVariants = cva( 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-65 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-75 disabled:pointer-events-none ring-offset-background",
{ {
variants: { variants: {
variant: { variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90", default: "bg-primary/80 text-primary-foreground/80 hover:bg-primary/70",
destructive: destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90", "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline: outline:

View file

@ -1,14 +1,12 @@
// https://www.joshwcomeau.com/snippets/react-components/fade-in/ // https://www.joshwcomeau.com/snippets/react-components/fade-in/
import React from "react" import React from "react"
import styles from "./fade.module.css" import styles from "./fade.module.css"
import { cn } from "@lib/cn"
function FadeIn({ function FadeIn({
duration = 300, duration = 300,
delay = 0, delay = 0,
children, children,
as, as,
className,
...delegated ...delegated
}: { }: {
duration?: number duration?: number
@ -18,7 +16,7 @@ function FadeIn({
} & React.HTMLAttributes<HTMLElement>) { } & React.HTMLAttributes<HTMLElement>) {
if (as !== null && typeof as === "object") { if (as !== null && typeof as === "object") {
return React.cloneElement(as, { return React.cloneElement(as, {
className: cn(as.props.className, styles.fadeIn, className), className: styles.fadeIn,
style: { style: {
...(as.props.style || {}), ...(as.props.style || {}),
animationDuration: duration + "ms", animationDuration: duration + "ms",
@ -30,7 +28,7 @@ function FadeIn({
return ( return (
<Element <Element
{...delegated} {...delegated}
className={cn(styles.fadeIn, className)} className={styles.fadeIn}
style={{ style={{
...(delegated.style || {}), ...(delegated.style || {}),
animationDuration: duration + "ms", animationDuration: duration + "ms",

View file

@ -17,6 +17,7 @@ import { Button } from "@components/button"
import Link from "@components/link" import Link from "@components/link"
import { useSessionSWR } from "@lib/use-session-swr" import { useSessionSWR } from "@lib/use-session-swr"
import { useTheme } from "next-themes" import { useTheme } from "next-themes"
import styles from "./buttons.module.css"
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
import { cn } from "@lib/cn" import { cn } from "@lib/cn"

View file

@ -156,6 +156,7 @@ const ListItem = ({
return ( return (
<li key={file.id} className="text-black"> <li key={file.id} className="text-black">
<Link <Link
colored
href={`/post/${post.id}#${file.title}`} href={`/post/${post.id}#${file.title}`}
className="flex items-center gap-2 font-mono text-sm text-foreground" className="flex items-center gap-2 font-mono text-sm text-foreground"
> >

View file

@ -1,6 +1,5 @@
.spinner { .spinner {
@apply border-muted-foreground; border: 4px solid var(--light-gray);
border: 4px solid;
border-top: 4px solid var(--gray); border-top: 4px solid var(--gray);
border-radius: 50%; border-radius: 50%;
width: 24px; width: 24px;