Skip to content

Commit

Permalink
fix: only show write something block if its your activity page
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 30, 2024
1 parent 433e7e4 commit ef44c93
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/activity/AccountActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
useGetReactionActivities,
useGetTweetActivities,
} from 'src/graphql/hooks'
import { useIsMyAddress } from '../auth/MyAccountsContext'
import WriteSomething from '../posts/WriteSomething'
import { Loading } from '../utils'
import { createLoadMorePosts, FeedActivities } from './FeedActivities'
Expand Down Expand Up @@ -119,6 +120,7 @@ const activityTabs = [
type ActivityTab = (typeof activityTabs)[number]
const getTab = (tab: ActivityTab) => tab
const OffchainAccountActivity = ({ address }: ActivitiesByAddressProps) => {
const isMyAddress = useIsMyAddress(address)
const getActivityCounts = useGetActivityCounts()
const router = useRouter()
const [activeTab, setActiveTab] = useState<ActivityTab>('posts')
Expand Down Expand Up @@ -173,10 +175,14 @@ const OffchainAccountActivity = ({ address }: ActivitiesByAddressProps) => {
return (
<Tabs activeKey={activeTab} onChange={onChangeTab}>
<TabPane tab={getTabTitle('Posts', postsCount)} key={getTab('posts')}>
<div className='d-flex flex-column mt-3'>
<WriteSomething />
{isMyAddress ? (
<div className='d-flex flex-column mt-3'>
<WriteSomething />
<PostActivities address={address} totalCount={postsCount} />
</div>
) : (
<PostActivities address={address} totalCount={postsCount} />
</div>
)}
</TabPane>
{(tweetsCount > 0 || haveDisplayedTweetsTab) && (
<TabPane tab={getTabTitle('Tweets', tweetsCount)} key={getTab('tweets')}>
Expand Down

0 comments on commit ef44c93

Please sign in to comment.