Skip to content

Commit

Permalink
externally accessible user profiles and match histories
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar committed Aug 19, 2024
1 parent 5374805 commit c6f884a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -34,6 +36,12 @@ function App() {
<Route exact path="/logout">
<Logout />
</Route>
<Route path="/public/matches/:userId">
<MatchHistory />
</Route>
<Route path="/public/user/:userId">
<UserProfile />
</Route>
<Route path="/">
<AppLayout />
</Route>
Expand Down
8 changes: 8 additions & 0 deletions src/components/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/user-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c6f884a

Please sign in to comment.