Skip to content

Commit

Permalink
fix image preview
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Feb 25, 2025
1 parent 48fdfa9 commit f48ec68
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions app/routes/users+/$username_+/__note-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,21 @@ function ImageChooser({
>
{previewImage ? (
<div className="relative">
<Img
src={previewImage}
alt={altText ?? ''}
className="h-32 w-32 rounded-lg object-cover"
width={512}
height={512}
/>
{existingImage ? (
<Img
src={previewImage}
alt={altText ?? ''}
className="h-32 w-32 rounded-lg object-cover"
width={512}
height={512}
/>
) : (
<img
src={previewImage}
alt={altText ?? ''}
className="h-32 w-32 rounded-lg object-cover"
/>
)}
{existingImage ? null : (
<div className="pointer-events-none absolute -right-0.5 -top-0.5 rotate-12 rounded-sm bg-secondary px-2 py-1 text-xs text-secondary-foreground shadow-md">
new
Expand Down

0 comments on commit f48ec68

Please sign in to comment.