Skip to content

Commit

Permalink
able to navigate to login page now. but erroring out majorly. need to…
Browse files Browse the repository at this point in the history
… debug interface exports. app.tsx should not need so many states passed through, only tokens.
  • Loading branch information
Alex-Lee-Myers committed Feb 1, 2022
1 parent 645c375 commit 792d554
Show file tree
Hide file tree
Showing 4 changed files with 356 additions and 150 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/node": "^16.11.21",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"eslint-plugin-react-hooks": "^4.3.0",
"formik": "^2.2.9",
"player.js": "^0.1.0",
"react": "^17.0.2",
Expand Down
11 changes: 7 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Login from '../src/components/Login';
import Navbar from '../src/components/Navbar';
// import Register from '../src/components/Register';


export type ABCtoken = {
isUserLoggedIn: boolean;
clearToken: () => void;
Expand All @@ -24,19 +25,21 @@ export type ABCuserInfo = {
emailAddress: string;
username: string;
id: string;
passwordhash: string,
}

export type ABCcalls = {
errorMessage: string;
fetchDb: () => Promise<void>;
fetchVideos: () => Promise<void>;
responseStatus: number;
mountyPython: boolean,
}


// Did not use React.FunctionComponent as per (https://github.com/typescript-cheatsheets/react/blob/main/README.md#basic-cheatsheet-table-of-contents) this methology is deprecated.

const App: React.FunctionComponent = () => {
const App = () => {
const [isAdmin, setIsAdmin] = useState<boolean>(false);
const [emailAddress, setEmailAddress] = useState<string>('');
const [errorMessage, setErrorMessage] = useState<string>('');
Expand All @@ -46,6 +49,7 @@ const App: React.FunctionComponent = () => {
const [isUserLoggedIn, setIsUserLoggedIn] = useState<boolean>(false);
const [sessionToken, setSessionToken] = useState<string | null>('');
const [username, setUsername] = useState<string>('');


//! fetching all videos, regardless of validation.
//! sort by newest first.
Expand Down Expand Up @@ -128,9 +132,8 @@ const App: React.FunctionComponent = () => {
isAdmin={isAdmin}
/>} /> */}
<Route path="/login" element={<Login
sessionToken={sessionToken}
setSessionToken={setSessionToken}
updateToken={updateToken}


/>} />
</Routes>
</Router>
Expand Down
Loading

0 comments on commit 792d554

Please sign in to comment.