Skip to content

Commit 6ac8ea4

Browse files
committed
fixed flags for windows and no results img #306
1 parent 11ad484 commit 6ac8ea4

File tree

5 files changed

+56
-18
lines changed

5 files changed

+56
-18
lines changed

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"clsx": "^2.1.1",
2626
"docusaurus-plugin-zooming": "^1.0.0",
2727
"docusaurus-theme-search-typesense": "^0.23.0",
28+
"flag-icons": "^7.5.0",
2829
"lucide-react": "^0.525.0",
2930
"prism-react-renderer": "^2.4.1",
3031
"react": "^18.3.1",

src/components/PortfolioNavigator/index.tsx

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useMemo, useState, useRef, useEffect, KeyboardEvent } from "react";
22
import styles from "./styles.module.css";
3+
import 'flag-icons/css/flag-icons.min.css';
4+
import useBaseUrl from '@docusaurus/useBaseUrl';
35

46
export type OtcCategory =
57
| "Application"
@@ -132,6 +134,7 @@ export default function OtcServicesColumns() {
132134
const ALL_CATS = Array.from(new Set(SERVICES.map(s => s.category))).sort();
133135
const [categoryFilter, setCategoryFilter] = useState<string>("all");
134136
const OTC_CATEGORY_OPTIONS: string[] = ["all", ...ALL_CATS];
137+
const noDataImg = useBaseUrl('/img/undraw_no-data_ig65.svg');
135138

136139
const toggleChip = (c: Chip) =>
137140
setChips((prev) => {
@@ -245,6 +248,41 @@ export default function OtcServicesColumns() {
245248
}
246249
}
247250

251+
const renderRegionChip = (region: Region) => {
252+
if (region === "global") return null;
253+
254+
const cls =
255+
region === "eu-de" ? "fi fi-de" :
256+
region === "eu-nl" ? "fi fi-nl" :
257+
region === "eu-ch" ? "fi fi-ch fis" : "";
258+
259+
return (
260+
<span
261+
className={`${styles.flag} ${cls}`}
262+
key={region}
263+
title={region}
264+
></span>
265+
);
266+
};
267+
268+
const renderRegionFooter = (region: Region) => {
269+
if (region === "global") {
270+
return <span key={region}>GLOBAL</span>;
271+
}
272+
273+
const cls =
274+
region === "eu-de" ? "fi fi-de" :
275+
region === "eu-nl" ? "fi fi-nl" :
276+
region === "eu-ch" ? "fi fi-ch fis" : "";
277+
278+
return (
279+
<span
280+
className={`${styles.flag} ${cls}`}
281+
key={region}
282+
></span>
283+
);
284+
};
285+
248286
return (
249287
<div className={styles.otcWrap}>
250288
<div className={styles.otcMax}>
@@ -305,13 +343,8 @@ export default function OtcServicesColumns() {
305343
selected={isRegionActive(r) ? true : undefined}
306344
title={r.toUpperCase()}
307345
>
308-
{r === "global"
309-
? "GLOBAL"
310-
: r === "eu-de"
311-
? "🇩🇪 EU-DE"
312-
: r === "eu-nl"
313-
? "🇳🇱 EU-NL"
314-
: "🇨🇭 EU-CH"}
346+
{renderRegionChip(r)}
347+
{` ${r.toUpperCase()}`}
315348
</scale-chip>
316349
))}
317350
</div>
@@ -323,7 +356,7 @@ export default function OtcServicesColumns() {
323356
{filtered.length === 0 ? (
324357
<div className={styles.emptyFill}>
325358
<div className={styles.emptyState}>
326-
<img src="/img/undraw_no-data_ig65.svg" alt="No results" />
359+
<img src={noDataImg} />
327360
<h3>No results match your filters.</h3>
328361
</div>
329362
</div>
@@ -347,15 +380,7 @@ export default function OtcServicesColumns() {
347380
<div className={styles.flags}>
348381
{s.regions.map((r) => (
349382
<span className={styles.flag} key={r}>
350-
{r === "global"
351-
? "🌐"
352-
: r === "eu-de"
353-
? "🇩🇪"
354-
: r === "eu-nl"
355-
? "🇳🇱"
356-
: r === "eu-ch"
357-
? "🇨🇭"
358-
: r}
383+
{renderRegionFooter(r)}
359384
</span>
360385
))}
361386
</div>

src/components/PortfolioNavigator/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ html[data-theme='dark'] .tileBottom{display:flex;align-items:center;justify-cont
206206

207207
.sleeve{
208208
margin-left: auto; /* stick to right */
209-
width: min(420px, 96vw);
209+
width: min(420px, 90vw);
210210
height: 100%;
211211
background: #fff;
212212
border-left: 1px solid var(--line);

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5496,6 +5496,11 @@ find-up@^6.3.0:
54965496
locate-path "^7.1.0"
54975497
path-exists "^5.0.0"
54985498

5499+
flag-icons@^7.5.0:
5500+
version "7.5.0"
5501+
resolved "https://registry.npmjs.org/flag-icons/-/flag-icons-7.5.0.tgz"
5502+
integrity sha512-kd+MNXviFIg5hijH766tt+3x76ele1AXlo4zDdCxIvqWZhKt4T83bOtxUOOMlTx/EcFdUMH5yvQgYlFh1EqqFg==
5503+
54995504
flat-cache@^4.0.0:
55005505
version "4.0.1"
55015506
resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz"

0 commit comments

Comments
 (0)