Skip to content

Commit

Permalink
refactor: Update image loading in Stats component
Browse files Browse the repository at this point in the history
  • Loading branch information
soy0ka committed Jun 15, 2024
1 parent 7980f76 commit f1d5996
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/routes/dex/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const MoveSection: React.FC = () => {
<Avatar
variant="square"
src={apiUrl(`/v1/sprites/types/${x.type}.svg`)}
slotProps={{ img: { crossOrigin: 'anonymous' } }}
imgProps={{ crossOrigin: 'anonymous' }}
alt={x.type || '?'}
style={{ width: 40, height: 40, marginTop: 8 }}
/>
Expand Down Expand Up @@ -125,7 +125,7 @@ const TeamMatesSection: React.FC = () => {
<ListItemAvatar>
<Avatar
alt={'?'}
slotProps={{ img: { crossOrigin: 'anonymous' } }}
imgProps={{ crossOrigin: 'anonymous' }}
src={
x.formId === 0
? apiUrl(`/v1/sprites/pokemon/${x.dexId}`)
Expand All @@ -136,7 +136,7 @@ const TeamMatesSection: React.FC = () => {
<Avatar
key={i}
alt={x}
slotProps={{ img: { crossOrigin: 'anonymous' } }}
imgProps={{ crossOrigin: 'anonymous' }}
src={apiUrl(`/v1/sprites/types/${x}.svg`)}
sx={{
position: 'absolute',
Expand Down Expand Up @@ -173,7 +173,7 @@ const TerastalizeSection: React.FC = () => {
<ListItemAvatar>
<Avatar
alt={x.type}
slotProps={{ img: { crossOrigin: 'anonymous' } }}
imgProps={{ crossOrigin: 'anonymous' }}
src={apiUrl(
`/v1/sprites/teraTypes/${
x.type[0].toUpperCase() + x.type.slice(1)
Expand Down Expand Up @@ -203,7 +203,7 @@ const ItemSection: React.FC = () => {
<Avatar
variant="square"
src={apiUrl(`/v1/sprites/items/${x.name}`)}
slotProps={{ img: { crossOrigin: 'anonymous' } }}
imgProps={{ crossOrigin: 'anonymous' }}
alt={x.name || '?'}
style={{ width: 40, height: 40, marginTop: 6 }}
/>
Expand Down

0 comments on commit f1d5996

Please sign in to comment.