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

Swap to new flag files (which are stored as GB.png) #899

Merged
merged 1 commit into from
May 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/components/views/login/CountryDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import React from 'react';
import sdk from '../../../index';

import { COUNTRIES } from '../../../phonenumber';
import { charactersToImageNode } from '../../../HtmlUtils';

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

this.state = {
searchQuery: '',
}
};
}

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

_flagImgForIso2(iso2) {
// Unicode Regional Indicator Symbol letter 'A'
const RIS_A = 0x1F1E6;
const ASCII_A = 65;
return charactersToImageNode(iso2, true,
RIS_A + (iso2.charCodeAt(0) - ASCII_A),
RIS_A + (iso2.charCodeAt(1) - ASCII_A),
);
return <img src={`flags/${iso2}.png`}/>;
}

render() {
Expand Down Expand Up @@ -115,7 +108,7 @@ export default class CountryDropdown extends React.Component {
value={value} searchEnabled={true}
>
{options}
</Dropdown>
</Dropdown>;
}
}

Expand Down