2022-06-04 03:13:19 +00:00
|
|
|
import { PostcardContext } from "./PostcardContext"
|
|
|
|
import { useDefinedContext } from "../../utils/definedContext";
|
2022-06-07 10:48:47 +00:00
|
|
|
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
|
|
|
|
2022-06-08 00:38:58 +00:00
|
|
|
return (
|
2022-06-04 03:13:19 +00:00
|
|
|
<div
|
2022-06-09 21:49:40 +00:00
|
|
|
className={classNames("postcard", `postcard-${visibility}`)}
|
2022-06-07 10:48:47 +00:00
|
|
|
style={{
|
2022-06-09 21:43:38 +00:00
|
|
|
backgroundImage: image,
|
2022-06-07 10:48:47 +00:00
|
|
|
}}
|
2022-06-04 03:13:19 +00:00
|
|
|
/>
|
2022-06-08 00:38:58 +00:00
|
|
|
)
|
2022-06-04 03:13:19 +00:00
|
|
|
}
|