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

SFR-2300: Add survey banner to DRB #556

Merged
merged 1 commit into from
Nov 14, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

## [Prerelease]

- Add survey banner to Landing, Collection, Edition, Work, and Search pages

## [0.18.7]

- Fix header when banner is up

## [0.18.6]

- Add submit feedback error handling and new fields
- Fix docker file and playwright tests

## [0.18.5]

- Make NYPL footer sticky

## [0.18.4]
Expand Down
2 changes: 2 additions & 0 deletions src/components/Collection/Collection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Loading from "~/src/components/Loading/Loading";
import DrbHero from "../DrbHero/DrbHero";
import { CollectionItem } from "./CollectionItem";
import DrbBreakout from "../DrbBreakout/DrbBreakout";
import SurveyBanner from "../SurveyBanner/SurveyBanner";

const Collection: React.FC<{
collectionQuery: CollectionQuery;
Expand Down Expand Up @@ -139,6 +140,7 @@ const Collection: React.FC<{

const contentTopElement = (
<>
<SurveyBanner />
<Heading level="h2" marginBottom="xl">
{`Collection - ${title}`}
</Heading>
Expand Down
2 changes: 2 additions & 0 deletions src/components/EditionDetail/Edition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Instance } from "~/src/types/DataModel";
import { PLACEHOLDER_LINK } from "~/src/constants/collection";
import DrbBreakout from "../DrbBreakout/DrbBreakout";
import AuthorsList from "../AuthorsList/AuthorsList";
import SurveyBanner from "../SurveyBanner/SurveyBanner";

const Edition: React.FC<{ editionResult: EditionResult; backUrl?: string }> = (
props
Expand Down Expand Up @@ -81,6 +82,7 @@ const Edition: React.FC<{ editionResult: EditionResult; backUrl?: string }> = (

const contentTopElement = (
<>
<SurveyBanner />
<Flex direction={{ base: "column", md: "row" }}>
{edition && (
<Heading
Expand Down
6 changes: 4 additions & 2 deletions src/components/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Box,
Heading,
Hero,
Link,
TemplateAppContainer,
useNYPLBreakpoints,
} from "@nypl/design-system-react-components";
Expand All @@ -12,6 +11,8 @@ import CollectionList from "../CollectionList/CollectionList";
import { Opds2Feed } from "~/src/types/OpdsModel";
import DrbHero from "../DrbHero/DrbHero";
import DrbBreakout from "../DrbBreakout/DrbBreakout";
import Link from "../Link/Link";
import SurveyBanner from "../SurveyBanner/SurveyBanner";

const LandingPage: React.FC<{ collections?: Opds2Feed }> = ({
collections,
Expand All @@ -28,7 +29,7 @@ const LandingPage: React.FC<{ collections?: Opds2Feed }> = ({
Find millions of digital books for research from multiple sources
world-wide--all free to read, download, and keep. No library card
required. This is an early beta test, so we want your feedback!{" "}
<Link href="/about">Read more about the project</Link>.
<Link to="/about">Read more about the project</Link>.
</span>
<Box marginTop="s">
<SearchForm />
Expand Down Expand Up @@ -87,6 +88,7 @@ const LandingPage: React.FC<{ collections?: Opds2Feed }> = ({

const contentPrimaryElement = (
<Box marginLeft="l" marginRight="l">
<SurveyBanner />
<Heading level="h2">Recently Added Collections</Heading>
<CollectionList collections={collections} />
</Box>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import TotalWorks from "../TotalWorks/TotalWorks";
import filterFields from "~/src/constants/filters";
import { findFiltersForField } from "~/src/util/SearchQueryUtils";
import DrbBreakout from "../DrbBreakout/DrbBreakout";
import SurveyBanner from "../SurveyBanner/SurveyBanner";

const SearchResults: React.FC<{
searchQuery: SearchQuery;
Expand Down Expand Up @@ -263,6 +264,7 @@ const SearchResults: React.FC<{
<TotalWorks totalWorks={numberOfWorks} />
</Box>
)}
<SurveyBanner />
<Box className="search-heading">
<Box role="alert">
<Heading level="h1" size="heading3" id="page-title-heading">
Expand Down
25 changes: 25 additions & 0 deletions src/components/SurveyBanner/SurveyBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import { Banner, Text } from "@nypl/design-system-react-components";
import Link from "../Link/Link";

const SurveyBanner: React.FC = () => {
return (
<Banner
type="informative"
content={
<>
<Text noSpace>
Do you use Digital Research Books at the Library? Help us learn
about your experiences by{" "}
<Link to="https://www.surveymonkey.com/r/8B37XDL">
taking a short survey.
</Link>
</Text>
</>
}
marginBottom="l"
/>
);
};

export default SurveyBanner;
2 changes: 2 additions & 0 deletions src/components/Work/Work.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { MAX_TITLE_LENGTH } from "~/src/constants/editioncard";
import { PLACEHOLDER_LINK } from "~/src/constants/collection";
import DrbBreakout from "../DrbBreakout/DrbBreakout";
import AuthorsList from "../AuthorsList/AuthorsList";
import SurveyBanner from "../SurveyBanner/SurveyBanner";

const WorkDetail: React.FC<{ workResult: WorkResult; backUrl?: string }> = (
props
Expand Down Expand Up @@ -77,6 +78,7 @@ const WorkDetail: React.FC<{ workResult: WorkResult; backUrl?: string }> = (

const contentTopElement = (
<>
<SurveyBanner />
<Box>
<Heading level="h1" size="heading2" id="work-title">
{work.title}
Expand Down
Loading