Compare commits

...

2 commits

Author SHA1 Message Date
Max Leiter
18bc4c219f Fix file link color in post list 2023-07-21 21:35:36 -07:00
Max Leiter
92e16cde18 Misc improvements 2023-07-21 20:48:25 -07:00
7 changed files with 24 additions and 20 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,6 +68,7 @@ export default function DocumentTabs({
flexDirection: "column" flexDirection: "column"
}} }}
> >
{isEditing ? (
<FormattingIcons <FormattingIcons
textareaRef={codeEditorRef} textareaRef={codeEditorRef}
className={`ml-auto ${ className={`ml-auto ${
@ -76,6 +77,7 @@ export default function DocumentTabs({
: "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,6 +14,7 @@ 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 = ({
@ -121,12 +122,12 @@ const APIKeys = ({
</tbody> </tbody>
</table> </table>
) : ( ) : (
<p className="p-4 text-center text-muted-foreground"> <FadeIn className="mt-4 text-center text-muted-foreground">
No API keys found. No API keys found.
</p> </FadeIn>
) )
) : ( ) : (
<div style={{ marginTop: "var(--gap-quarter)" }}> <div className="mt-4 text-center">
<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-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: { variants: {
variant: { variant: {
default: "bg-primary/80 text-primary-foreground/80 hover:bg-primary/70", default: "bg-primary text-primary-foreground hover:bg-primary/90",
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,12 +1,14 @@
// 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
@ -16,7 +18,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: styles.fadeIn, className: cn(as.props.className, styles.fadeIn, className),
style: { style: {
...(as.props.style || {}), ...(as.props.style || {}),
animationDuration: duration + "ms", animationDuration: duration + "ms",
@ -28,7 +30,7 @@ function FadeIn({
return ( return (
<Element <Element
{...delegated} {...delegated}
className={styles.fadeIn} className={cn(styles.fadeIn, className)}
style={{ style={{
...(delegated.style || {}), ...(delegated.style || {}),
animationDuration: duration + "ms", animationDuration: duration + "ms",

View file

@ -17,7 +17,6 @@ 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,7 +156,6 @@ 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,5 +1,6 @@
.spinner { .spinner {
border: 4px solid var(--light-gray); @apply border-muted-foreground;
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;