Skip to content

Commit 69ce017

Browse files
committed
feat: tappable from lure in popup
1 parent c74c607 commit 69ce017

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

packages/types/lib/scanner.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export interface Tappable {
282282
lat: number
283283
lon: number
284284
type: string
285+
fort_id: string | null
285286
item_id: number
286287
count: number | null
287288
expire_timestamp: number | null

server/src/graphql/typeDefs/scanner.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ type Tappable {
208208
lat: Float
209209
lon: Float
210210
type: String
211+
fort_id: String
211212
item_id: Int
212213
count: Int
213214
expire_timestamp: Int

server/src/models/Tappable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Tappable extends Model {
3636
'lat',
3737
'lon',
3838
'type',
39+
'fort_id',
3940
'item_id',
4041
'count',
4142
'expire_timestamp',
@@ -108,6 +109,7 @@ class Tappable extends Model {
108109
'lat',
109110
'lon',
110111
'type',
112+
'fort_id',
111113
'item_id',
112114
'count',
113115
'expire_timestamp',

src/features/tappable/TappablePopup.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export function TappablePopup({ tappable, rewardIcon }) {
8080
displaySettings.popup.rewardAsPrimary && hasRewardIcon
8181
const hasTappableIcon = !!tappableIcon && !useRewardAsPrimary
8282
const itemDisplayName = count > 1 ? `${itemName} x${count}` : itemName
83+
const isLure = React.useMemo(
84+
() => Boolean(tappable.fort_id),
85+
[tappable.fort_id],
86+
)
8387

8488
const [menuAnchorEl, setMenuAnchorEl] = React.useState(null)
8589

@@ -263,6 +267,22 @@ export function TappablePopup({ tappable, rewardIcon }) {
263267
</Grid>
264268
</Grid>
265269
)}
270+
{isLure && (
271+
<Grid xs={12} textAlign="center">
272+
<Typography
273+
variant="caption"
274+
component="div"
275+
sx={{
276+
display: 'flex',
277+
alignItems: 'center',
278+
justifyContent: 'center',
279+
gap: 0.75,
280+
}}
281+
>
282+
{t('seen_lure_wild')}
283+
</Typography>
284+
</Grid>
285+
)}
266286
{hasExpireTime && (
267287
<Grid
268288
xs={12}

src/services/queries/tappable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const GET_ALL_TAPPABLES = gql`
2020
lat
2121
lon
2222
type
23+
fort_id
2324
item_id
2425
count
2526
expire_timestamp
@@ -34,6 +35,7 @@ export const GET_TAPPABLE_BY_ID = gql`
3435
tappableById(id: $id) {
3536
id
3637
type
38+
fort_id
3739
item_id
3840
count
3941
expire_timestamp

0 commit comments

Comments
 (0)