diff --git a/public/assets/cs/icons/home.svg b/public/assets/cs/icons/home.svg new file mode 100644 index 0000000000..d721981cf7 --- /dev/null +++ b/public/assets/cs/icons/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/components/elements/AdaNewsSection.tsx b/src/app/components/elements/AdaNewsSection.tsx index 31713680f1..d2e3115211 100644 --- a/src/app/components/elements/AdaNewsSection.tsx +++ b/src/app/components/elements/AdaNewsSection.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Row, Button, Container } from "reactstrap"; +import { Row, Button } from "reactstrap"; import { useDeviceSize } from "../../services"; import { IconCard } from "./cards/IconCard"; import { NewsCard } from "./cards/NewsCard"; @@ -14,7 +14,7 @@ export const AdaNewsSection = ({isHomepage}: {isHomepage?: boolean}) => { const showNewsletterPrompts = !userPreferences?.EMAIL_PREFERENCE?.NEWS_AND_UPDATES; const {setLinkedSetting} = useLinkableSetting(); - return ((news && news.length > 0) || showNewsletterPrompts) && + return ((news && news.length > 0) || showNewsletterPrompts) && <>

Tips, tools & support

{news && news.length > 0 && <> @@ -40,6 +40,6 @@ export const AdaNewsSection = ({isHomepage}: {isHomepage?: boolean}) => { /> } -
; + ; }; \ No newline at end of file diff --git a/src/app/components/elements/SidebarButton.tsx b/src/app/components/elements/SidebarButton.tsx index a521a545ff..a7c15bd8de 100644 --- a/src/app/components/elements/SidebarButton.tsx +++ b/src/app/components/elements/SidebarButton.tsx @@ -3,6 +3,8 @@ import { AffixButton } from './AffixButton'; import { ButtonProps } from 'reactstrap'; import { sidebarSlice, useAppDispatch } from '../../state'; import classNames from 'classnames'; +import { siteSpecific } from '../../services'; +import { Spacer } from './Spacer'; interface SidebarButtonProps extends ButtonProps { buttonTitle?: string; @@ -28,23 +30,35 @@ export const SidebarButton = ({ buttonTitle, absolute, ...rest }: SidebarButtonP }; }, [isSticky]); - const button = } - className={classNames("sidebar-toggle no-print", {"sidebar-toggle-top": !absolute, "stuck": sticky}, rest.className)} - color="keyline" - onClick={toggleMenu} - affix={{ - affix: "icon-sidebar", - position: "prefix", - type: "icon", - affixClassName: "icon-inline me-2" - }} - style={{maxWidth: textRef?.current ? `${(!sticky ? textRef.current.clientWidth + 8 : 0) + 61}px` : "max-content"}} - > - {buttonTitle ?? "Search and filter"} - ; + const button = siteSpecific( + } + className={classNames("sidebar-toggle no-print", {"sidebar-toggle-top": !absolute, "stuck": sticky}, rest.className)} + color="keyline" + onClick={toggleMenu} + affix={{ + affix: "icon-sidebar", + position: "prefix", + type: "icon", + affixClassName: "icon-inline me-2" + }} + style={{maxWidth: textRef?.current ? `${(!sticky ? textRef.current.clientWidth + 8 : 0) + 61}px` : "max-content"}} + > + {buttonTitle ?? "Search and filter"} + , + + ); return absolute ?
}> diff --git a/src/app/components/elements/TitleAndBreadcrumb.tsx b/src/app/components/elements/TitleAndBreadcrumb.tsx index 79c1a2a097..775b04d853 100644 --- a/src/app/components/elements/TitleAndBreadcrumb.tsx +++ b/src/app/components/elements/TitleAndBreadcrumb.tsx @@ -57,7 +57,7 @@ type TitleAndBreadcrumbProps = BreadcrumbTrailProps & PageTitleProps & TitleMeta }; export const TitleAndBreadcrumb = ({children, breadcrumbTitleOverride, currentPageTitle, displayTitleOverride, subTitle, disallowLaTeX, className, audienceViews, help, collectionType, intermediateCrumbs, preview, icon}: TitleAndBreadcrumbProps) => { - return
+ return
{isPhy &&
} +
syncScroll("top")} ref={topScrollbarRef} style={{ height: scrollbarSize }} > diff --git a/src/app/components/elements/inputs/StyledTabPicker.tsx b/src/app/components/elements/inputs/StyledTabPicker.tsx index 9c65edbfd5..ddd922291e 100644 --- a/src/app/components/elements/inputs/StyledTabPicker.tsx +++ b/src/app/components/elements/inputs/StyledTabPicker.tsx @@ -4,6 +4,7 @@ import { Label, Input } from "reactstrap"; import { isDefined } from "../../../services"; import { Spacer } from "../Spacer"; import classNames from "classnames"; +import { Link } from "react-router-dom"; /** * @typedef {Object} StyledTabPickerProps @@ -13,20 +14,40 @@ import classNames from "classnames"; * @property {React.ChangeEventHandler} [onInputChange] - The function to call when the tab is clicked. * @property {ReactNode} checkboxTitle - The title of the tab. * @property {number} [count] - The number to display on the tab. + * @property {"left" | "right"} [indicatorPosition] - The position of the indicator. + * @property {Object} [suffix] - An optional suffix to display on the tab. + * @property {"checkbox" | "radio" | "link"} type - The type of the tab picker. + * @property {string} [to] - The URL to navigate to when the tab is clicked (only for type "link"). */ -interface StyledTabPickerProps extends React.HTMLAttributes { +type StyledTabPickerProps = React.HTMLAttributes & { checked?: boolean; disabled?: boolean; onInputChange?: React.ChangeEventHandler | undefined; checkboxTitle: ReactNode; count?: number; + indicatorPosition?: "left" | "right"; suffix?: { icon: string; action?: (e: React.MouseEvent) => void; info: string; } -} +} & ({ + type?: "checkbox" | "radio"; + to?: never; +} | { + type: "link"; + to: string; +}) + +const PickerContents = ({checkboxTitle, count, suffix, disabled}: Pick) => <> + {checkboxTitle} + {isDefined(count) && {count}} + + {suffix && } +; /** * A StyledTabPicker component, used to render a list of selectable tabs, each with a title and optional counter (as to indicate how many options selecting that would provide). @@ -38,13 +59,18 @@ interface StyledTabPickerProps extends React.HTMLAttributes { export const StyledTabPicker = (props: StyledTabPickerProps): JSX.Element => { const { checked, disabled, onInputChange, checkboxTitle, count, suffix, ...rest } = props; const id = checkboxTitle?.toString().replace(" ", "-"); - return