New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-navbar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-navbar - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

CHANGELOG.md

45

package.json
{
"name": "react-navbar",
"version": "1.1.1",
"version": "2.0.0",
"description": "React.js component rendering a translatable menu bar with Twitter Bootstrap Navbar HTML markup",
"main": "build/index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "babel src -d build",
"clean": "rm build/*.js",
"lint": "eslint src tests",
"build": "tsc",
"lint": "tslint -c tslint.json src/*.{ts,tsx} test/*.{ts,tsx}",
"prepublish": "npm run build",
"pretest": "npm run lint",
"tdd": "mocha -w -R min -r babel-register -r tests/helpers/jsdom -t 4000 tests/*.spec.js",
"test": "mocha -r babel-register -r tests/helpers/jsdom -t 4000 tests/*.spec.js"
"tdd": "mocha -r ts-node/register -r tests/helpers/enzyme --watch-extensions ts,tsx -b -R min -w tests/*.spec.*",
"test": "mocha -r ts-node/register -r tests/helpers/enzyme -b tests/*.spec.*"
},

@@ -20,2 +20,3 @@ "repository": {

"keywords": [
"TypeScript",
"reactjs",

@@ -48,21 +49,19 @@ "component",

"dependencies": {
"classnames": "^2.1.2",
"react-intl": "^1.2.2"
"react-intl": "^2.4.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"jsdom": "^11.7.0",
"mocha": "^5.0.5",
"raf": "^3.4.0",
"react": "^0.13.3"
"@types/enzyme": "^3.1.12",
"@types/mocha": "^5.2.5",
"@types/react": "^16.4.6",
"@types/react-intl": "^2.3.8",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"jsdom": "^11.11.0",
"mocha": "^5.2.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"ts-node": "^7.0.0",
"tslint": "^5.11.0",
"typescript": "^2.9.2"
}
}

@@ -6,4 +6,4 @@ [![Build Status](https://travis-ci.org/ikr/react-navbar.svg?branch=master)](https://travis-ci.org/ikr/react-navbar)

React.js component rendering a translatable menu bar with Twitter Bootstrap
[Navbar](http://getbootstrap.com/components/#navbar) HTML markup. For example, for a menu structure
like the that:
[Navbar](https://getbootstrap.com/docs/3.3/components/#navbar) HTML markup. For example, for a menu
structure like the that:

@@ -28,48 +28,54 @@ ```

```js
import React from 'react';
import Navbar from 'react-navbar';
```jsx
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import {IntlProvider} from 'react-intl'
import * as Navbar from 'react-navbar'
const menuItems = [{
kind: 'dropdown',
title: 'menu.dd1',
items: [
{title: 'menu.i11', href: '/resource-1-1', target: '_blank'},
{title: 'menu.i12', href: '/resource-1-2'}
{kind: 'item', title: 'menu.i11', href: '/resource-1-1', target: '_blank'},
{kind: 'item', title: 'menu.i12', href: '/resource-1-2'}
]
},
{title: 'menu.i1', href: '/resource-1'},
{title: 'menu.i2', href: '/resource-2'}];
{kind: 'item', title: 'menu.i1', href: '/resource-1'},
{kind: 'item', title: 'menu.i2', href: '/resource-2'}]
const secondaryMenuItems = [{
kind: 'dropdown',
title: 'menu.dd2',
items: [
{title: 'menu.i21', href: '/resource-2-1'},
{title: 'menu.i22', href: '/resource-2-2'}
{kind: 'item', title: 'menu.i21', href: '/resource-2-1'},
{kind: 'item', title: 'menu.i22', href: '/resource-2-2'}
]
},
{title: 'menu.i3', href: '/resource-3'}];
{title: 'menu.i3', href: '/resource-3'}]
const localeSpecificIcuMessagesForTheWholeAppCompiledOnTheServer = {
menu: {
dd1: 'Drop-down-1', i11: 'Item-1-1', i12: 'Item-1-2',
i1: 'Item-1', i2: 'Item-2', i3: 'Item-3',
dd2: 'Drop-down-2', i21: 'Item-2-1', i22: 'Item-2-2'
},
'menu.dd1': 'Drop-down-1',
'menu.i11': 'Item-1-1',
'menu.i12': 'Item-1-2',
'menu.i1': 'Item-1',
'menu.i2': 'Item-2',
'menu.i3': 'Item-3',
'menu.dd2': 'Drop-down-2',
'menu.i21': 'Item-2-1',
'menu.i22': 'Item-2-2'
searchForm: {...},
footer: {...},
...
};
// ...
}
React.render(
React.createElement(Navbar, {
menuItems,
secondaryMenuItems,
messages: localeSpecificIcuMessagesForTheWholeAppCompiledOnTheServer
}),
ReactDOM.render(
<IntlProvider
locale='en'
messages={localeSpecificIcuMessagesForTheWholeAppCompiledOnTheServer}>
<Navbar {...{menuItems, secondaryMenuItems}}/>
</IntlProvider>,
global.document.body
);
document.getElementById('root')
)
```

@@ -81,17 +87,7 @@

Navbar is [react-intl](https://github.com/yahoo/react-intl)-based. To translate the component, make
sure it receives the `messages` property. The i18n message paths are the values of `title`-s of
`menuItems` and `secondaryMenuItems`.
Navbar is [react-intl](https://github.com/yahoo/react-intl)-based. The i18n message keys are the
values of `title`-s of `menuItems` and `secondaryMenuItems`.
`react-intl` foundation allows using `react-navbar` uniformly in bigger applications, and passing
all the namespaced translations, from the root, down the React components hierarchy, --
automatically, with the help of `IntlMixin`.
Please note, that `react-intl` depends on the global `Intl` object. You can polyfill it with
[intl](https://github.com/andyearnshaw/Intl.js) package:
```js
if (!global.Intl) {
require('intl');
}
```
all the translations, from the root, down the React components hierarchy, — automatically, with the
help of the `IntlProvider`.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc