fix(web): make camera latest.jpg responsive

This commit is contained in:
Paul Armstrong
2021-01-25 09:49:00 -08:00
committed by Blake Blackshear
parent 4a18fc58de
commit 9cf49b5bc4
5 changed files with 63 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
import { h } from 'preact';
import Box from './components/Box';
import CameraImage from './components/CameraImage';
import Events from './Events';
import Heading from './components/Heading';
import { route } from 'preact-router';
@@ -23,7 +24,6 @@ export default function Cameras() {
}
function Camera({ name }) {
const apiHost = useContext(ApiHost);
const href = `/cameras/${name}`;
return (
@@ -32,7 +32,7 @@ function Camera({ name }) {
href={href}
>
<Heading size="base">{name}</Heading>
<img className="w-full" src={`${apiHost}/api/${name}/latest.jpg`} />
<CameraImage camera={name} />
</Box>
);
}