pinafore/src/routes/_components/profile/AccountProfilePage.html

65 lines
2.1 KiB
HTML

{#if $isUserLoggedIn}
<TimelinePage {timeline} >
<DynamicPageBanner title="" ariaTitle="Profile page for {accountName}"/>
{#if $currentAccountProfile && $currentVerifyCredentials}
<AccountProfile account={$currentAccountProfile}
relationship={$currentAccountRelationship}
verifyCredentials={$currentVerifyCredentials}
{filter}
/>
{/if}
{#if !filter}
<PinnedStatuses {accountId} />
{/if}
</TimelinePage>
{:else}
<HiddenFromSSR>
<FreeTextLayout>
<h1>Profile</h1>
<p>A user timeline will appear here when logged in.</p>
</FreeTextLayout>
</HiddenFromSSR>
{/if}
<script>
import TimelinePage from '../TimelinePage.html'
import FreeTextLayout from '../FreeTextLayout.html'
import { store } from '../../_store/store.js'
import HiddenFromSSR from '../HiddenFromSSR'
import DynamicPageBanner from '../DynamicPageBanner.html'
import { updateProfileAndRelationship, clearProfileAndRelationship } from '../../_actions/accounts'
import AccountProfile from './AccountProfile.html'
import PinnedStatuses from '../timeline/PinnedStatuses.html'
export default {
oncreate () {
let { accountId } = this.get()
clearProfileAndRelationship()
updateProfileAndRelationship(accountId)
},
store: () => store,
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct)) || ''
},
shortProfileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.username)) || ''
},
accountName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ($currentAccountProfile.display_name || $currentAccountProfile.username)) || ''
},
timeline: ({ accountId, filter }) => (
`account/${accountId}` + (filter ? `/${filter}` : '')
)
},
components: {
TimelinePage,
FreeTextLayout,
HiddenFromSSR,
DynamicPageBanner,
AccountProfile,
PinnedStatuses
}
}
</script>