Skip to content

Commit

Permalink
chore: followbutton should trigger togglesignupmodal
Browse files Browse the repository at this point in the history
  • Loading branch information
stevekaplan123 committed Dec 12, 2024
1 parent f7ff974 commit 07bc2b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion static/js/ReaderPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ class ReaderPanel extends Component {
);
}
if (this.state.mode === "Sheet") {
console.log(this.props)
menu = <Sheet
adjustHighlightedAndVisible={this.adjustSheetHighlightedAndVisible}
panelPosition ={this.props.panelPosition}
Expand All @@ -703,7 +704,7 @@ class ReaderPanel extends Component {
setDivineNameReplacement={this.props.setDivineNameReplacement}
divineNameReplacement={this.props.divineNameReplacement}
hasSidebar={this.props.hasSidebar}
toggleSideUpModal={this.props.toggleSignUpModal}
toggleSignUpModal={this.props.toggleSignUpModal}
/>;
}

Expand Down
1 change: 1 addition & 0 deletions static/js/sheets/Sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Sheet extends Component {
content = (<LoadingMessage />);
}
else {
console.log(this.props.toggleSignUpModal);
content = (
<div className="sidebarLayout">
<SheetContent
Expand Down
12 changes: 8 additions & 4 deletions static/js/sheets/SheetContentSidebar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {FollowButton, InterfaceText, ProfilePic} from "../Misc";
import {FollowButton, InterfaceText} from "../Misc";
import {ProfilePic} from "../ProfilePic";
import Sefaria from "../sefaria/sefaria";
import React, {useEffect, useState} from "react";
import {ProfileBio} from "../UserProfile";
const SheetContentSidebar = ({authorImage, authorStatement, authorUrl, toggleSignUpModal, collections}) => {
console.log(toggleSignUpModal);
const [loading, setLoading] = useState(true);
const [profile, setProfile] = useState(null);
useEffect(() => {
Expand All @@ -21,12 +23,13 @@ const SheetContentSidebar = ({authorImage, authorStatement, authorUrl, toggleSig
name={authorStatement}
/>
{authorName}
{!loading && <SheetProfileInfo profile={profile}/>}
{!loading && <SheetProfileInfo profile={profile} toggleSignUpModal={toggleSignUpModal}/>}
{<PartOfCollections collections={collections}/>}
</div>;
}

const SheetProfileInfo = ({profile}) => {
const SheetProfileInfo = ({profile, toggleSignUpModal}) => {
console.log(toggleSignUpModal);
const profileFollowers = <div className="profileFollowers">
<InterfaceText>{String(profile.followers.length)}</InterfaceText>&nbsp;
<InterfaceText>followers</InterfaceText>
Expand All @@ -37,7 +40,8 @@ const SheetProfileInfo = ({profile}) => {
{Sefaria._uid !== profile.id && <FollowButton
large={true}
uid={profile.id}
following={Sefaria.following.indexOf(profile.id) > -1}/>
following={Sefaria.following.indexOf(profile.id) > -1}
toggleSignUpModal={toggleSignUpModal}/>
}
</span>;
}
Expand Down

0 comments on commit 07bc2b9

Please sign in to comment.