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-07 10:48:47 +00:00
|
|
|
const {postcard, visible} = useDefinedContext(PostcardContext)
|
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-07 10:48:47 +00:00
|
|
|
className={classNames({
|
|
|
|
"postcard": true,
|
|
|
|
"postcard-visible": visible,
|
|
|
|
})}
|
|
|
|
style={{
|
|
|
|
backgroundImage: `url(${postcard})`
|
|
|
|
}}
|
2022-06-04 03:13:19 +00:00
|
|
|
/>
|
2022-06-08 00:38:58 +00:00
|
|
|
)
|
2022-06-04 03:13:19 +00:00
|
|
|
}
|