From bae7ffdd5f4503fa297dd5a69109a41108f88372 Mon Sep 17 00:00:00 2001 From: Yaxue Guo Date: Tue, 29 Oct 2024 20:50:57 -0400 Subject: [PATCH] #356: updated navbar and footer style based on react bootstrap components --- src/components/Footer.jsx | 21 ++-- src/components/Header.jsx | 142 ++++++++++++++++------- src/components/Home/HomepageCarousel.jsx | 2 +- src/components/common/Table.jsx | 2 +- src/components/common/TableHeader.jsx | 4 +- src/pages/PublicationTracker.jsx | 5 +- src/styles/App.scss | 36 ++---- 7 files changed, 123 insertions(+), 89 deletions(-) diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index b32f8ab..1caa851 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -15,20 +15,19 @@ import trustedciBadge from "../imgs/trustedci.png"; class Footer extends React.Component { render() { return ( - - - + + +
  • Useful Links
  • Acceptable Use Policy
  • Cookie Policy
  • - {/*
  • Privacy Policy
  • */}
  • Branding Resources
- +
  • Help & Support
  • Knowledge Base
  • @@ -43,7 +42,7 @@ class Footer extends React.Component {
- +
  • Social
  • @@ -66,7 +65,7 @@ class Footer extends React.Component {
- +
- - + +
  • © FABRIC {new Date().getFullYear()}
- -
+ +
{ const navItems = (props.globalRoles && !props.globalRoles.isJupterhubUser) ? [ { name: "Resources", - href: "/resources", + path: "/resources", child: [ { name: "Testbed Resources", - href: "/resources/overview" + path: "/resources/overview" }, { name: "Measurement Metrics", - href: "/resources/tools" + path: "/resources/tools" } ] }, { name: "Experiments", - href: "/experiments", + path: "/experiments", child: [] }, { name: "Knowledge Base", href: portalData.knowledgeBaseLink, - child: [] + child: [], + path: "" }, { name: "JupyterHub", child: [], - href: "/jupyter-no-access" + path: "/jupyter-no-access" }, - { name: "Contact Us", href: "/help", child: [] }, + { name: "Contact Us", path: "/help", child: [] }, { name: "About", child: [ { name: "Overview", - href: "/about/about-fabric" + path: "/about/about-fabric" }, { name: "SAC", - href: "/about/sac" + path: "/about/sac" }, { name: "Leadership", - href: "/about/leadership" + path: "/about/leadership" } ], - href: "/about" + path: "/about" }, { name: "Community", @@ -81,79 +82,81 @@ const Header = (props) => { }, { name: "Newsletter Signup", - href: "/community/newsletter-signup" + path: "/community/newsletter-signup" }, { name: "Funding Opportunities", - href: "/community/funding-opportunities" + path: "/community/funding-opportunities" }, { name: "Testbeds and Facilities", - href: "/community/testbeds-and-facilities" + path: "/community/testbeds-and-facilities" }, { name: "Cite FABRIC", - href: "/community/publications" + path: "/community/publications" }, { name: "FABRIC User Publications", - href: "/community/fabric-user-publications" + path: "/community/fabric-user-publications" }, { name: "Blogs", href: portalData.knowledgeBaseBlogsLink, } ], - href: "/community" + path: "/community" } ] : [ { name: "Resources", - href: "/resources", + path: "/resources", child: [ { name: "Resources Overview", - href: "/resources/overview" + path: "/resources/overview" }, { name: "Measuring and Monitoring Tools", - href: "/resources/tools" + path: "/resources/tools" } ] }, { name: "Experiments", - href: "/experiments", + path: "/experiments", child: [] }, { name: "Knowledge Base", href: portalData.knowledgeBaseLink, - child: [] + child: [], + path: "" }, { name: "JupyterHub", href: portalData.jupyterHubLinks[checkPortalType(window.location.href)], - child: [] + child: [], + path: "" }, - { name: "Contact Us", href: "/help", child: [] }, + { name: "Contact Us", path: "/help", child: [] }, { name: "About", child: [ { name: "Overview", - href: "/about/about-fabric" + path: "/about/about-fabric" }, { name: "SAC", - href: "/about/sac" + path: "/about/sac" }, { name: "Leadership", - href: "/about/leadership" + path: "/about/leadership" } ], - href: "/about" + path: "/about" }, { name: "Community", @@ -172,30 +175,30 @@ const Header = (props) => { }, { name: "Newsletter Signup", - href: "/community/newsletter-signup" + path: "/community/newsletter-signup" }, { name: "Funding Opportunities", - href: "/community/funding-opportunities" + path: "/community/funding-opportunities" }, { name: "Testbeds and Facilities", - href: "/community/testbeds-and-facilities" + path: "/community/testbeds-and-facilities" }, { name: "Cite FABRIC", - href: "/community/publications" + path: "/community/publications" }, { name: "FABRIC User Publications", - href: "/community/fabric-user-publications" + path: "/community/fabric-user-publications" }, { name: "Blogs", href: portalData.knowledgeBaseBlogsLink, } ], - href: "/community" + path: "/community" } ] @@ -238,8 +241,7 @@ const Header = (props) => { }; return ( - - + { { navItems.map((item, index) => { if (item.child.length === 0) { - return {item.name} + if (item.path) { + return {item.name} + } else { + return {item.name} + } } else { return { item.child.map((sub_item, sub_index) => { - return + {sub_item.name} + + } else { + return {sub_item.name} - } - )} + + } + })} } }) } + { + props.userStatus === "active" && !window.location.href.includes("/search-results") && +
+ +
+ +
+
+ } + { props.userStatus !== "active" ? +
+ + + + + + +
: +
+ + + } -
) } diff --git a/src/components/Home/HomepageCarousel.jsx b/src/components/Home/HomepageCarousel.jsx index 0593e90..fd0ccc1 100644 --- a/src/components/Home/HomepageCarousel.jsx +++ b/src/components/Home/HomepageCarousel.jsx @@ -48,7 +48,7 @@ class HomepageCarousel extends React.Component { items && items.length > 0 && items.map((item, index) => {`FABRIC - +

{item.title}

{Parser(item.content)} diff --git a/src/components/common/Table.jsx b/src/components/common/Table.jsx index a382b70..3f0dedf 100644 --- a/src/components/common/Table.jsx +++ b/src/components/common/Table.jsx @@ -9,7 +9,7 @@ const Table = ({ columns, onSort, sortColumn, data, tStyle, tHeadStyle, onCheck columns={columns} sortColumn={sortColumn} onSort={onSort} - style={tHeadStyle} + tHeadStyle={tHeadStyle} /> + {sortColumn && this.props.columns.map((column) => ( p.title.toLowerCase().includes(searchQuery.toLowerCase()) - || p.authors.toLowerCase().includes(searchQuery.toLowerCase()) - || p.project_name.toLowerCase().includes(searchQuery.toLowerCase()) + || p.authors.join().toLowerCase().includes(searchQuery.toLowerCase()) + || (p.project_name && p.project_name.toLowerCase().includes(searchQuery.toLowerCase())) || p.year.includes(searchQuery.toLowerCase()) ); } diff --git a/src/styles/App.scss b/src/styles/App.scss index 2e3ad14..12b9098 100644 --- a/src/styles/App.scss +++ b/src/styles/App.scss @@ -131,46 +131,23 @@ h1, h2, h3, h4, h5, h6 { flex-direction: column; align-items: center; justify-content: center; - height: 50rem; - margin-top: 0; - padding: 0 2rem; - right: 0; - left: 0; - bottom: 0; - width: 100%; + margin: 0 !important; + width: 100% !important; + max-width: 100vw !important; + height: 25rem !important; + max-height: 25rem !important; + min-height: 25rem !important; } .app-footer div { width: 100%; } -.navbar-brand img { - margin-top: 2px !important; - margin-right: 1px !important; -} - .navbar .form-control { padding: 0px 8px !important; height: 35px !important; } -.navbar .btn { - height: 33px !important; - padding: 3px 10px !important; -} - -.homepage-carousel-content { - display: none; -} - -.carousel-caption { - width: 80%; -} - -.carousel-caption-content h3 { - font-size: 1.5rem; -} - @media (min-width: 992px) { .navbar-expand-lg .navbar-nav .nav-link { margin-top: 0px !important; @@ -423,6 +400,7 @@ h6[aria-expanded="false"] .fa-minus { a { color: $primary-color-dark; + text-decoration: none; } p a {