-
Notifications
You must be signed in to change notification settings - Fork 0
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
334ad21
commit 2781e0c
Showing
5 changed files
with
79 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.container { | ||
width: 100%; | ||
height: 60px; | ||
align-items: center; | ||
} | ||
|
||
.content { | ||
flex-grow: 1; | ||
flex-direction: column; | ||
margin-left: var(--mantine-spacing-md); | ||
} | ||
|
||
.thumbnail { | ||
height: 100%; | ||
width: auto; | ||
} | ||
|
||
.title { | ||
margin-top: 4px; | ||
font-size: var(--mantine-font-size-sm); | ||
} | ||
|
||
.add { | ||
height: 100%; | ||
width: auto; | ||
padding: 0px 8px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 4px; | ||
border-radius: var(--mantine-radius-md); | ||
} |
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,35 @@ | ||
import { ActionIcon, Flex, Text } from "@mantine/core"; | ||
import { type TrophyTitle } from "psn-api"; | ||
import { type FC } from "react"; | ||
import classes from "./LibraryItem.module.css"; | ||
import GameThumbnail from "../GameThumbnail/GameThumbnail"; | ||
import PlatformBadge from "../PlatformBadge/PlatformBadge"; | ||
import { IconPlus } from "@tabler/icons-react"; | ||
|
||
interface Props { | ||
item: TrophyTitle; | ||
onClick?: () => void; | ||
} | ||
|
||
const LibraryItem: FC<Props> = (props) => { | ||
const { item, onClick } = props; | ||
return ( | ||
<Flex className={classes.container}> | ||
<GameThumbnail | ||
className={classes.thumbnail} | ||
url={item.trophyTitleIconUrl} | ||
overlay={item.trophyTitlePlatform === "PS5"} | ||
/> | ||
<Flex className={classes.content}> | ||
<PlatformBadge platform={item.trophyTitlePlatform} /> | ||
<Text className={classes.title}>{item.trophyTitleName}</Text> | ||
</Flex> | ||
<ActionIcon className={classes.add} variant="filled" onClick={onClick}> | ||
<IconPlus size={18} /> | ||
<Text size="xs">Add</Text> | ||
</ActionIcon> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default LibraryItem; |
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 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 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