-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2d87b7
commit a758e8e
Showing
16 changed files
with
275 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Steam Trader</title> | ||
<!-- Bootstrap --> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
|
@@ -16,13 +17,21 @@ | |
integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" | ||
crossorigin="anonymous" | ||
></script> | ||
<!-- React --> | ||
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script> | ||
<!-- Socket.io --> | ||
<script | ||
src="https://cdn.socket.io/3.1.3/socket.io.min.js" | ||
integrity="sha384-cPwlPLvBTa3sKAgddT6krw0cJat7egBga3DJepJyrLl4Q9/5WLra3rrnMcyTyOnh" | ||
crossorigin="anonymous" | ||
></script> | ||
<!-- Axios --> | ||
<script | ||
src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js" | ||
integrity="sha512-bZS47S7sPOxkjU/4Bt0zrhEtWx0y0CRkhEp8IckzK+ltifIIE9EMIMTuT/mEzoIMewUINruDBIR/jJnbguonqQ==" | ||
crossorigin="anonymous" | ||
></script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import React from 'react'; | ||
import './header.css'; | ||
|
||
import { Nav, NavBrand } from './bootstrap'; | ||
|
||
export default function Header() { | ||
return ( | ||
<header id="header" className="shadow"> | ||
<Nav> | ||
<NavBrand>Steam Trader</NavBrand> | ||
</Nav> | ||
<nav className="justify-content-center navbar navbar-expand navbar-dark bg-dark"> | ||
<span className="navbar-brand">Steam Trader</span> | ||
</nav> | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import { PencilFill, Power } from 'react-bootstrap-icons'; | ||
import {login, logout} from '../../services/accounts' | ||
|
||
export default function Account({ account }:any) { | ||
const name = account.login.username; | ||
return ( | ||
<div className="d-flex my-1 p-1 justify-content-between align-items-center border border-2 border-secondary rounded"> | ||
<div className="user align-items-center"> | ||
<ProfilePhoto account={account} /> | ||
<span className="h3 lead ps-3 align-center text-muted">{name}</span> | ||
</div> | ||
<div> | ||
<Button Icon={Power} color="success" onMouseDown={() => login(name)}/> | ||
<Button Icon={Power} color="danger" onMouseDown={() => logout(name)} paddingLeft="4"/> | ||
<Button Icon={PencilFill} color="info" onMouseDown={() => {}}/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function Button({ Icon, color, paddingLeft, onMouseDown }: any) { | ||
return ( | ||
<button type="button" onMouseDown={onMouseDown} className={`p-2 btn btn-${color} me-${paddingLeft ? paddingLeft : '2'}`}> | ||
<Icon size="20px" /> | ||
</button> | ||
); | ||
} | ||
|
||
function ProfilePhoto({ account }: any) { | ||
return ( | ||
<img | ||
className="shadow border rounded" | ||
src={fetchSteamUserImage()} | ||
alt={`${account.username}'s profile photo`} | ||
height="40px" | ||
width="40px" | ||
/> | ||
); | ||
} | ||
|
||
// TODO: Fetch user profile photo correctly | ||
function fetchSteamUserImage(): string { | ||
// Default steam profile photo | ||
return 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/b5/b5bd56c1aa4644a474a2e4972be27ef9e82e517e_full.jpg'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#accounts { | ||
height: 50vh; | ||
max-height: 50vh; | ||
} | ||
|
||
#accounts > #list { | ||
height: 100%; | ||
max-height: calc(50vh - 60px); | ||
} | ||
|
||
#accounts > #list:nth-child(even) { | ||
background: hsla(0, 0%, 0%, 0.22); | ||
} |
Oops, something went wrong.