Giter Site home page Giter Site logo

react-native-round-flags's Introduction

react-native-round-flags

Fun with flags (in React Native)!

Example

Round Icons demonstration

Usage

import Flag from 'react-native-round-flags';

const JustAFlag = () =>
  <Flag code="DE"/>

### Props

code

Type: String

The ISO code of a flag, for example "DE", "FR" or "GB"

style (optional)

Allows additional styles to be passed through.

License

MIT

react-native-round-flags's People

Contributors

conorseabrook avatar pohodnya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-round-flags's Issues

Doesnt work with node v13.11.0

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 | };

Missing Flags

The following flags are missing:

  • Bouvet Island
  • Congo (Republic)
  • Dominica
  • French Guiana
  • Heard Island and McDonald Islands
  • Kosovo
  • Saint Barthelemy
  • Saint Martin
  • United States Minor Outlying Islands
  • Western Sahara

Some of them do not have separate flags. Bouvet Island has the Norwegian flag. However, others like Kosovo do have a separate flag.

Selected flag border

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:

1111111

On some devices it looks absolutely fine:

22222222222

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.