Skip to content

Commit 0353afa

Browse files
committed
fix timeline settings
1 parent bc6e001 commit 0353afa

2 files changed

Lines changed: 30 additions & 20 deletions

File tree

app/src/components/TimelineSettings.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface InnerProps {
3232
}
3333

3434
const Inner = (props: InnerProps) => {
35+
const { client } = useClient()
3536
const { getImageURL } = useMediaProxy()
3637
const timeline = use(props.timelinePromise)
3738

@@ -41,6 +42,8 @@ const Inner = (props: InnerProps) => {
4142
return <>Timeline not found.</>
4243
}
4344

45+
const isMe = client.ccid === timeline.author
46+
4447
return (
4548
<div
4649
style={{
@@ -87,16 +90,18 @@ const Inner = (props: InnerProps) => {
8790
>
8891
<Text>Subscriptions</Text>
8992
</Tab>
90-
<Tab
91-
selected={tab === 'settings'}
92-
onClick={() => setTab('settings')}
93-
groupId="timeline-settings"
94-
style={{
95-
color: CssVar.contentText
96-
}}
97-
>
98-
<Text>Settings</Text>
99-
</Tab>
93+
{isMe && (
94+
<Tab
95+
selected={tab === 'settings'}
96+
onClick={() => setTab('settings')}
97+
groupId="timeline-settings"
98+
style={{
99+
color: CssVar.contentText
100+
}}
101+
>
102+
<Text>Settings</Text>
103+
</Tab>
104+
)}
100105
</Tabs>
101106
<div
102107
style={{

web/src/components/TimelineSettings.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface InnerProps {
3232
}
3333

3434
const Inner = (props: InnerProps) => {
35+
const { client } = useClient()
3536
const { getImageURL } = useMediaProxy()
3637
const timeline = use(props.timelinePromise)
3738

@@ -41,6 +42,8 @@ const Inner = (props: InnerProps) => {
4142
return <>Timeline not found.</>
4243
}
4344

45+
const isMe = client.ccid === timeline.author
46+
4447
return (
4548
<div
4649
style={{
@@ -87,16 +90,18 @@ const Inner = (props: InnerProps) => {
8790
>
8891
<Text>Subscriptions</Text>
8992
</Tab>
90-
<Tab
91-
selected={tab === 'settings'}
92-
onClick={() => setTab('settings')}
93-
groupId="timeline-settings"
94-
style={{
95-
color: CssVar.contentText
96-
}}
97-
>
98-
<Text>Settings</Text>
99-
</Tab>
93+
{isMe && (
94+
<Tab
95+
selected={tab === 'settings'}
96+
onClick={() => setTab('settings')}
97+
groupId="timeline-settings"
98+
style={{
99+
color: CssVar.contentText
100+
}}
101+
>
102+
<Text>Settings</Text>
103+
</Tab>
104+
)}
100105
</Tabs>
101106
<div
102107
style={{

0 commit comments

Comments
 (0)