mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 23:30:36 +00:00
Some flags are offensive, so don't allow them to be selected by users. I think it's fine for nations continue to use the flags. - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced regression is found: evan
This commit is contained in:
committed by
Scott Anderson
parent
3863f52bb8
commit
56f748b16f
@@ -34,9 +34,7 @@ export class FlagInputModal extends LitElement {
|
||||
class="flex flex-wrap justify-evenly gap-[1rem] overflow-y-auto overflow-x-hidden h-[90%]"
|
||||
>
|
||||
${this.isModalOpen ? Countries.filter(
|
||||
(country) =>
|
||||
country.name.toLowerCase().includes(this.search.toLowerCase()) ||
|
||||
country.code.toLowerCase().includes(this.search.toLowerCase()),
|
||||
(country) => !country.restricted && this.includedInSearch(country),
|
||||
).map(
|
||||
(country) => html`
|
||||
<button
|
||||
@@ -69,6 +67,13 @@ export class FlagInputModal extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private includedInSearch(country: { name: string; code: string }): boolean {
|
||||
return (
|
||||
country.name.toLowerCase().includes(this.search.toLowerCase()) ||
|
||||
country.code.toLowerCase().includes(this.search.toLowerCase())
|
||||
);
|
||||
}
|
||||
|
||||
private handleSearch(event: Event) {
|
||||
this.search = (event.target as HTMLInputElement).value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user