From e5ac660413fd8e2879706cfb06c476aae9164b31 Mon Sep 17 00:00:00 2001
From: Simponic <elizabeth.hunt@simponic.xyz>
Date: Sat, 11 Feb 2023 00:08:30 -0700
Subject: Add vim keybindings, man pages

---
 front/src/routes/home.jsx | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

(limited to 'front/src/routes/home.jsx')

diff --git a/front/src/routes/home.jsx b/front/src/routes/home.jsx
index 3495d20..d4ba22b 100644
--- a/front/src/routes/home.jsx
+++ b/front/src/routes/home.jsx
@@ -3,15 +3,20 @@ import { Link } from "react-router-dom";
 
 import { useAuthContext } from "../context/auth_context";
 
+const generateSSHConfig = (username) => `
+Host chessh
+  Hostname ${process.env.REACT_APP_SSH_SERVER}
+  Port ${process.env.REACT_APP_SSH_PORT}
+  User "${username}"
+  PubkeyAuthentication yes
+`;
+
 export const Home = () => {
   const { player, signedIn } = useAuthContext();
 
   if (signedIn) {
-    const sshConfig = `Host chessh
-  Hostname ${process.env.REACT_APP_SSH_SERVER}
-  Port ${process.env.REACT_APP_SSH_PORT}
-  User "${player?.username}"
-  PubkeyAuthentication yes`;
+    const sshConfig = generateSSHConfig(player?.username);
+
     return (
       <>
         <h2>Welcome, {player?.username}</h2>
@@ -51,7 +56,7 @@ export const Home = () => {
             <li>Then, connect with:</li>
             <CopyBlock
               theme={dracula}
-              text={"ssh -t chessh"}
+              text={"ssh chessh"}
               language={"shell"}
               showLineNumbers={false}
               codeBlock
@@ -59,19 +64,8 @@ export const Home = () => {
           </div>
           <div>
             <li>
-              Finally, play chess! Ideally, keeping the following contols in
-              mind:
+              Finally, check out the short <a href="/man-pages">man pages</a> .
             </li>
-
-            <ul>
-              <li>Ctrl + b / Escape to return to the main menu.</li>
-              <li>Ctrl + c / Ctrl + d to exit CheSSH at any point.</li>
-              <li>Arrow keys to move around the board.</li>
-              <li>
-                Select a piece with "enter", and move it to a square by pressing
-                "enter" again.
-              </li>
-            </ul>
           </div>
         </ol>
       </>
-- 
cgit v1.2.3-70-g09d2

