add: keyboard shortcut for navigation in labelling page
This commit is contained in:
parent
50a1102ae9
commit
0b4893b5c4
@ -59,6 +59,7 @@ export function VideoInfo({ video }: VideoInfoProps) {
|
||||
<span>发布于 {formatDateTime(new Date(video.published_at!))}</span>
|
||||
<br />
|
||||
<span>播放:{(video.views ?? 0).toLocaleString()}</span>
|
||||
|
||||
<span>时长:{formatDuration(video.duration || 0)}</span>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@ -136,12 +136,15 @@ export default function Home() {
|
||||
}
|
||||
|
||||
const key = e.key.toUpperCase();
|
||||
console.log(key);
|
||||
|
||||
if (leftKeys.includes(key)) {
|
||||
handleLabel(false);
|
||||
} else if (rightKeys.includes(key)) {
|
||||
handleLabel(true);
|
||||
} else if (key === "ARROWLEFT") {
|
||||
navigateTo(currentIndex - 1);
|
||||
} else if (key === "ARROWRIGHT") {
|
||||
navigateTo(currentIndex + 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
"start": "react-router-serve ./build/server/index.js",
|
||||
"typecheck": "react-router typegen && tsc",
|
||||
"format": "prettier --write .",
|
||||
"deploy": "wrangler deploy"
|
||||
"deploy": "wrangler deploy",
|
||||
"go": "bun run build && bun run deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alikia/dark-theme-hook": "^1.0.2",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user