Skip to content

Commit bfd2634

Browse files
committed
chore: username on gamepage
1 parent 890646c commit bfd2634

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/components/Library.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const Library = ({ library, user }: GameList) => {
3434
title={title}
3535
appName={app_name}
3636
isInstalled={isInstalled}
37+
userName={user}
3738
/>
3839
)
3940
}

src/components/UI/GameCard.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,29 @@ interface Card {
66
title: string;
77
appName: string;
88
isInstalled: boolean;
9+
userName: string;
910
}
1011

11-
const GameCard = ({ cover, title, appName, isInstalled }: Card) => {
12+
const GameCard = ({ cover, title, appName, isInstalled, userName }: Card) => {
1213
return (
1314
<Link
1415
className="gameCard "
1516
style={{ backgroundColor: isInstalled ? "#F0183C" : "#2B2B2B" }}
1617
to={{
1718
pathname: "/gameconfig",
18-
state: { appName },
19+
state: { appName, userName },
1920
}}
2021
>
2122
<img alt="cover-art" src={cover} className="gameImg" />
2223
<div className="gameTitle">
2324
<span>{title}</span>
24-
<i
25-
className={`material-icons ${isInstalled ? 'is-success' : 'is-primary'}`}>
26-
{isInstalled ? "check_circle" : "get_app"}</i>
25+
<i
26+
className={`material-icons ${
27+
isInstalled ? "is-success" : "is-primary"
28+
}`}
29+
>
30+
{isInstalled ? "check_circle" : "get_app"}
31+
</i>
2732
</div>
2833
</Link>
2934
);

src/components/UI/GameConfig.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function GameConfig({ location }: Card) {
1010
const [gameInfo, setGameInfo] = React.useState({} as any);
1111
const [playing, setPlaying] = React.useState(false);
1212
const [installing, setInstalling] = React.useState(false);
13-
const { appName } = location.state || {};
13+
const { appName, userName } = location.state || {};
1414

1515
React.useEffect(() => {
1616
const updateConfig = async () => {
@@ -48,7 +48,7 @@ export default function GameConfig({ location }: Card) {
4848
</div>
4949
<div className="rightCluster">
5050
{/* import user into div below */}
51-
<div className="username">username</div>
51+
<div className="username">{userName}</div>
5252
<div className="settings"></div>
5353
</div>
5454
</div>

0 commit comments

Comments
 (0)