![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-navbar
Advanced tools
React.js component rendering a translatable menu bar with Twitter Bootstrap Navbar HTML markup
React.js component rendering a translatable menu bar with Twitter Bootstrap Navbar HTML markup. For example, for a menu structure like the that:
+-------------+--------+--------+---------------+-------------+--------+
| | | | | | |
| Drop-down-1 | Item-1 | Item-2 | | Drop-down-2 | Item-3 |
| | | | | | |
+-------------+--------+--------+---------------+--+----------+--------+
| |
| Item-2-1 |
| |
+----------+
| |
| Item-2-2 |
| |
+----------+
one would have to initialize a Navbar
component instance in the following way:
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import {IntlProvider} from 'react-intl'
import {default as Navbar, MenuElementKind} from 'react-navbar'
const {ITEM, DROPDOWN} = MenuElementKind
const menuItems = [{
kind: DROPDOWN,
title: 'menu.dd1',
items: [
{kind: ITEM, title: 'menu.i11', href: '/resource-1-1', target: '_blank'},
{kind: ITEM, title: 'menu.i12', href: '/resource-1-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: [
{kind: ITEM, title: 'menu.i21', href: '/resource-2-1'},
{kind: ITEM, title: 'menu.i22', href: '/resource-2-2'}
]
},
{title: 'menu.i3', href: '/resource-3'}]
const localeSpecificIcuMessagesForTheWholeAppCompiledOnTheServer = {
'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'
// ...
}
ReactDOM.render(
<IntlProvider
locale='en'
messages={localeSpecificIcuMessagesForTheWholeAppCompiledOnTheServer}>
<Navbar {...{menuItems, secondaryMenuItems}}/>
</IntlProvider>,
document.getElementById('root')
)
The secondaryMenuItems
are optional.
Navbar is 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 translations, from the root, down the React components hierarchy, — automatically, with the
help of the IntlProvider
.
FAQs
React.js component rendering a translatable menu bar with Twitter Bootstrap Navbar HTML markup
The npm package react-navbar receives a total of 0 weekly downloads. As such, react-navbar popularity was classified as not popular.
We found that react-navbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.