Skip to content

Commit ab217bb

Browse files
committed
Update countries
1 parent ffcfd28 commit ab217bb

File tree

2 files changed

+44
-47
lines changed

2 files changed

+44
-47
lines changed

frontend/src/lib/SideBarRankings.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
let localHomeStoreSelect = $state($homeStoreSelection);
1515
let localHomeCategorySelect = $state($homeCategorySelection);
1616
17+
let country = $state(page.params.country);
18+
1719
let classesActive = $derived((href: string) =>
1820
page.url.pathname.startsWith(href) ? buttonSelectedClass : buttonDeselectedClass
1921
);
@@ -79,9 +81,9 @@
7981
<a
8082
href={`/rankings/store/${values.store_id}${
8183
values.store_id == 1
82-
? '/collection/1/category/1/US'
84+
? `/collection/1/category/1/${country}`
8385
: values.store_id == 2
84-
? '/collection/4/category/120/US'
86+
? `/collection/4/category/120/${country}`
8587
: '' // default value or path for other store_ids if needed
8688
}`}
8789
class={classesActive(`/rankings/store/${values.store_id}/`)}
@@ -104,7 +106,7 @@
104106
{#each Object.entries(collectionIDLookup[store]) as [id, values]}
105107
<li>
106108
<a
107-
href={`/rankings/store/${store}/collection/${values.collection_id}/category/${category}`}
109+
href={`/rankings/store/${store}/collection/${values.collection_id}/category/${category}/${country}`}
108110
class={classesActive(`/rankings/store/${store}/collection/${values.collection_id}/`)}
109111
>{values.collection_name}</a
110112
>
@@ -124,7 +126,7 @@
124126
{#each Object.entries(categoryIDLookup[collection]) as [id, values]}
125127
<li>
126128
<a
127-
href={`/rankings/store/${store}/collection/${collection}/category/${values.category_id}`}
129+
href={`/rankings/store/${store}/collection/${collection}/category/${values.category_id}/${country}`}
128130
class={classesActive(
129131
`/rankings/store/${store}/collection/${collection}/category/${values.category_id}`
130132
)}>{values.category_name}</a

frontend/src/stores.ts

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -556,47 +556,42 @@ export const plotColors = [
556556
];
557557

558558
export const countries = {
559-
US: 'United States'
559+
US: 'United States',
560+
CN: 'China',
561+
DE: 'Germany',
562+
IN: 'India',
563+
CA: 'Canada',
564+
GB: 'United Kingdom',
565+
AU: 'Australia',
566+
FR: 'France',
567+
ES: 'Spain',
568+
IT: 'Italy',
569+
KR: 'South Korea',
570+
JP: 'Japan',
571+
RU: 'Russia',
572+
MX: 'Mexico',
573+
NL: 'Netherlands',
574+
PL: 'Poland',
575+
PT: 'Portugal',
576+
RO: 'Romania',
577+
SA: 'Saudi Arabia',
578+
TR: 'Turkey',
579+
UA: 'Ukraine',
580+
ZA: 'South Africa',
581+
BR: 'Brazil',
582+
BE: 'Belgium',
583+
CH: 'Switzerland',
584+
CZ: 'Czech Republic',
585+
DK: 'Denmark',
586+
GR: 'Greece',
587+
HU: 'Hungary',
588+
ID: 'Indonesia',
589+
IE: 'Ireland',
590+
IL: 'Israel',
591+
MY: 'Malaysia',
592+
NO: 'Norway',
593+
NZ: 'New Zealand',
594+
PH: 'Philippines',
595+
SE: 'Sweden',
596+
SG: 'Singapore'
560597
};
561-
562-
// Future list, wait for a week or so
563-
// export const countries = {
564-
// US: 'United States',
565-
// CN: 'China',
566-
// DE: 'Germany',
567-
// IN: 'India',
568-
// CA: 'Canada',
569-
// GB: 'United Kingdom',
570-
// AU: 'Australia',
571-
// FR: 'France',
572-
// ES: 'Spain',
573-
// IT: 'Italy',
574-
// KR: 'South Korea',
575-
// JP: 'Japan',
576-
// RU: 'Russia',
577-
// MX: 'Mexico',
578-
// NL: 'Netherlands',
579-
// PL: 'Poland',
580-
// PT: 'Portugal',
581-
// RO: 'Romania',
582-
// SA: 'Saudi Arabia',
583-
// TR: 'Turkey',
584-
// UA: 'Ukraine',
585-
// ZA: 'South Africa',
586-
// BR: 'Brazil',
587-
// BE: 'Belgium',
588-
// CH: 'Switzerland',
589-
// CZ: 'Czech Republic',
590-
// DK: 'Denmark',
591-
// GR: 'Greece',
592-
// HU: 'Hungary',
593-
// ID: 'Indonesia',
594-
// IE: 'Ireland',
595-
// IL: 'Israel',
596-
// MY: 'Malaysia',
597-
// NO: 'Norway',
598-
// NZ: 'New Zealand',
599-
// PH: 'Philippines',
600-
// SE: 'Sweden',
601-
// SG: 'Singapore',
602-
// }

0 commit comments

Comments
 (0)