1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 15:14:23 +00:00
festa/components/postcard/PostcardRenderer.tsx

19 lines
522 B
TypeScript
Raw Normal View History

2022-06-04 03:13:19 +00:00
import { PostcardContext } from "./PostcardContext"
import { useDefinedContext } from "../../utils/definedContext";
import classNames from "classnames";
2022-06-04 03:13:19 +00:00
export function PostcardRenderer() {
2022-06-09 21:43:38 +00:00
const { image, visibility } = useDefinedContext(PostcardContext)
console.debug("[PostcardRenderer] Re-rendering with:", image)
2022-06-04 03:13:19 +00:00
return (
2022-06-04 03:13:19 +00:00
<div
className={classNames("postcard", `postcard-${visibility}`)}
style={{
2022-06-09 21:43:38 +00:00
backgroundImage: image,
}}
2022-06-04 03:13:19 +00:00
/>
)
2022-06-04 03:13:19 +00:00
}