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

Commit c991b52

Browse files
author
Luke Barnard
committed
Swap to new flag files (which are stored as GB.png)
Requires element-hq/element-web#3953
1 parent 8ce6da1 commit c991b52

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) {
@@ -41,7 +40,7 @@ export default class CountryDropdown extends React.Component {
4140

4241
this.state = {
4342
searchQuery: '',
44-
}
43+
};
4544
}
4645

4746
componentWillMount() {
@@ -64,13 +63,7 @@ export default class CountryDropdown extends React.Component {
6463
}
6564

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

7669
render() {
@@ -115,7 +108,7 @@ export default class CountryDropdown extends React.Component {
115108
value={value} searchEnabled={true}
116109
>
117110
{options}
118-
</Dropdown>
111+
</Dropdown>;
119112
}
120113
}
121114

0 commit comments

Comments
 (0)