Skip to content

Commit b1c01b6

Browse files
committed
Add QF description text
1 parent 3fc5333 commit b1c01b6

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

src/app/components/elements/PageTitle.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export interface TitleIconProps {
7272
export interface PageTitleProps {
7373
currentPageTitle: string;
7474
subTitle?: string;
75+
description?: string;
7576
disallowLaTeX?: boolean;
7677
help?: ReactElement;
7778
className?: string;
@@ -80,7 +81,7 @@ export interface PageTitleProps {
8081
preview?: boolean;
8182
icon?: TitleIconProps;
8283
}
83-
export const PageTitle = ({currentPageTitle, subTitle, disallowLaTeX, help, className, audienceViews, modalId, preview, icon}: PageTitleProps) => {
84+
export const PageTitle = ({currentPageTitle, subTitle, description, disallowLaTeX, help, className, audienceViews, modalId, preview, icon}: PageTitleProps) => {
8485
const dispatch = useAppDispatch();
8586
const openModal = useAppSelector((state: AppState) => Boolean(state?.activeModals?.length));
8687
const headerRef = useRef<HTMLHeadingElement>(null);
@@ -118,12 +119,17 @@ export const PageTitle = ({currentPageTitle, subTitle, disallowLaTeX, help, clas
118119
}
119120

120121
return <h1 id="main-heading" tabIndex={-1} ref={headerRef} className={classNames("h-title h-secondary d-sm-flex", {"align-items-center py-4": isPhy}, className)}>
121-
{icon && (
122-
icon.type === "img" ? <img src={icon.icon} alt="" className="me-3"/>
123-
: icon.type === "hex" ? <PhyHexIcon icon={icon.icon} subject={icon.subject}/> : undefined)}
124-
<div className="me-auto" data-testid={"main-heading"}>
125-
{formatPageTitle(currentPageTitle, disallowLaTeX)}
126-
{subTitle && <span className="h-subtitle d-none d-sm-block">{subTitle}</span>}
122+
<div className="me-auto">
123+
<div className="d-sm-flex align-items-center">
124+
{icon && (
125+
icon.type === "img" ? <img src={icon.icon} alt="" className="me-3"/>
126+
: icon.type === "hex" ? <PhyHexIcon icon={icon.icon} subject={icon.subject}/> : undefined)}
127+
<div className="me-auto" data-testid={"main-heading"}>
128+
{formatPageTitle(currentPageTitle, disallowLaTeX)}
129+
{subTitle && <span className="h-subtitle d-none d-sm-block">{subTitle}</span>}
130+
</div>
131+
</div>
132+
{description && <div className="h-description">{description}</div>}
127133
</div>
128134
<Helmet>
129135
<meta property="og:title" content={currentPageTitle} />

src/app/components/elements/TitleAndBreadcrumb.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type TitleAndBreadcrumbProps = BreadcrumbTrailProps & PageTitleProps & {
5454
breadcrumbTitleOverride?: string;
5555
children?: ReactElement | boolean;
5656
};
57-
export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride, currentPageTitle, subTitle, disallowLaTeX, className, audienceViews, help, collectionType, intermediateCrumbs, preview, icon}: TitleAndBreadcrumbProps) => {
57+
export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride, currentPageTitle, subTitle, description, disallowLaTeX, className, audienceViews, help, collectionType, intermediateCrumbs, preview, icon}: TitleAndBreadcrumbProps) => {
5858
return <div className={classNames(className, {"title-breadcrumb-container": isPhy, "pt-4 pt-md-5": isAda})}>
5959
{isPhy && <div className="title-graphics"/>}
6060
{isAda && <BreadcrumbTrail
@@ -64,7 +64,7 @@ export const TitleAndBreadcrumb = ({modalId, children, breadcrumbTitleOverride,
6464
/>}
6565
{children}
6666
<PageTitle
67-
modalId={modalId} subTitle={subTitle}
67+
modalId={modalId} subTitle={subTitle} description={description}
6868
disallowLaTeX={disallowLaTeX} audienceViews={audienceViews}
6969
currentPageTitle={currentPageTitle} help={help}
7070
preview={preview} icon={icon}

src/app/components/pages/QuestionFinder.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ export const QuestionFinder = withRouter(({location}: RouteComponentProps) => {
394394

395395
return <Container id="finder-page" className={classNames("mb-5")} { ...(pageContext?.subject && { "data-bs-theme" : pageContext.subject })}>
396396
<TitleAndBreadcrumb
397-
currentPageTitle={siteSpecific("Question Finder", "Questions")}
397+
currentPageTitle={siteSpecific("Question Finder", "Questions")}
398+
description={siteSpecific("Use our question finder to find questions to try on topics in Physics, Maths, Chemistry and Biology. Use our practice questions to become fluent in topics and then take your understanding and problem solving skills to the next level with our challenge questions.", "")}
398399
help={pageHelp}
399400
icon={{type: "hex", icon: "page-icon-finder"}}
400401
/>

src/scss/common/header.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ header {
8484
line-height: 1.2;
8585
}
8686

87+
.h-description {
88+
margin-left: 92px;
89+
padding-top: 5px;
90+
font-size: 1rem;
91+
width: 75%
92+
}
93+
8794
a.skip-main {
8895
left:-999px;
8996
position:absolute;

0 commit comments

Comments
 (0)