Skip to content

Commit

Permalink
feat: update layout for some blocks to support darkmode
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-guoba committed Feb 27, 2024
1 parent 4de2568 commit 80b713b
Show file tree
Hide file tree
Showing 14 changed files with 830 additions and 102 deletions.
2 changes: 2 additions & 0 deletions app/(blog)/article/[...slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// import Script from "next/script"
import React from "react";

import 'simplebar-react/dist/simplebar.min.css'

export default async function LobyLayout({ children }: { children: React.ReactNode }) {
return <div className="relative flex min-h-screen flex-col">{children}</div>;
}
2 changes: 1 addition & 1 deletion app/notion/_components/bookmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function UnfurledBookmarkPreview({
return (
<div key={id} className={className}>
<Link href={url} target="_blank">
<div className="flex w-full max-w-full overflow-hidden border border-gray-200">
<div className="flex w-full max-w-full overflow-hidden border rounded-md border-gray-200 hover:bg-slate-200 dark:hover:bg-stone-500">
{/* <span className="sr-only">{url}</span> */}

<div className="w-96 flex-auto space-y-2 p-4">
Expand Down
2 changes: 1 addition & 1 deletion app/notion/_components/callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function CalloutRender({ block, className }: CalloutBlockProps) {
key={id}
className={cn(
className,
"box-border inline-flex w-full items-center rounded-[4px] border border-none bg-stone-100 p-4"
"inline-flex w-full items-center rounded-md border border-none bg-stone-100 dark:bg-stone-500 p-4"
)}
>
{icon && <IconRender type={icon.type} emoji={icon.emoji} external={icon.external} file={icon.file} />}
Expand Down
2 changes: 1 addition & 1 deletion app/notion/_components/embed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function EmbedRender({ block, className }: EmbedProps) {

return (
<figure key={id} className={cn(className, "mx-0 my-2 flex min-w-full max-w-full flex-col self-center")}>
<div className="flex w-full max-w-full justify-center self-center ">
<div className="flex w-full max-w-full justify-center self-center">
<iframe
width="95%"
height="540"
Expand Down
2 changes: 1 addition & 1 deletion app/notion/_components/equation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function EquationRender({ block, className, displayMode = true }: Equatio

// TODO: add copy to clipboard feature
return (
<span key={id} ref={katexTextRef} className={cn(className, "block text-base", displayMode ? "my-12" : "")}>
<span key={id} ref={katexTextRef} className={cn(className, "block text-base p-4 hover:bg-slate-200 dark:hover:bg-stone-500", displayMode ? "my-6" : "")}>
{expression}
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion app/notion/_components/link-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function UnfurledLinkPreview({
return (
<div key={id} className={className}>
<Link href={url} target="_blank">
<div className="flex w-full max-w-full overflow-hidden border border-gray-200">
<div className="flex w-full max-w-full overflow-hidden border border-gray-200 hover:bg-slate-200 dark:hover:bg-stone-500 rounded-md">
<span className="sr-only">{url}</span>
{icon ? (
<div className="flex w-12 flex-none justify-center">
Expand Down
Loading

0 comments on commit 80b713b

Please sign in to comment.