diff --git a/src/components/AboutModal/AboutModal.tsx b/src/components/AboutModal/AboutModal.tsx new file mode 100644 index 0000000..8d05ddd --- /dev/null +++ b/src/components/AboutModal/AboutModal.tsx @@ -0,0 +1,78 @@ +import React, { FC, ReactElement } from "react"; +import { Modal } from "react-bootstrap"; +import { ABOUT_APP_HEADER } from "../../strings"; + +export const ABOUT_BODY = + "This is a simple app to help you keep track of your logs. Highly customizable logs allow you to track anything you want!"; +export const ABOUT_DATA_HEADER = "Data Usage"; +export const ABOUT_DATA_BODY_1 = + "This app uses local storage to store your logs, no data is sent to a server. Your data is never sold to anyone, EVER."; +export const ABOUT_DATA_BODY_2 = + "If you want to delete your personal data, just delete the Log / Entry. To completely clear the App data, clear your browser's local storage via the browser inspector tools."; +export const ABOUT_ISSUES_HEADER = "Report Issues"; +export const ABOUT_ISSUES_BODY = + "If you find any issues with the app, please report them on the GitHub issues page."; +export const ABOUT_ISSUES_LINK = + "https://github.com/AccessiTech/tracker/issues"; +export const ABOUT_FEATURES_HEADER = "Feature Requests"; +export const ABOUT_FEATURES_BODY = + "If you have any feature requests, please feel free to start (or join) a discussion on Github!"; +export const ABOUT_FEATURES_LINK = + "https://github.com/AccessiTech/tracker/discussions"; +export const GITHUB_ISSUES = "GitHub Issues"; +export const GITHUB_DISCUSSIONS = "GitHub Discussions"; + +export interface AboutModalProps { + show: boolean; + onHide: () => void; +} +export const AboutModal: FC = ({ + show, + onHide, +}): ReactElement => { + return ( + + +

{ABOUT_APP_HEADER}

+
+ +

{ABOUT_BODY}

+

{ABOUT_DATA_HEADER}

+

{ABOUT_DATA_BODY_1}

+

{ABOUT_DATA_BODY_2}

+

{ABOUT_ISSUES_HEADER}

+

+ {ABOUT_ISSUES_BODY} + + + {GITHUB_ISSUES} + +

+

{ABOUT_FEATURES_HEADER}

+

+ {ABOUT_FEATURES_BODY} + + + {GITHUB_DISCUSSIONS} + +

+
+
+ ); +}; diff --git a/src/components/AboutModal/index.ts b/src/components/AboutModal/index.ts new file mode 100644 index 0000000..f0e22ce --- /dev/null +++ b/src/components/AboutModal/index.ts @@ -0,0 +1,2 @@ +export { AboutModal } from "./AboutModal"; +export type { AboutModalProps } from "./AboutModal"; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index b61e336..847b6e4 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -2,7 +2,7 @@ import React from "react"; import { FC, ReactElement } from "react"; import { Button } from "react-bootstrap"; import { useNavigate } from "react-router-dom"; -import { OUTLINE_SECONDARY, SIDEBAR_HEADER } from "../../strings"; +import { OUTLINE_SECONDARY, ABOUT_APP_HEADER } from "../../strings"; import { ToggleSidebar } from "../Sidebar"; import "./header.scss"; @@ -44,9 +44,9 @@ export const Header: FC = ({ className="sidebar__button_toggle" variant={OUTLINE_SECONDARY} onClick={() => toggleSidebar(true)} - title={SIDEBAR_HEADER} + title={ABOUT_APP_HEADER} > - i + ); diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index f223446..f139364 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -1,29 +1,10 @@ import React, { useState } from "react"; import { FC, ReactElement } from "react"; -import { Accordion, Offcanvas } from "react-bootstrap"; -import { END, SIDEBAR_HEADER } from "../../strings"; +import { Button, Offcanvas } from "react-bootstrap"; +import { ABOUT_APP_HEADER, END, LINK_SECONDARY } from "../../strings"; import "./sidebar.scss"; import { GoogleAuthButton } from "../GoogleAuth"; - -export const SIDEBAR_BODY = - "This is a simple app to help you keep track of your logs. Highly customizable logs allow you to track anything you want!"; -export const SIDEBAR_DATA_HEADER = "Data Usage"; -export const SIDEBAR_DATA_BODY_1 = - "This app uses local storage to store your logs, no data is sent to a server. Your data is never sold to anyone, EVER."; -export const SIDEBAR_DATA_BODY_2 = - "If you want to delete your personal data, just delete the Log / Entry. To completely clear the App data, clear your browser's local storage via the browser inspector tools."; -export const SIDEBAR_ISSUES_HEADER = "Report Issues"; -export const SIDEBAR_ISSUES_BODY = - "If you find any issues with the app, please report them on the GitHub issues page."; -export const SIDEBAR_ISSUES_LINK = - "https://github.com/AccessiTech/tracker/issues"; -export const SIDEBAR_FEATURES_HEADER = "Feature Requests"; -export const SIDEBAR_FEATURES_BODY = - "If you have any feature requests, please feel free to start (or join) a discussion on Github!"; -export const SIDEBAR_FEATURES_LINK = - "https://github.com/AccessiTech/tracker/discussions"; -export const GITHUB_ISSUES = "GitHub Issues"; -export const GITHUB_DISCUSSIONS = "GitHub Discussions"; +import { AboutModal } from "../AboutModal"; /** * Sidebar Component @@ -44,12 +25,13 @@ export const Sidebar: FC = ({ toggleSidebar, }): ReactElement => { const [credentials, setCredentials] = useState(null) as any; - + const [showAbout, setShowAbout] = useState(false) as any; return ( toggleSidebar(false)} placement={END} + className="sidebar" > = ({ setCredentials(null); }} /> + - - - -

{SIDEBAR_HEADER}

-
- -

{SIDEBAR_BODY}

-
-
- - -

{SIDEBAR_DATA_HEADER}

-
- -

{SIDEBAR_DATA_BODY_1}

-

{SIDEBAR_DATA_BODY_2}

-
-
- - -

{SIDEBAR_ISSUES_HEADER}

-
- -

- {SIDEBAR_ISSUES_BODY} - - - {GITHUB_ISSUES} - -

-
-
- - -

{SIDEBAR_FEATURES_HEADER}

-
- -

- {SIDEBAR_FEATURES_BODY} - - - {GITHUB_DISCUSSIONS} - -

-
-
-
+ setShowAbout(false)} />

Version: {process.env.REACT_APP_VERSION} diff --git a/src/components/Sidebar/sidebar.scss b/src/components/Sidebar/sidebar.scss index d2178ae..33f640c 100644 --- a/src/components/Sidebar/sidebar.scss +++ b/src/components/Sidebar/sidebar.scss @@ -1,4 +1,29 @@ @import "../../variables.scss"; +.sidebar { + .offcanvas-header { + justify-content: flex-end; + + button:first-of-type { + margin-right: auto; + } + + .sidebar__about_btn { + margin-right: 0.25rem; + opacity: 0.5; + i { + vertical-align: 0; + } + &:hover, + &:active, + &:focus { + opacity: 1; + } + &:focus { + box-shadow: 0 0 0 0.25rem rgb(13 110 253 / 25%); + } + } + } +} .sidebar__p_version { font-size: 0.9rem; margin: 1rem 1rem 0.75rem; diff --git a/src/strings.ts b/src/strings.ts index 6ed2dec..3437e0b 100644 --- a/src/strings.ts +++ b/src/strings.ts @@ -11,9 +11,11 @@ export const OUTLINE_PRIMARY = `outline-${PRIMARY}`; export const OUTLINE_SECONDARY = `outline-${SECONDARY}`; export const OUTLINE_DANGER = `outline-${DANGER}`; export const OUTLINE_DARK = `outline-${DARK}`; +export const OUTLINE_INFO = `outline-${INFO}`; export const TEXT_DANGER = `text-${DANGER}`; export const TEXT_MUTED = `text-${MUTED}`; export const TEXT_SUCCESS = `text-${SUCCESS}`; +export const LINK_SECONDARY = `link-${SECONDARY}`; export const TYPE = "type"; export const SUBMIT = "submit"; export const RESET = "reset"; @@ -96,7 +98,7 @@ export const NONE_LABEL = "None"; export const STEPS_LABEL = "Steps"; export const CREATE_LABEL = "Create"; export const UPDATE_LABEL = "Update"; -export const SIDEBAR_HEADER = "About the App"; +export const ABOUT_APP_HEADER = "About the App"; export const OOPS = "Oops!"; export const LOG_NOT_FOUND = "Log not found"; export const DATA = "Data";