Skip to content

Commit

Permalink
Remove authentication module from client
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlec committed Jan 12, 2022
1 parent 0990e7c commit d42d5f7
Show file tree
Hide file tree
Showing 42 changed files with 0 additions and 3,069 deletions.
15 changes: 0 additions & 15 deletions src/client/ui/main-screen/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import FeedbackPage from "./feedback/FeedbackPage";
import PreparePage from "./prepare/PreparePage";
import SettingsPage from "./settings/SettingsPage";

import {
FORGOT_PASSWORD_PAGE,
LOGIN_PAGE,
PROFILE_PAGE,
REGISTER_ACCOUNT_PAGE,
RESET_PASSWORD_PAGE,
VERIFY_PAGE,
} from "@jyosuushi/ui/modules/authentication/pages";
import { EXPLORE_PAGE } from "@jyosuushi/ui/modules/explore/pages";
import { RELEASE_NOTES_PAGE } from "@jyosuushi/ui/modules/release-notes/pages";

Expand All @@ -38,13 +30,6 @@ export const UNORDERED_NESTED_PAGES: ReadonlyArray<PageDefinition> = [
SETTINGS_PAGE,
RELEASE_NOTES_PAGE,
FEEDBACK_PAGE,
PROFILE_PAGE,
LOGIN_PAGE,
FORGOT_PASSWORD_PAGE,
REGISTER_ACCOUNT_PAGE,
RESET_PASSWORD_PAGE,
VERIFY_PAGE,
PROFILE_PAGE,
];

export { EXPLORE_PAGE, RELEASE_NOTES_PAGE };
50 changes: 0 additions & 50 deletions src/client/ui/main-screen/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import React from "react";
import { defineMessages } from "react-intl";

import useAuthenticationStatus, {
AuthenticationStatus,
} from "@jyosuushi/hooks/useAuthenticationStatus";

import { PageDefinition } from "@jyosuushi/ui/types";
import { LOGIN_PAGE } from "@jyosuushi/ui/modules/authentication/pages";
import {
EXPLORE_PAGE,
FEEDBACK_PAGE,
PREPARE_PAGE,
RELEASE_NOTES_PAGE,
SETTINGS_PAGE,
} from "@jyosuushi/ui/main-screen/pages";
import { PROFILE_PAGE } from "@jyosuushi/ui/modules/authentication/pages";

import ExplorePageIcon from "./explore-icon.svg";
import FeedbackPageIcon from "./feedback-icon.svg";
import LoginPageIcon from "./login-icon.svg";
import PreparePageIcon from "./prepare-icon.svg";
import ProfilePageIcon from "./profile-icon.svg";
import ReleaseNotesPageIcon from "./release-notes-icon.svg";
import SettingsPageIcon from "./settings-icon.svg";

Expand All @@ -36,18 +27,10 @@ const INTL_MESSAGES = defineMessages({
defaultMessage: "Feedback",
id: "Sidebar.pages.feedback",
},
loginPage: {
defaultMessage: "Login",
id: "Sidebar.pages.login",
},
preparePage: {
defaultMessage: "Prepare",
id: "Sidebar.pages.prepare",
},
profilePage: {
defaultMessage: "Your Profile",
id: "Sidebar.pages.profile",
},
releaseNotesPage: {
defaultMessage: "Release Notes",
id: "Sidebar.pages.releaseNotes",
Expand All @@ -59,26 +42,6 @@ const INTL_MESSAGES = defineMessages({
});

function Sidebar(): React.ReactElement {
// Connect to GraphQL to determine whether we're logged in, and who we are if we are
const authStatus = useAuthenticationStatus();

// Determine the user-related sidebar link
let userLinkPage: PageDefinition | null;
switch (authStatus) {
case AuthenticationStatus.Loading: {
userLinkPage = null;
break;
}
case AuthenticationStatus.NotAuthenticated: {
userLinkPage = LOGIN_PAGE;
break;
}
case AuthenticationStatus.Authenticated: {
userLinkPage = PROFILE_PAGE;
break;
}
}

// Render the component
return (
<div className={styles.sidebar}>
Expand Down Expand Up @@ -107,19 +70,6 @@ function Sidebar(): React.ReactElement {
page={FEEDBACK_PAGE}
text={INTL_MESSAGES.feedbackPage}
/>
<SidebarEntry
icon={
authStatus === AuthenticationStatus.Authenticated
? ProfilePageIcon
: LoginPageIcon
}
page={userLinkPage}
text={
authStatus === AuthenticationStatus.Authenticated
? INTL_MESSAGES.profilePage
: INTL_MESSAGES.loginPage
}
/>
</div>
);
}
Expand Down
1 change: 0 additions & 1 deletion src/client/ui/main-screen/sidebar/login-icon.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/client/ui/main-screen/sidebar/profile-icon.svg

This file was deleted.

181 changes: 0 additions & 181 deletions src/client/ui/modules/authentication/auth-form/AuthForm.tsx

This file was deleted.

Loading

0 comments on commit d42d5f7

Please sign in to comment.