Skip to content

Commit e44a3a7

Browse files
committed
Cleaned up unused refs.
1 parent 8c16d10 commit e44a3a7

File tree

7 files changed

+118
-136
lines changed

7 files changed

+118
-136
lines changed

frontend/src/components/AlbumGrid.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ interface AlbumProps {
1010
onClickAlbum: (album: IReleases) => void
1111
}
1212

13-
const AlbumGridEntry: React.FC<AlbumProps> = ({ album, index, staticImage = undefined, onClickAlbum }) => {
14-
return (
15-
<IonCol size="6" sizeMd="4" sizeLg="3" key={index}>
16-
<div className="album-art-container" onClick={() => onClickAlbum(album)}>
17-
<img src={staticImage ? staticImage : album.basic_information.thumb} className="album-art" alt="" />
18-
</div>
19-
<strong style={{ margin: 0 }}>{album.basic_information.title}</strong>
20-
<br />
21-
<IonText>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</IonText>
22-
</IonCol>
23-
)
24-
}
13+
const AlbumGridEntry: React.FC<AlbumProps> = ({ album, index, staticImage = undefined, onClickAlbum }) => (
14+
<IonCol size="6" sizeMd="4" sizeLg="3" key={index}>
15+
<div className="album-art-container" onClick={() => onClickAlbum(album)}>
16+
<img src={staticImage ? staticImage : album.basic_information.thumb} className="album-art" alt="" />
17+
</div>
18+
<strong style={{ margin: 0 }}>{album.basic_information.title}</strong>
19+
<br />
20+
<IonText>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</IonText>
21+
</IonCol>
22+
)
2523

2624
interface CollectionProps {
2725
data: IReleases[]

frontend/src/components/AlbumList.tsx

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,32 @@ interface Props {
1111
onClickAlbum: (album: IReleases) => void
1212
}
1313

14-
const AlbumList: React.FC<Props> = ({ data, username = "", title = undefined, type, onClickAlbum }) => {
15-
return (
16-
<IonList lines="full">
17-
{title && (
18-
<IonListHeader>
19-
<IonLabel>{title}</IonLabel>
20-
</IonListHeader>
21-
)}
22-
{data.map((album, index) => {
23-
return (
24-
<IonItem key={index} className="album-list-item" onClick={() => onClickAlbum(album)}>
25-
<IonAvatar aria-hidden="true" slot="start">
26-
<img alt="" src={album.image_base64 ? album.image_base64 : album.basic_information.thumb} />
27-
</IonAvatar>
28-
<IonLabel>
29-
<strong>{album.basic_information.title}</strong>
30-
<br />
31-
<IonText>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</IonText>
32-
</IonLabel>
33-
<IonChip slot="end">
34-
<IonIcon icon={disc} />
35-
<IonLabel>{album.basic_information.formats[0].name}</IonLabel>
36-
</IonChip>
37-
</IonItem>
38-
)
39-
})}
40-
</IonList>
41-
)
42-
}
14+
const AlbumList: React.FC<Props> = ({ data, username = "", title = undefined, type, onClickAlbum }) => (
15+
<IonList lines="full">
16+
{title && (
17+
<IonListHeader>
18+
<IonLabel>{title}</IonLabel>
19+
</IonListHeader>
20+
)}
21+
{data.map((album, index) => {
22+
return (
23+
<IonItem key={index} className="album-list-item" onClick={() => onClickAlbum(album)}>
24+
<IonAvatar aria-hidden="true" slot="start">
25+
<img alt="" src={album.image_base64 ? album.image_base64 : album.basic_information.thumb} />
26+
</IonAvatar>
27+
<IonLabel>
28+
<strong>{album.basic_information.title}</strong>
29+
<br />
30+
<IonText>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</IonText>
31+
</IonLabel>
32+
<IonChip slot="end">
33+
<IonIcon icon={disc} />
34+
<IonLabel>{album.basic_information.formats[0].name}</IonLabel>
35+
</IonChip>
36+
</IonItem>
37+
)
38+
})}
39+
</IonList>
40+
)
4341

4442
export default AlbumList

frontend/src/components/Fullpage.tsx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@ import "./Fullpage.css"
44
const FullpageLoading: React.FC<{
55
loadingProgress?: number
66
loadingComplete?: number
7-
}> = ({ loadingProgress = undefined, loadingComplete = undefined }) => {
8-
return (
9-
<div className="fullpage-container">
10-
<IonSpinner></IonSpinner>
11-
{loadingProgress && loadingComplete && (
12-
<IonProgressBar value={loadingProgress / loadingComplete} color="light" />
13-
)}
14-
</div>
15-
)
16-
}
7+
}> = ({ loadingProgress = undefined, loadingComplete = undefined }) => (
8+
<div className="fullpage-container">
9+
<IonSpinner></IonSpinner>
10+
{loadingProgress && loadingComplete && (
11+
<IonProgressBar value={loadingProgress / loadingComplete} color="light" />
12+
)}
13+
</div>
14+
)
1715

18-
const FullpageInfo: React.FC<{ text: string }> = ({ text }) => {
19-
return (
20-
<div className="fullpage-container">
21-
<p>{text}</p>
22-
</div>
23-
)
24-
}
16+
const FullpageInfo: React.FC<{ text: string }> = ({ text }) => (
17+
<div className="fullpage-container">
18+
<p>{text}</p>
19+
</div>
20+
)
2521

2622
export { FullpageLoading, FullpageInfo }

frontend/src/components/StatDisplay.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@ interface Props {
66
items: IStatDisplay[]
77
}
88

9-
const StatDisplay: React.FC<Props> = ({ items }) => {
10-
return (
11-
<IonGrid>
12-
<IonRow>
13-
{items.map((stat, index) => (
14-
<IonCol key={index} className="statdisp-text">
15-
<IonIcon icon={stat.icon} style={{ fontSize: "48px", color: "#3880ff" }} />
16-
<IonText style={{ textAlign: "center" }}>
17-
<h2 style={{ margin: 4 }}>{stat.value ?? "N/A"}</h2>
18-
<p style={{ margin: 0 }}>{stat.label}</p>
19-
</IonText>
20-
</IonCol>
21-
))}
22-
</IonRow>
23-
</IonGrid>
24-
)
25-
}
9+
const StatDisplay: React.FC<Props> = ({ items }) => (
10+
<IonGrid>
11+
<IonRow>
12+
{items.map((stat, index) => (
13+
<IonCol key={index} className="statdisp-text">
14+
<IonIcon icon={stat.icon} style={{ fontSize: "48px", color: "#3880ff" }} />
15+
<IonText style={{ textAlign: "center" }}>
16+
<h2 style={{ margin: 4 }}>{stat.value ?? "N/A"}</h2>
17+
<p style={{ margin: 0 }}>{stat.label}</p>
18+
</IonText>
19+
</IonCol>
20+
))}
21+
</IonRow>
22+
</IonGrid>
23+
)
2624

2725
export default StatDisplay

frontend/src/modal/ViewAlbumDetails.tsx

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,62 @@ import { IReleases } from "../api"
1414

1515
interface DisplayProps {
1616
album: IReleases
17-
username?: string
18-
type: "collection" | "want"
1917
open: boolean
2018
onClose: () => void
2119
}
2220

23-
const ViewAlbumDetails: React.FC<DisplayProps> = ({ album, username = "", type, open, onClose }) => {
24-
return (
25-
<IonModal isOpen={open}>
26-
<IonHeader>
27-
<IonToolbar>
28-
<IonButtons slot="start">
29-
<IonButton onClick={() => onClose()}>Close</IonButton>
30-
</IonButtons>
31-
<IonTitle>{album.basic_information.title}</IonTitle>
32-
</IonToolbar>
33-
</IonHeader>
34-
<IonContent className="ion-padding">
35-
<div style={{ display: "flex", justifyContent: "center" }}>
36-
<img src={album.image_base64 ? album.image_base64 : album.basic_information.thumb} alt="" />
37-
</div>
38-
<IonList inset>
39-
<IonItem>
40-
<IonLabel>
41-
<h2>Title</h2>
42-
<p>{album.basic_information.title}</p>
43-
</IonLabel>
44-
</IonItem>
45-
<IonItem>
46-
<IonLabel>
47-
<h2>Artist</h2>
48-
<p>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</p>
49-
</IonLabel>
50-
</IonItem>
51-
<IonItem>
52-
<IonLabel>
53-
<h2>Genre</h2>
54-
<p>{album.basic_information.genres.map((genre) => genre).join(", ")}</p>
55-
</IonLabel>
56-
</IonItem>
57-
<IonItem>
58-
<IonLabel>
59-
<h2>Label</h2>
60-
<p>{album.basic_information.labels.map((label) => label.name).join(", ")}</p>
61-
</IonLabel>
62-
</IonItem>
63-
<IonItem>
64-
<IonLabel>
65-
<h2>Owned Formats</h2>
66-
<p>
67-
{album.basic_information.formats
68-
.map((format) => `${format.name} (${format.qty})`)
69-
.join(", ")}
70-
</p>
71-
</IonLabel>
72-
</IonItem>
73-
</IonList>
74-
</IonContent>
75-
</IonModal>
76-
)
77-
}
21+
const ViewAlbumDetails: React.FC<DisplayProps> = ({ album, open, onClose }) => (
22+
<IonModal isOpen={open}>
23+
<IonHeader>
24+
<IonToolbar>
25+
<IonButtons slot="start">
26+
<IonButton onClick={() => onClose()}>Close</IonButton>
27+
</IonButtons>
28+
<IonTitle>{album.basic_information.title}</IonTitle>
29+
</IonToolbar>
30+
</IonHeader>
31+
<IonContent className="ion-padding">
32+
<div style={{ display: "flex", justifyContent: "center" }}>
33+
<img src={album.image_base64 ? album.image_base64 : album.basic_information.thumb} alt="" />
34+
</div>
35+
<IonList inset>
36+
<IonItem>
37+
<IonLabel>
38+
<h2>Title</h2>
39+
<p>{album.basic_information.title}</p>
40+
</IonLabel>
41+
</IonItem>
42+
<IonItem>
43+
<IonLabel>
44+
<h2>Artist</h2>
45+
<p>{album.basic_information.artists.map((artist) => artist.name).join(", ")}</p>
46+
</IonLabel>
47+
</IonItem>
48+
<IonItem>
49+
<IonLabel>
50+
<h2>Genre</h2>
51+
<p>{album.basic_information.genres.map((genre) => genre).join(", ")}</p>
52+
</IonLabel>
53+
</IonItem>
54+
<IonItem>
55+
<IonLabel>
56+
<h2>Label</h2>
57+
<p>{album.basic_information.labels.map((label) => label.name).join(", ")}</p>
58+
</IonLabel>
59+
</IonItem>
60+
<IonItem>
61+
<IonLabel>
62+
<h2>Owned Formats</h2>
63+
<p>
64+
{album.basic_information.formats
65+
.map((format) => `${format.name} (${format.qty})`)
66+
.join(", ")}
67+
</p>
68+
</IonLabel>
69+
</IonItem>
70+
</IonList>
71+
</IonContent>
72+
</IonModal>
73+
)
7874

7975
export default ViewAlbumDetails

frontend/src/pages/Collection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ const CollectionPage: React.FC = () => {
207207
{modalInfo && (
208208
<ViewAlbumDetails
209209
album={modalInfo}
210-
username={username}
211-
type={viewState}
212210
open={typeof modalInfo !== "undefined"}
213211
onClose={() => setModalInfo(undefined)}
214212
/>

frontend/src/pages/Search.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ const SearchPage: React.FC = () => {
126126
{modalInfo && (
127127
<ViewAlbumDetails
128128
album={modalInfo.data}
129-
username={username}
130-
type={modalInfo.type}
131129
open={typeof modalInfo !== "undefined"}
132130
onClose={() => setModalInfo(undefined)}
133131
/>

0 commit comments

Comments
 (0)