Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit07c42b2

Browse files
author
Dylan Zhang
committed
add type for useRef
1 parent8182fd9 commit07c42b2

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-
constinputRef:any=useRef(null);
10+
constinputRef=useRef<HTMLInputElement>(null);
1111
constsetInputEnd=()=>{
1212
if(inputRef.current){
1313
constlen=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
}elseif(value.toLowerCase()==="cd about"
3839
||value.toLowerCase()==="cd about us"
40+
||value.toLowerCase()==="cd about_us"
3941
){
4042
goToPage("/about");
4143
}elseif(value.toLowerCase()==="cd events"
@@ -53,6 +55,7 @@ const Terminal = () => {
5355
}elseif(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)

[8]ページ先頭

©2009-2025 Movatter.jp