fix(terminal): rename height -> rows
This commit is contained in:
@@ -8,7 +8,10 @@ export const Terminal = (props: {
|
|||||||
}) => {
|
}) => {
|
||||||
const terminalRef = useRef<HTMLDivElement>(null);
|
const terminalRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const [size, setSize] = useState<{ cols: number; rows: number }>();
|
const [size, setSize] = useState<{ cols: number; rows: number }>({
|
||||||
|
cols: -1,
|
||||||
|
rows: -1,
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const precision = 300;
|
const precision = 300;
|
||||||
@@ -55,7 +58,7 @@ export const Terminal = (props: {
|
|||||||
)}
|
)}
|
||||||
style={{ backdropFilter: "blur(2px)" }}
|
style={{ backdropFilter: "blur(2px)" }}
|
||||||
>
|
>
|
||||||
{size && props.children}
|
{size.cols > -1 && props.children}
|
||||||
</div>
|
</div>
|
||||||
</TerminalContextProvider>
|
</TerminalContextProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,4 +21,3 @@ export const Text = (props: {
|
|||||||
{props.children}
|
{props.children}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createContext, useContext } from "react";
|
import { createContext, useContext } from "react";
|
||||||
|
|
||||||
const TerminalContext = createContext<{ cols: number; height: number } | null>(
|
const TerminalContext = createContext<{ cols: number; rows: number } | null>(
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user