From b5a9f3a762731b25525f2b43e82e3797b18736b3 Mon Sep 17 00:00:00 2001 From: Konstantinos Leimonis Date: Wed, 19 Aug 2015 04:05:43 +0300 Subject: [PATCH] [added] NavBrand Component * NavBrand react component implementation * Deprecation of brand attribute of Navbar component Docs and Example * Update examples that were using Navbar brand attribute * Update docs description adding NavBrand component usage, removed documentation for Navbar brand attribute * Update related components used Navbar brand attribute, replacing it with NavBrand component * Update react-bootstrap website header using NavBrand component Navbar Component * Add deprecation warning message in Navbar Component for the brand attribute usage * Change logic rendering for Navbar component based on its child components, using a specific method for NavBrand rendering and the other existing one for other children - passing navbar, toggleNavKey, toggleButton, handleToggle and key to NavBrand for its render functionality * Add functionality needed once brand attribute is totally removed from Navbar component Utils - ValidComponentChildren * Added find functionality, returning children based on condition specified in callback function Tests * Create NavBrand specs * Updated test of Navbar component - assert deprecation warning messages - add new assertions for the NavBrand component used inside Navbar component --- docs/examples/.eslintrc | 1 + docs/examples/CollapsibleNav.js | 3 +- docs/examples/NavbarBasic.js | 3 +- docs/examples/NavbarBrand.js | 3 +- docs/examples/NavbarCollapsible.js | 3 +- docs/src/ComponentsPage.js | 6 ++- docs/src/NavMain.js | 4 +- docs/src/ReactPlayground.js | 1 + src/NavBrand.js | 38 ++++++++++++++ src/Navbar.js | 49 ++++++++++++++++-- src/index.js | 1 + src/utils/ValidComponentChildren.js | 29 +++++++++++ test/NavBrandSpec.js | 32 ++++++++++++ test/NavbarSpec.js | 80 ++++++++++++++++++++++++++++- 14 files changed, 239 insertions(+), 14 deletions(-) create mode 100644 src/NavBrand.js create mode 100644 test/NavBrandSpec.js diff --git a/docs/examples/.eslintrc b/docs/examples/.eslintrc index 946c5f8337..510b23948c 100644 --- a/docs/examples/.eslintrc +++ b/docs/examples/.eslintrc @@ -31,6 +31,7 @@ "ListGroup", "ListGroupItem", "Nav", + "NavBrand", "Navbar", "NavDropdown", "NavItem", diff --git a/docs/examples/CollapsibleNav.js b/docs/examples/CollapsibleNav.js index e7859a9205..34b6e182da 100644 --- a/docs/examples/CollapsibleNav.js +++ b/docs/examples/CollapsibleNav.js @@ -1,5 +1,6 @@ const navbarInstance = ( - + + React-Bootstrap {/* This is the eventKey referenced */}