Skip to content

Commit fde84df

Browse files
committed
Move "browse all questions/concepts" to top of page
On subject-specific question finders and concept listings, move the "browse all" button out of the sidebar to the top of the page. Remove this option entirely for practice tests because we don't want to link to the main practice tests listing anywhere.
1 parent 8f3db8e commit fde84df

File tree

3 files changed

+31
-67
lines changed

3 files changed

+31
-67
lines changed

src/app/components/elements/layout/SidebarLayout.tsx

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,6 @@ export const SubjectSpecificConceptListSidebar = (props: ConceptListSidebarProps
426426
}
427427
</div>
428428
</search>
429-
430-
<div className="section-divider"/>
431-
432-
<div className="sidebar-help">
433-
<p>The concepts shown on this page have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
434-
<p>If you want to explore broader concepts across multiple subjects or learning stages, you can use the main concept browser:</p>
435-
<AffixButton size="md" color="keyline" tag={Link} to="/concepts" affix={{
436-
affix: "icon-right",
437-
position: "suffix",
438-
type: "icon"
439-
}}>
440-
Browse concepts
441-
</AffixButton>
442-
</div>
443429
</ContentSidebar>;
444430
};
445431

@@ -490,23 +476,6 @@ export const GenericConceptsSidebar = (props: ConceptListSidebarProps) => {
490476
</div>
491477
</search>
492478

493-
<div className="section-divider"/>
494-
495-
{pageContext?.subject && <>
496-
<div className="section-divider"/>
497-
498-
<div className="sidebar-help">
499-
<p>The concepts shown on this page have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
500-
<p>If you want to explore broader concepts across multiple subjects or learning stages, you can use the main concept browser:</p>
501-
<AffixButton size="md" color="keyline" tag={Link} to="/concepts" affix={{
502-
affix: "icon-right",
503-
position: "suffix",
504-
type: "icon"
505-
}}>
506-
Browse concepts
507-
</AffixButton>
508-
</div>
509-
</>}
510479
</ContentSidebar>;
511480
};
512481

@@ -541,22 +510,6 @@ export const QuestionFinderSidebar = (props: QuestionFinderSidebarProps) => {
541510

542511
<QuestionFinderFilterPanel {...questionFinderFilterPanelProps} />
543512
</search>
544-
545-
{pageContext?.subject && pageContext?.stage && <>
546-
<div className="section-divider"/>
547-
548-
<div className="sidebar-help">
549-
<p>The questions shown here have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
550-
<p>If you want to explore our full range of questions across multiple subjects or learning stages, you can use the main question finder:</p>
551-
<AffixButton size="md" color="keyline" tag={Link} to="/questions" affix={{
552-
affix: "icon-right",
553-
position: "suffix",
554-
type: "icon"
555-
}}>
556-
Browse all questions
557-
</AffixButton>
558-
</div>
559-
</>}
560513
</ContentSidebar>;
561514
};
562515

@@ -660,20 +613,6 @@ export const PracticeQuizzesSidebar = (props: PracticeQuizzesSidebarProps) => {
660613
</ul>
661614
</>}
662615

663-
{isFullyDefinedContext(pageContext) && <>
664-
<div className="section-divider"/>
665-
<div className="sidebar-help">
666-
<p>The practice tests shown here have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
667-
<p>If you want to explore our full range of practice tests, you can view the main practice tests page:</p>
668-
<AffixButton size="md" color="keyline" tag={Link} to="/practice_tests" affix={{
669-
affix: "icon-right",
670-
position: "suffix",
671-
type: "icon"
672-
}}>
673-
Browse all practice tests
674-
</AffixButton>
675-
</div>
676-
</>}
677616
<div className="section-divider"/>
678617
<div className="sidebar-help">
679618
<p>You can see all of the tests that you have in progress or have completed in your My Isaac:</p>

src/app/components/pages/Concepts.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {FormEvent, MutableRefObject, useEffect, useMemo, useRef, useState} from "react";
2-
import {RouteComponentProps, withRouter} from "react-router-dom";
2+
import {Link, RouteComponentProps, withRouter} from "react-router-dom";
33
import {selectors, useAppSelector} from "../../state";
44
import {Badge, Card, CardBody, CardHeader, Container} from "reactstrap";
55
import queryString from "query-string";
@@ -10,11 +10,12 @@ import {IsaacSpinner} from "../handlers/IsaacSpinner";
1010
import { ListView } from "../elements/list-groups/ListView";
1111
import { ContentTypeVisibility, LinkToContentSummaryList } from "../elements/list-groups/ContentSummaryListGroupItem";
1212
import { SubjectSpecificConceptListSidebar, MainContent, SidebarLayout, GenericConceptsSidebar } from "../elements/layout/SidebarLayout";
13-
import { isFullyDefinedContext, useUrlPageTheme } from "../../services/pageContext";
13+
import { getHumanContext, isFullyDefinedContext, useUrlPageTheme } from "../../services/pageContext";
1414
import { useListConceptsQuery } from "../../state/slices/api/conceptsApi";
1515
import { ShowLoadingQuery } from "../handlers/ShowLoadingQuery";
1616
import { ContentSummaryDTO } from "../../../IsaacApiTypes";
1717
import { skipToken } from "@reduxjs/toolkit/query";
18+
import { AffixButton } from "../elements/AffixButton";
1819

1920
const subjectToTagMap = {
2021
physics: TAG_ID.physics,
@@ -113,13 +114,25 @@ export const Concepts = withRouter((props: RouteComponentProps) => {
113114
currentPageTitle="Concepts"
114115
intermediateCrumbs={crumb ? [crumb] : undefined}
115116
icon={{type: "hex", icon: "icon-concept"}}
117+
className="mb-4"
116118
/>
117119
<SidebarLayout>
118120
{pageContext?.subject
119121
? <SubjectSpecificConceptListSidebar {...sidebarProps}/>
120122
: <GenericConceptsSidebar {...sidebarProps}/>
121123
}
122124
<MainContent>
125+
{pageContext?.subject && <div className="d-flex align-items-baseline flex-wrap flex-md-nowrap">
126+
<p className="me-3 mt-2">The concepts shown on this page have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
127+
<AffixButton size="md" color="keyline" tag={Link} to="/concepts" className="ms-auto"
128+
affix={{
129+
affix: "icon-right",
130+
position: "suffix",
131+
type: "icon"
132+
}}>
133+
Browse all concepts
134+
</AffixButton>
135+
</div>}
123136
{isPhy && <div className="list-results-container p-2 my-4">
124137
<ShowLoadingQuery
125138
query={listConceptsQuery}

src/app/components/pages/QuestionFinder.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ import { PageFragment } from "../elements/PageFragment";
5252
import { RenderNothing } from "../elements/RenderNothing";
5353
import { processTagHierarchy, pruneTreeNode } from "../../services/questionHierarchy";
5454
import { SearchInputWithIcon } from "../elements/SearchInputs";
55+
import { AffixButton } from "../elements/AffixButton";
56+
import { Link } from "react-router-dom";
5557
import { updateTopicChoices } from "../../services";
5658

5759
// Type is used to ensure that we check all query params if a new one is added in the future
@@ -459,10 +461,20 @@ export const QuestionFinder = withRouter(({location}: RouteComponentProps) => {
459461

460462
{siteSpecific(
461463
<div className="my-3">
462-
{(pageContext?.subject && pageContext.stage
463-
? `Use our question finder to find questions to try on ${getHumanContext(pageContext)} topics.`
464-
: "Use our question finder to find questions to try on topics in Physics, Maths, Chemistry and Biology."
465-
) + " 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."}
464+
{(pageContext?.subject && pageContext.stage)
465+
? <div className="d-flex align-items-baseline flex-wrap flex-md-nowrap">
466+
<p className="me-3 mt-2">The questions shown on this page have been filtered to only show those that are relevant to {getHumanContext(pageContext)}.</p>
467+
<AffixButton size="md" color="keyline" tag={Link} to="/questions" className="ms-auto"
468+
affix={{
469+
affix: "icon-right",
470+
position: "suffix",
471+
type: "icon"
472+
}}>
473+
Browse all questions
474+
</AffixButton>
475+
</div>
476+
: <>Use our question finder to find questions to try on topics in Physics, Maths, Chemistry and Biology.
477+
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.</>}
466478
</div>,
467479
<PageFragment fragmentId={"question_finder_intro"} ifNotFound={RenderNothing} />
468480
)}

0 commit comments

Comments
 (0)