From c6f884a9a31fe435767f15164bb3940e2f127c86 Mon Sep 17 00:00:00 2001 From: Chris Vickery Date: Mon, 19 Aug 2024 11:46:26 -0700 Subject: [PATCH] externally accessible user profiles and match histories --- src/App.jsx | 8 ++++++++ src/components/auth.js | 8 ++++++++ src/components/user-info.jsx | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 16f82f1..bb47611 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -13,6 +13,8 @@ import AppLayout from './components/layout'; import Auth from './components/auth'; import Login from './components/login'; import Logout from './components/logout'; +import MatchHistory from './components/pages/match-history'; +import UserProfile from './components/pages/user-profile'; function App() { return ( @@ -34,6 +36,12 @@ function App() { + + + + + + diff --git a/src/components/auth.js b/src/components/auth.js index 2b92dd7..6acddcd 100644 --- a/src/components/auth.js +++ b/src/components/auth.js @@ -8,6 +8,14 @@ import { partial } from 'ap'; import { refreshAuthToken } from '../api/auth'; +Request.configure({ + baseUrl: "https://chrisinajar.com:2053", + // baseUrl: 'http://localhost:6969/', + options: { + json: true + } +}); + const initialState = { user: null, hasUpdated: false, diff --git a/src/components/user-info.jsx b/src/components/user-info.jsx index e0be743..00e4bbe 100644 --- a/src/components/user-info.jsx +++ b/src/components/user-info.jsx @@ -23,7 +23,7 @@ function UserInfo(props = {}) { const [userProfile, setUserProfile] = useState(props.userProfile || null); const { user } = userState; - const greeting = (user.steamid === userId) ? 'Hello, ' : ''; + const greeting = (user && user.steamid === userId) ? 'Hello, ' : ''; useEffect(() => { async function fetchData() {