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

Add Topic Category List and A-Z Topics Link to Sidebar #2243

Merged
merged 7 commits into from
Jan 14, 2025
5 changes: 5 additions & 0 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -4954,6 +4954,11 @@ h1.topic-landing-header {
.topic-landing-search-suggestion.highlighted{
background-color: #EDEDEC;
}
.topic-landing-sidebar-list{
font-size: 18px;
font-weight: 400;
line-height: 20px
}

.topic-landing-search-dropdown{
background: #FFFFFF;
Expand Down
28 changes: 28 additions & 0 deletions static/js/NavSidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const SidebarModules = ({type, props}) => {
"AboutTopics": AboutTopics,
"TrendingTopics": TrendingTopics,
"TopicLandingTrendingTopics": TopicLandingTrendingTopics,
"TopicLandingTopicCatList": TopicLandingTopicCatList,
"AZTopicsLink": AZTopicsLink,
"RelatedTopics": RelatedTopics,
"TitledText": TitledText,
"Visualizations": Visualizations,
Expand Down Expand Up @@ -619,6 +621,7 @@ const TopicLandingTrendingTopics = () => {
<div data-anl-feature_name="Trending" data-anl-link_type="topic">
<SidebarModule>
<SidebarModuleTitle>Trending Topics</SidebarModuleTitle>
<div className="topic-landing-sidebar-list">
{trendingTopics.map((topic, i) =>
<div className="navSidebarLink ref serif" key={i}>
<a
Expand All @@ -630,9 +633,34 @@ const TopicLandingTrendingTopics = () => {
</a>
</div>
)}
</div>
</SidebarModule>
</div>)
};
const TopicLandingTopicCatList = () => {
const topicCats = Sefaria.topicTocPage();
return(
<SidebarModule>
<SidebarModuleTitle>Browse Topics</SidebarModuleTitle>
<div className="topic-landing-sidebar-list">
{topicCats.map((topic, i) =>
<div className="navSidebarLink ref serif" key={i}>
<a href={"/topics/category/" + topic.slug}><InterfaceText text={{en: topic.en, he: topic.he}}/></a>
</div>
)}
</div>
</SidebarModule>
)
};
const AZTopicsLink = () => {
return (
<SidebarModule>
<a href={'/topics/all/a'}>
<SidebarModuleTitle>All Topics A-Z ›</SidebarModuleTitle>
</a>
</SidebarModule>
)
};


const RelatedTopics = ({title}) => {
Expand Down
4 changes: 3 additions & 1 deletion static/js/TopicLandingPage/TopicsLandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import Sefaria from "../sefaria/sefaria";

export const TopicsLandingPage = ({openTopic}) => {
const sidebarModules = [
{type: "TopicLandingTrendingTopics"}
{type: "TopicLandingTopicCatList"},
{type: "TopicLandingTrendingTopics"},
{type: "AZTopicsLink"},
];
return (
<div className="readerNavMenu" key="0">
Expand Down
Loading