1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 01:01:17 -04:00

extract fake DOS terminal into a separate component

This commit is contained in:
2022-01-31 15:47:54 -05:00
parent 7933c9ba02
commit 2e65d0ef4a
5 changed files with 74 additions and 44 deletions

View File

@@ -0,0 +1,18 @@
import { forwardRef } from "react";
import classNames from "classnames";
import type { Ref, HTMLAttributes } from "react";
import styles from "./Terminal.module.css";
type Props = HTMLAttributes<HTMLDivElement>;
// a DOS-style terminal box with dynamic text
const Terminal = forwardRef(function Terminal({ className, ...rest }: Props, ref: Ref<HTMLSpanElement>) {
return (
<div className={classNames("monospace", className, styles.terminal)} {...rest}>
<span ref={ref} /> <span className={styles.blink} />
</div>
);
});
export default Terminal;