diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index 1ecf08cd..d78c327a 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -121,6 +121,7 @@ const Index: NextPage = props => { width={x.data.width} height={x.data.height} caption={x.data.caption} + wide={x.wide} /> ) diff --git a/src/components/Picture/index.tsx b/src/components/Picture/index.tsx index 0ae4bc11..80e3e429 100644 --- a/src/components/Picture/index.tsx +++ b/src/components/Picture/index.tsx @@ -25,14 +25,16 @@ function size(w: number, h: number, tolerance: number) { export type PictureProps = Pic & { style?: React.CSSProperties + wide?: boolean } -export const Picture: React.FC = memo(props => { +export const Picture: React.FC = memo(({ wide = false, ...props }) => { const ss = size(props.width, props.height, 0.95) const layout = modifiers.get(ss) + const w = ss === 'horizontal' ? wide : false return ( -
+