Web: People: Profile: Added isAdmin and isSelf property`s

This commit is contained in:
Ilya Oleshko 2019-07-25 17:11:35 +03:00
parent 84c3e35254
commit 96cb6d5841

View File

@ -21,7 +21,7 @@ const Profile = (props) => {
const [isArticlePinned, setIsArticlePinned] = useState(false);
useEffect(() => {
if (userId === "@self") {
if (userId === "@self" || userId === auth.user.userName) {
setProfile(auth.user);
setLoaded(true);
} else {
@ -84,7 +84,7 @@ const Profile = (props) => {
<SectionHeaderContent profile={profile} />
</NPL.SectionHeader>
<NPL.SectionBody>
<SectionBodyContent profile={profile} />
<SectionBodyContent profile={profile} isAdmin={auth.user.isAdmin || auth.user.isOwner} isSelf={userId === "@self" || userId === auth.user.userName} />
</NPL.SectionBody>
<NPL.SectionToggler visible={!isArticlePinned} onClick={onShowArticle} />
</NPL.Section>