diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index 3cdc60959..a6f96e8b3 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -17,7 +17,8 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:@next/next/recommended" + "plugin:@next/next/recommended", + "plugin:jsx-a11y/recommended" ], "rules": { "react/no-unescaped-entities": 0, diff --git a/frontend/src/common/components/NavBarMain.tsx b/frontend/src/common/components/NavBarMain.tsx index 579746a9f..eeb78e873 100644 --- a/frontend/src/common/components/NavBarMain.tsx +++ b/frontend/src/common/components/NavBarMain.tsx @@ -192,6 +192,7 @@ const NavbarMain = () => { )}
- + {Math.floor((pointsEarned / points) * 100)}%
diff --git a/frontend/src/features/LearnMod/ModulesSideBar.tsx b/frontend/src/features/LearnMod/ModulesSideBar.tsx index 118d08a50..7199bfc0f 100644 --- a/frontend/src/features/LearnMod/ModulesSideBar.tsx +++ b/frontend/src/features/LearnMod/ModulesSideBar.tsx @@ -41,6 +41,7 @@ const ModulesSideBar = () => { return (
  • Router.push( { @@ -50,6 +51,15 @@ const ModulesSideBar = () => { "/LearnContent" ) } + onKeyDown={() => + Router.push( + { + pathname: "/LearnContent", + query: sectionSpec, + }, + "/LearnContent" + ) + } key={index2} style={{ color: "white" }} > diff --git a/frontend/src/features/Train/components/TrainspaceLayout.tsx b/frontend/src/features/Train/components/TrainspaceLayout.tsx index 177bf2589..6ed7087f1 100644 --- a/frontend/src/features/Train/components/TrainspaceLayout.tsx +++ b/frontend/src/features/Train/components/TrainspaceLayout.tsx @@ -42,7 +42,7 @@ const TrainspaceLayout = ({ > {code} - + diff --git a/frontend/src/features/Train/features/Image/components/ImageTrainspace.tsx b/frontend/src/features/Train/features/Image/components/ImageTrainspace.tsx index f01623925..0fb9a9f59 100644 --- a/frontend/src/features/Train/features/Image/components/ImageTrainspace.tsx +++ b/frontend/src/features/Train/features/Image/components/ImageTrainspace.tsx @@ -153,7 +153,7 @@ const TrainspaceStepInner = ({ } { - isButtonClicked ? : null + isButtonClicked ? : null } )} diff --git a/frontend/src/features/Train/features/Tabular/components/TabularTrainspace.tsx b/frontend/src/features/Train/features/Tabular/components/TabularTrainspace.tsx index 40aef3e08..6dcc74f31 100644 --- a/frontend/src/features/Train/features/Tabular/components/TabularTrainspace.tsx +++ b/frontend/src/features/Train/features/Tabular/components/TabularTrainspace.tsx @@ -99,7 +99,7 @@ const TrainspaceStepInner = ({ let trainbuttontext: string | JSX.Element; if (isButtonClicked) { - trainbuttontext = ; + trainbuttontext = ; } else { if (step < TRAINSPACE_SETTINGS.steps.length - 1) { trainbuttontext = "Next"; diff --git a/frontend/src/pages/learn.tsx b/frontend/src/pages/learn.tsx index d11173cc5..04ba6759f 100644 --- a/frontend/src/pages/learn.tsx +++ b/frontend/src/pages/learn.tsx @@ -37,7 +37,7 @@ const LearnMod = () => {
    {content.map((lesson, index) => { //const moduleProgress = user.userProgressData[lesson.moduleID]; - + console.log(lesson); return ( {
    { Promise.allSettled([ (async () => { @@ -122,6 +124,62 @@ const SettingsBlock = () => { })(), ]); }} + onKeyDown={async () => { + Promise.allSettled([ + (async () => { + if (fullName) { + try { + await dispatch( + updateUserDisplayName({ displayName: fullName }) + ).unwrap(); + toast.success("Successfully updated display name", { + position: toast.POSITION.TOP_CENTER, + }); + } catch (e) { + toast.error( + `Display name - ${(e as SerializedError).message}`, + { + position: toast.POSITION.TOP_CENTER, + } + ); + } + } + })(), + (async () => { + if (email) { + try { + await dispatch(updateUserEmail({ email })).unwrap(); + toast.success("Successfully updated email", { + position: toast.POSITION.TOP_CENTER, + }); + } catch (e) { + toast.error(`Email - ${(e as SerializedError).message}`, { + position: toast.POSITION.TOP_CENTER, + }); + } + } + })(), + (async () => { + if (password) { + try { + await dispatch( + updateUserPassword({ + password, + checkPassword, + }) + ).unwrap(); + toast.success("Successfully updated password", { + position: toast.POSITION.TOP_CENTER, + }); + } catch (e) { + toast.error(`Password - ${(e as SerializedError).message}`, { + position: toast.POSITION.TOP_CENTER, + }); + } + } + })(), + ]); + }} >