Skip to content

Commit

Permalink
fix: fix ts problems
Browse files Browse the repository at this point in the history
  • Loading branch information
hiporox committed May 23, 2024
1 parent 98eb26d commit 7b39d4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/common/fidgets/FidgetWrapperEditMode.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { FidgetEditConfig, FidgetSettings } from "@/common/fidgets/makeFidget";
import { FidgetEditConfig, FidgetSettings } from ".";

type FidgetWrapperSettingsEditorProps = {
readonly editConfig: FidgetEditConfig;
Expand Down
20 changes: 6 additions & 14 deletions src/fidgets/ui/gallery.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import Image from "next/image";
import React, { CSSProperties } from 'react';
import TextInput from "@/common/ui/molecules/TextInput";
import { FidgetEditConfig, FidgetModule } from "@/common/fidgets";

Expand All @@ -24,22 +23,15 @@ const galleryConfig: FidgetEditConfig = {
};

const Gallery: React.FC<GalleryFidgetSettings> = ({ imageUrl }: GalleryFidgetSettings) => {
const imageUrlStyle = {
'--image-url': `url(${imageUrl})`,
} as CSSProperties;

return (
<div className ="rounded-md flex-1 items-center justify-center overflow-hidden relative size-full bg-cover">
<div className ="bg-[image:var(--image-url)] bg-cover size-full overflow-hidden"
style={{'--image-url': `url(${imageUrl})`}}
style={imageUrlStyle}
></div>
{/* <div className = "flex items-center justify-center opacity-0 hover:opacity-100 duration-500 absolute inset-0 z-10 flex bg-slate-400 bg-opacity-50">
<button onClick={switchMode} className = "absolute flex-1 size-1/12 opacity-50 hover:opacity-100 duration-500 z-10 flex justify-center items-center text-white font-semibold text-2xl">
<FaGear />
</button>
</div>
<Image
src={imageUrl}
alt={imageUrl}
fill
style={{objectFit: 'contain'}}
/> */}
</div>
)
}
Expand Down

0 comments on commit 7b39d4c

Please sign in to comment.