🔧 Refactored the DnD grid scaffold a bit
This commit is contained in:
23
src/client/components/Cover.tsx
Normal file
23
src/client/components/Cover.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React, { forwardRef } from "react";
|
||||
|
||||
export const Cover = forwardRef(
|
||||
({ url, index, faded, style, ...props }, ref) => {
|
||||
const inlineStyles = {
|
||||
opacity: faded ? "0.2" : "1",
|
||||
transformOrigin: "0 0",
|
||||
height: index === 0 ? 410 : 200,
|
||||
gridRowStart: index === 0 ? "span 2" : null,
|
||||
gridColumnStart: index === 0 ? "span 2" : null,
|
||||
backgroundImage: `url("${url}")`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
backgroundColor: "grey",
|
||||
borderRadius: "10px",
|
||||
...style,
|
||||
};
|
||||
|
||||
return <div ref={ref} style={inlineStyles} {...props} />;
|
||||
},
|
||||
);
|
||||
|
||||
Cover.displayName = "Cover";
|
||||
Reference in New Issue
Block a user