Skip to content

Commit

Permalink
chore: SheetContent displays public collections and summary
Browse files Browse the repository at this point in the history
  • Loading branch information
stevekaplan123 committed Sep 8, 2024
1 parent 7492c58 commit d37a9d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions static/js/Sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ class Sheet extends Component {
collectionName={sheet.collectionName}
collectionSlug={sheet.displayedCollection}
collectionImage={sheet.collectionImage}
collections={sheet.collections}
summary={sheet.summary}
/>
</div>
);
Expand Down
18 changes: 15 additions & 3 deletions static/js/SheetSidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {FollowButton, InterfaceText, ProfilePic} from "./Misc";
import Sefaria from "./sefaria/sefaria";
import React, {useEffect, useState} from "react";
const SheetSidebar = ({authorID, authorImage, authorStatement, authorUrl,
collectionImage, collectionSlug, collectionName}) => {
const SheetSidebar = ({authorID, authorImage, authorStatement, authorUrl, summary,
collectionImage, collectionSlug, collectionName, collections}) => {
const [loading, setLoading] = useState(true);
const [followers, setFollowers] = useState(0);
useEffect(() => {
Expand All @@ -21,12 +21,24 @@ const SheetSidebar = ({authorID, authorImage, authorStatement, authorUrl,
<a href={authorUrl} className="sheetAuthorName">
<InterfaceText>{authorStatement}</InterfaceText>
</a>
{!loading && <div className="sheetFollowers">{followers} followers</div>}
<div className="description">{summary}</div>
{!loading && <div className="sheetFollowers">{followers} {Sefaria._("followers")}</div>}
<FollowButton
large={true}
uid={authorID}
following={Sefaria.following.indexOf(authorID) > -1}
/>
{collections.length > 0 &&
<div className="aboutLinks">
<h3 className="aboutSheetHeader"><InterfaceText>Public Collections</InterfaceText></h3>
<div>
<ul className="aboutSheetLinks">
{collections.map((collection, i) => (
<li key={i}><a href={"/collections/" + collection.slug}><InterfaceText>{collection.name}</InterfaceText></a></li>
))}
</ul>
</div>
</div>}
{/*<NavSidebar modules={sidebarModules} />*/}
</div>;
}
Expand Down

0 comments on commit d37a9d4

Please sign in to comment.