refactor isStatusInOwnThread

This commit is contained in:
Nolan Lawson 2018-02-04 12:07:22 -08:00
parent 835a9a5b28
commit 4f89f6f7f1
3 changed files with 5 additions and 5 deletions

View file

@ -1,11 +1,11 @@
<article class="status-article {{originalStatus.visibility === 'direct' ? 'status-direct' : ''}} {{isStatusInContext ? 'status-in-context' : ''}}" <article class="status-article {{originalStatus.visibility === 'direct' ? 'status-direct' : ''}} {{isStatusInOwnThread ? 'status-in-own-thread' : ''}}"
tabindex="0" tabindex="0"
aria-posinset="{{index}}" aria-setsize="{{length}}" aria-posinset="{{index}}" aria-setsize="{{length}}"
on:recalculateHeight> on:recalculateHeight>
{{#if (notification && (notification.type === 'reblog' || notification.type === 'favourite')) || status.reblog}} {{#if (notification && (notification.type === 'reblog' || notification.type === 'favourite')) || status.reblog}}
<StatusHeader :notification :status /> <StatusHeader :notification :status />
{{/if}} {{/if}}
<StatusAuthor status="{{originalStatus}}" :isStatusInContext /> <StatusAuthor status="{{originalStatus}}" :isStatusInOwnThread />
<StatusSidebar status="{{originalStatus}}" /> <StatusSidebar status="{{originalStatus}}" />
{{#if originalStatus.spoiler_text}} {{#if originalStatus.spoiler_text}}
<StatusSpoiler status="{{originalStatus}}" :spoilerShown on:recalculateHeight /> <StatusSpoiler status="{{originalStatus}}" :spoilerShown on:recalculateHeight />
@ -73,7 +73,7 @@
originalStatus: (status) => status.reblog ? status.reblog : status, originalStatus: (status) => status.reblog ? status.reblog : status,
statusId: (originalStatus) => originalStatus.id, statusId: (originalStatus) => originalStatus.id,
hasMedia: (originalStatus) => originalStatus.media_attachments && originalStatus.media_attachments.length, hasMedia: (originalStatus) => originalStatus.media_attachments && originalStatus.media_attachments.length,
isStatusInContext: (timelineType, timelineValue, statusId) => timelineType === 'status' && timelineValue === statusId, isStatusInOwnThread: (timelineType, timelineValue, statusId) => timelineType === 'status' && timelineValue === statusId,
originalAccount: (originalStatus) => originalStatus.account, originalAccount: (originalStatus) => originalStatus.account,
spoilerShown: ($spoilersShown, $currentInstance, statusId) => $spoilersShown && $spoilersShown[$currentInstance] && $spoilersShown[$currentInstance][statusId] spoilerShown: ($spoilersShown, $currentInstance, statusId) => $spoilersShown && $spoilersShown[$currentInstance] && $spoilersShown[$currentInstance][statusId]
} }

View file

@ -5,7 +5,7 @@
<span class="status-author-handle"> <span class="status-author-handle">
{{'@' + status.account.acct}} {{'@' + status.account.acct}}
</span> </span>
{{#if isStatusInContext}} {{#if isStatusInOwnThread}}
<ExternalLink class="status-author-date" href="{{status.url}}" showIcon="true"> <ExternalLink class="status-author-date" href="{{status.url}}" showIcon="true">
<time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time> <time datetime={{createdAtDate}} title="{{relativeDate}}">{{relativeDate}}</time>
</ExternalLink> </ExternalLink>

View file

@ -11,7 +11,7 @@
font-size: 0.9em; font-size: 0.9em;
} }
.status-in-context .status-content { .status-in-own-thread .status-content {
font-size: 1.3em; font-size: 1.3em;
margin: 20px 10px 20px 5px; margin: 20px 10px 20px 5px;
} }