Skip to content

Commit 5b576dd

Browse files
committed
Added support for groundbaits
1 parent 0dff2c9 commit 5b576dd

File tree

5 files changed

+49
-7
lines changed

5 files changed

+49
-7
lines changed

src/assets/baits/ground.png

3.66 KB
Loading

src/components/FishInfoBaits/FishInfoBaits.module.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
.FishInfoBaitsCategoryWrapperBaits {
4444
display: grid;
4545
grid-gap: 1.5em;
46-
grid-template-columns: repeat(3, 1fr);
46+
grid-template-columns: repeat(2, 1fr);
4747
}
4848

4949
/**
@@ -53,6 +53,10 @@
5353
order: 3;
5454
}
5555

56+
.FishInfoBaitsKindWrapperGround {
57+
order: 4;
58+
}
59+
5660
.FishInfoBaitsKindWrapperLive {
5761
order: 2;
5862
}
@@ -76,6 +80,7 @@
7680
}
7781

7882
.FishInfoBaitsKindHeaderBottom,
83+
.FishInfoBaitsKindHeaderGround,
7984
.FishInfoBaitsKindHeaderLive,
8085
.FishInfoBaitsKindHeaderNatural {
8186
background-position: right 0.2em center;
@@ -87,6 +92,10 @@
8792
background-image: url("../../assets/baits/bottom.png");
8893
}
8994

95+
.FishInfoBaitsKindHeaderGround {
96+
background-image: url("../../assets/baits/ground.png");
97+
}
98+
9099
.FishInfoBaitsKindHeaderLive {
91100
background-image: url("../../assets/baits/live.png");
92101
}

src/components/FishInfoBaits/FishInfoBaits.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
import clsx from 'clsx';
44
import { useMemo, useState } from 'react';
55
import { Option, Stepper } from 'components';
6-
import { baitKindMap, baitsBottom, baitsLive, baitsNatural, lures } from 'config/baits';
6+
import {
7+
baitKindMap,
8+
baitsBottom,
9+
baitsGround,
10+
baitsLive,
11+
baitsNatural,
12+
lures,
13+
} from 'config/baits';
714
import { getFilteredBaitValues, getFilteredLureValues } from 'lib/filter';
815
import type { BaitFilterType, BaitFilterValue } from 'types/baits';
916
import { FishInfoBaitsBaits } from './FishInfoBaitsBaits';
@@ -42,6 +49,12 @@ export const FishInfoBaits = (props: FishInfoBaitsProps) => {
4249
styles.FishInfoBaitsKindWrapperBottom,
4350
styles.FishInfoBaitsKindHeaderBottom,
4451
],
52+
[
53+
getFilteredBaitValues(baitsGround, filter, data),
54+
baitKindMap.ground.name,
55+
styles.FishInfoBaitsKindWrapperGround,
56+
styles.FishInfoBaitsKindHeaderGround,
57+
],
4558
],
4659
[data, filter],
4760
);
@@ -70,6 +83,7 @@ export const FishInfoBaits = (props: FishInfoBaitsProps) => {
7083
<FishInfoBaitsBaits
7184
caption={category}
7285
headerClassName={headerClassName}
86+
key={category}
7387
values={values}
7488
wrapperClassName={wrapperClassName}
7589
/>

src/config/baits.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
Bait,
44
BaitId,
55
BaitIdBottom,
6+
BaitIdGround,
67
BaitIdLive,
78
BaitIdNatural,
89
BaitKind,
@@ -24,6 +25,16 @@ export const baitsBottom = (
2425
] as Bait<BaitIdBottom>[]
2526
).sort(sortByName);
2627

28+
export const baitsGround = (
29+
[
30+
{ id: 'advantage', name: 'Advantage' },
31+
{ id: 'high-impact', name: 'High Impact' },
32+
{ id: 'lake-mix', name: 'Lake Mix' },
33+
{ id: 'match-blend', name: 'Match Blend' },
34+
{ id: 'pro-performance', name: 'Pro Performance' },
35+
] as Bait<BaitIdGround>[]
36+
).sort(sortByName);
37+
2738
export const baitsLive = (
2839
[
2940
{ id: 'bloodworm', name: 'Bloodworm' },
@@ -41,7 +52,6 @@ export const baitsNatural = (
4152
{ id: 'dough', name: 'Dough' },
4253
{ id: 'eggs', name: 'Eggs' },
4354
{ id: 'hotdog', name: 'Hotdog' },
44-
{ id: 'lake-mix', name: 'Lake Mix' },
4555
{ id: 'liver', name: 'Liver' },
4656
{ id: 'marshmallow', name: 'Marshmallow' },
4757
] as Bait<BaitIdNatural>[]
@@ -51,6 +61,7 @@ export const baitKinds: BaitKind[] = [
5161
{ id: 'natural', name: 'Natural' },
5262
{ id: 'live', name: 'Live' },
5363
{ id: 'bottom', name: 'Bottom' },
64+
{ id: 'ground', name: 'Ground' },
5465
];
5566

5667
export const lures = (
@@ -77,7 +88,7 @@ export const lureMethods: LureMethod[] = [
7788
{ id: 's', name: 'Stop & Go' },
7889
];
7990

80-
export const baitMap = [...baitsBottom, ...baitsLive, ...baitsNatural].reduce(
91+
export const baitMap = [...baitsBottom, ...baitsGround, ...baitsLive, ...baitsNatural].reduce(
8192
(acc, curr) => ({
8293
...acc,
8394
[curr.id]: curr,

src/types/baits.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ export const baitIdsBottom = [
88
'wafters-white',
99
] as const;
1010

11+
export const baitIdsGround = [
12+
'advantage',
13+
'high-impact',
14+
'lake-mix',
15+
'match-blend',
16+
'pro-performance',
17+
] as const;
18+
1119
export const baitIdsLive = ['bloodworm', 'leech', 'minnow', 'redworm'] as const;
1220

1321
export const baitIdsNatural = [
@@ -17,7 +25,6 @@ export const baitIdsNatural = [
1725
'dough',
1826
'eggs',
1927
'hotdog',
20-
'lake-mix',
2128
'liver',
2229
'marshmallow',
2330
] as const;
@@ -43,11 +50,12 @@ export type BaitChanceMap = Record<BaitId, number>;
4350
export type LureChanceMap = Record<LureMethodId, number>;
4451

4552
export type BaitIdBottom = (typeof baitIdsBottom)[number];
53+
export type BaitIdGround = (typeof baitIdsGround)[number];
4654
export type BaitIdLive = (typeof baitIdsLive)[number];
4755
export type BaitIdNatural = (typeof baitIdsNatural)[number];
48-
export type BaitId = BaitIdBottom | BaitIdLive | BaitIdNatural;
56+
export type BaitId = BaitIdBottom | BaitIdGround | BaitIdLive | BaitIdNatural;
4957

50-
export type BaitKindId = 'bottom' | 'live' | 'natural';
58+
export type BaitKindId = 'bottom' | 'ground' | 'live' | 'natural';
5159
export type BaitType = (typeof baitTypes)[number];
5260

5361
export type LureMethodId = 'c' | 'j' | 's' | 't';

0 commit comments

Comments
 (0)