Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ondřej Bazala
PV247
Commits
54c4839e
Commit
54c4839e
authored
Nov 28, 2021
by
Benjamín Balun
Browse files
refactor: key prop removed from ItemCard component
parent
c3eaa824
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pages/Store/ItemCard.tsx
View file @
54c4839e
...
...
@@ -7,14 +7,12 @@ import { Pokeball } from '../../data/pokeballs';
type
Item
=
Food
|
Pokeball
;
const
ItemCard
=
({
item
,
key
,
callback
}:
{
item
:
Item
;
key
:
number
;
callback
:
(
item
:
Item
)
=>
Promise
<
void
>
;
})
=>
(
<
Col
key
=
{
key
}
style
=
{
{
width
:
'
200px
'
}
}
>
<
Col
style
=
{
{
width
:
'
200px
'
}
}
>
<
Card
title
=
{
item
.
name
}
hoverable
...
...
src/pages/Store/Store.tsx
View file @
54c4839e
...
...
@@ -70,7 +70,7 @@ const Store = () => {
<>
<
Funds
funds
=
{
userData
?.
actualScore
}
/>
<
Row
gutter
=
{
[
10
,
10
]
}
>
<
Row
gutter
=
{
[
10
,
10
]
}
align
=
"middle"
>
{
[...
food
,
...
pokeballs
].
map
((
item
,
index
)
=>
(
<
ItemCard
item
=
{
item
}
key
=
{
index
}
callback
=
{
buyItem
}
/>
))
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment