Fun with flags (in React Native)!
import Flag from 'react-native-round-flags';
const JustAFlag = () =>
<Flag code="DE"/>
### Props
The ISO code of a flag, for example "DE", "FR" or "GB"
Allows additional styles to be passed through.
MIT
License: MIT License
Fun with flags (in React Native)!
import Flag from 'react-native-round-flags';
const JustAFlag = () =>
<Flag code="DE"/>
### Props
The ISO code of a flag, for example "DE", "FR" or "GB"
Allows additional styles to be passed through.
MIT
I'm trying to put border around selected flag. How can I achieve the same circular border on all devices.
Currently I'm doing this:
<ListView
horizontal={true}
dataSource={this.state.siteLangdataSource}
renderRow={
(item) =>
<TouchableOpacity button onPress={() => this.setLang(item.LanguageId)} key = {item.LanguageName}>
<Flag style={item.isSelect == true ? styles.flagRoundedItem: styles.flagItem} code = {item.LanguageCode == 'EN'? 'GB' : item.LanguageCode} />
</TouchableOpacity>
}
/>
Style.js
HEIGHT & WIDTH are screen h&w.
flagItem:
{
height: HEIGHT/16,
width: WIDTH/10,
margin:WIDTH/20,
},
flagRoundedItem:
{
borderRadius: WIDTH/10,
height: HEIGHT/16,
width: WIDTH/10,
borderWidth: 5,
borderColor: secondarycolor,
margin:WIDTH/20,
},
The radius is not correct for few devices:
On some devices it looks absolutely fine:
would need typescript support for this package
@types file with type declarations
The following flags are missing:
Some of them do not have separate flags. Bouvet Island has the Norwegian flag. However, others like Kosovo do have a separate flag.
I am trying this with my project that uses create-react-app
and node v13.11.0. This is what I get after installing this flag library and running my project -
Failed to compile.
./node_modules/react-native-round-flags/index.js
SyntaxError: ....../falcon-ui/node_modules/react-native-round-flags/index.js: Unexpected token, expected ";" (7:5)
5 | import * as flags from './flags';
6 |
> 7 | type Props = {
| ^
8 | code: string,
9 | style?: any,
10 | };
Hi,
"Belarus" country flag "BY" is missing in index.js. need to BY.png in index.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.