Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ttahub 138 al tp survey on ar landing #334

Merged
merged 18 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function App() {
<>
<Helmet titleTemplate="%s - TTA Smart Hub" defaultTitle="TTA Smart Hub">
<meta charSet="utf-8" />
<script src="https://touchpoints.app.cloud.gov/touchpoints/7d519b5e.js" async />
</Helmet>
<BrowserRouter>
{authenticated && (
Expand Down
29 changes: 23 additions & 6 deletions frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
import React from 'react';
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { NavLink as Link } from 'react-router-dom';
import { NavLink as Link, withRouter } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChartBar } from '@fortawesome/free-solid-svg-icons';

Expand Down Expand Up @@ -33,6 +33,7 @@ const SiteNav = ({
authenticated,
logout,
user,
location,
}) => {
const navItems = [
<button type="button" onClick={() => logout(false)} className={`usa-button--unstyled width-full ${navLinkClasses}`}>
Expand All @@ -46,11 +47,25 @@ const SiteNav = ({
</NavLink>,
];

const [showActivityReportSurveyButton, setShowActivityReportSurveyButton] = useState(false);

useEffect(() => {
if (location.pathname === '/activity-reports') {
setShowActivityReportSurveyButton(true);
} else {
setShowActivityReportSurveyButton(false);
}
}, [location.pathname]);

const items = admin ? navItems.concat(adminNavItem) : navItems;

return (
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<div>
<div className="position-relative z-top">
<button id="tp-ar-landing-survey" className={`usa-button position-fixed bottom-2 right-1 display-${showActivityReportSurveyButton ? 'block' : 'none'}`} aria-label="Please leave feedback" type="button">Please leave feedback</button>
</div>
<div className="smart-hub-sitenav pin-y position-fixed z-0 padding-top-9 font-ui text-white smart-hub-bg-blue width-15 tablet:width-card desktop:width-card-lg no-print">
{authenticated && (
<>
<div className="width-full smart-hub-sitenav-separator--after">
<div role="complementary" className="padding-2 smart-hub-sitenav-word-wrap--break">
Expand Down Expand Up @@ -80,7 +95,8 @@ const SiteNav = ({
</div>
</nav>
</>
)}
)}
</div>
</div>
);
};
Expand All @@ -91,6 +107,7 @@ SiteNav.propTypes = {
authenticated: PropTypes.bool,
logout: PropTypes.func,
user: PropTypes.shape({ name: PropTypes.string, email: PropTypes.string }),
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired,
};

SiteNav.defaultProps = {
Expand All @@ -103,4 +120,4 @@ SiteNav.defaultProps = {
},
};

export default SiteNav;
export default withRouter(SiteNav);
4 changes: 4 additions & 0 deletions frontend/src/pages/Landing/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
font-family: 'Merriweather', serif;
}

.fba-modal .fba-modal-dialog {
margin-top: 120px;
}

.pagination {
float: right;
white-space: nowrap;
Expand Down