diff --git a/src/components/Kitty.tsx b/src/components/Kitty.tsx index f099705..7026316 100644 --- a/src/components/Kitty.tsx +++ b/src/components/Kitty.tsx @@ -5,6 +5,7 @@ import { useState, useCallback, useId, + type HTMLAttributes, } from "react"; import { type KittyContextProps } from "~/context/KittyContext"; import { useApp } from "~/hooks/useApp"; @@ -45,6 +46,7 @@ export const Kitty = (props: { const cols = Math.round( (container.current.clientWidth - PADDING_RIGHT) / CHAR_WIDTH, ); + const rows = Math.round(container.current.clientHeight / CHAR_HEIGHT); const width = cols * CHAR_WIDTH; @@ -67,6 +69,10 @@ export const Kitty = (props: { }; }, [snapToCharacter]); + const style: HTMLAttributes["style"] = props.rows + ? { height } + : { maxHeight: height, height: "100%" }; + return (
{props.children}