Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/i18n / coverage / lcov-report / src / containers / LocaleSwitcher / LocaleSwitcher.js.html
Size: Mime:
<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/containers/LocaleSwitcher/LocaleSwitcher.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../../prettify.css" />
    <link rel="stylesheet" href="../../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../../index.html">All files</a> / <a href="index.html">src/containers/LocaleSwitcher</a> LocaleSwitcher.js
    </h1>
    <div class='clearfix'>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50</td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >import React, { Component } from 'react';</span>
<span class="cstat-no" title="statement not covered" >import PropTypes from 'prop-types';</span>
<span class="cstat-no" title="statement not covered" >import { connect } from 'react-redux';</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >import LanguageMenu from '@doodle/components/controls/LanguageMenu';</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >import flags from './localeFlagsHelper';</span>
<span class="cstat-no" title="statement not covered" >import { changeLocale } from '../../state/actions';</span>
<span class="cstat-no" title="statement not covered" >import defaultLocales from '../../locales';</span>
&nbsp;
class LocaleSwitcher extends Component {
  static propTypes = {
    currentLocale: PropTypes.string.isRequired,
    locales: PropTypes.object,
    onChangeLocale: PropTypes.func.isRequired,
  };
&nbsp;
  static defaultProps = {
    locales: defaultLocales,
  };
&nbsp;
  render() <span class="cstat-no" title="statement not covered" >{</span>
    const { currentLocale, locales, onChangeLocale } = <span class="cstat-no" title="statement not covered" >this.props;</span>
&nbsp;
    const items = <span class="cstat-no" title="statement not covered" >Object.entries(locales).map(<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >([locale, label]) =&gt; ({</span></span></span>
      label,
      icon: flags[locale],
      action: <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >() =&gt; onChangeLocale(locale),</span></span>
    }));
&nbsp;
<span class="cstat-no" title="statement not covered" >    return (</span>
      &lt;LanguageMenu className="LocaleSwitcher" items={items}&gt;
        {locales[currentLocale]}
      &lt;/LanguageMenu&gt;
    );
  }
}
&nbsp;
const <span class="fstat-no" title="function not covered" >mapStateToProps = <span class="cstat-no" title="statement not covered" >s</span>tate<span class="cstat-no" title="statement not covered" > =&gt; ({</span></span>
  currentLocale: state.i18n.locale,
});
&nbsp;
const <span class="fstat-no" title="function not covered" >mapDispatchToProps = <span class="cstat-no" title="statement not covered" >d</span>ispatch<span class="cstat-no" title="statement not covered" > =&gt; ({</span></span>
  onChangeLocale: <span class="fstat-no" title="function not covered" >locale =&gt; {</span>
<span class="cstat-no" title="statement not covered" >    dispatch(changeLocale(locale));</span>
  },
});
&nbsp;
export default connect(mapStateToProps, mapDispatchToProps)(LocaleSwitcher);
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Jul 28 2020 14:07:09 GMT+0200 (Central European Summer Time)
</div>
</div>
<script src="../../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../../sorter.js"></script>
</body>
</html>