Skip to content

Commit 07c42b2

Browse files
author
Dylan Zhang
committed
add type for useRef
1 parent 8182fd9 commit 07c42b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/src/components/Terminal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Terminal = () => {
77

88
// Automatically select the end of the input as the custom
99
// cursor only works at the end of the input.
10-
const inputRef: any = useRef(null);
10+
const inputRef = useRef<HTMLInputElement>(null);
1111
const setInputEnd = () => {
1212
if (inputRef.current) {
1313
const len = inputRef.current.value.length;
@@ -32,10 +32,12 @@ const Terminal = () => {
3232
if (value.toLowerCase() === "~"
3333
|| value.toLowerCase() === "cd"
3434
|| value.toLowerCase() === "cd ~"
35+
|| value.toLowerCase() === "cd .."
3536
) {
3637
goToPage("/");
3738
} else if (value.toLowerCase() === "cd about"
3839
|| value.toLowerCase() === "cd about us"
40+
|| value.toLowerCase() === "cd about_us"
3941
) {
4042
goToPage("/about");
4143
} else if (value.toLowerCase() === "cd events"
@@ -53,6 +55,7 @@ const Terminal = () => {
5355
} else if (value.toLowerCase() === "cd contact"
5456
|| value.toLowerCase() === "cd contacts"
5557
|| value.toLowerCase() === "cd contact us"
58+
|| value.toLowerCase() === "cd contact_us"
5659
) {
5760
goToPage("/contact-us");
5861
}

0 commit comments

Comments
 (0)