Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2ebd9b6

Browse files
authored
Merge pull request #899 from matrix-org/luke/improve-country-dd-3
Swap to new flag files (which are stored as GB.png)
2 parents e38437e + c991b52 commit 2ebd9b6

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/components/views/login/CountryDropdown.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import React from 'react';
1919
import sdk from '../../../index';
2020

2121
import { COUNTRIES } from '../../../phonenumber';
22-
import { charactersToImageNode } from '../../../HtmlUtils';
2322

2423
const COUNTRIES_BY_ISO2 = new Object(null);
2524
for (const c of COUNTRIES) {
@@ -42,7 +41,7 @@ export default class CountryDropdown extends React.Component {
4241

4342
this.state = {
4443
searchQuery: '',
45-
}
44+
};
4645
}
4746

4847
componentWillMount() {
@@ -65,13 +64,7 @@ export default class CountryDropdown extends React.Component {
6564
}
6665

6766
_flagImgForIso2(iso2) {
68-
// Unicode Regional Indicator Symbol letter 'A'
69-
const RIS_A = 0x1F1E6;
70-
const ASCII_A = 65;
71-
return charactersToImageNode(iso2, true,
72-
RIS_A + (iso2.charCodeAt(0) - ASCII_A),
73-
RIS_A + (iso2.charCodeAt(1) - ASCII_A),
74-
);
67+
return <img src={`flags/${iso2}.png`}/>;
7568
}
7669

7770
_getShortOption(iso2) {
@@ -128,7 +121,7 @@ export default class CountryDropdown extends React.Component {
128121
value={value} searchEnabled={true}
129122
>
130123
{options}
131-
</Dropdown>
124+
</Dropdown>;
132125
}
133126
}
134127

0 commit comments

Comments
 (0)