aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-04 18:14:41 +0800
committerGitHub <noreply@github.com>2020-08-04 18:14:41 +0800
commit6177e4fc237aedf62b7d6011f19f04d98c26da39 (patch)
treefe97f2ec93a81a83811f548707ac9825328c7b7e /Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
parentf84fc5e653d6d29add893b6d2573d04c91fd1d40 (diff)
parent09b7e1f737659d0ee75e5ac2fd5c1decf8fa15a6 (diff)
downloadtimeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.tar.gz
timeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.tar.bz2
timeline-6177e4fc237aedf62b7d6011f19f04d98c26da39.zip
Merge pull request #132 from crupest/refactor
Refactor a lot of things.
Diffstat (limited to 'Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx')
-rw-r--r--Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
index dc5bfda8..42171e13 100644
--- a/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
+++ b/Timeline/ClientApp/src/app/timeline/TimelinePageTemplateUI.tsx
@@ -12,7 +12,7 @@ import { getAlertHost } from '../common/alert-service';
import { useEventEmiiter, UiLogicError } from '../common';
import {
TimelineInfo,
- TimelinePostListState,
+ TimelinePostsWithSyncState,
timelineService,
} from '../data/timeline';
import { userService } from '../data/user';
@@ -24,8 +24,10 @@ import Timeline, {
import AppBar from '../common/AppBar';
import TimelinePostEdit, { TimelinePostSendCallback } from './TimelinePostEdit';
+type TimelinePostSyncState = 'syncing' | 'synced' | 'offline';
+
const TimelinePostSyncStateBadge: React.FC<{
- state: 'syncing' | 'synced' | 'offline';
+ state: TimelinePostSyncState;
style?: CSSProperties;
className?: string;
}> = ({ state, style, className }) => {
@@ -84,7 +86,7 @@ export interface TimelineCardComponentProps<TManageItems> {
export interface TimelinePageTemplateUIProps<TManageItems> {
avatarKey?: string | number;
timeline?: TimelineInfo;
- postListState?: TimelinePostListState;
+ postListState?: TimelinePostsWithSyncState;
CardComponent: React.ComponentType<TimelineCardComponentProps<TManageItems>>;
onMember: () => void;
onManage?: (item: TManageItems | 'property') => void;
@@ -197,7 +199,7 @@ export default function TimelinePageTemplateUI<TManageItems>(
} else {
if (timeline != null) {
let timelineBody: React.ReactElement;
- if (postListState != null && postListState.state !== 'loading') {
+ if (postListState != null) {
if (postListState.state === 'forbid') {
timelineBody = (
<p className="text-danger">{t('timeline.messageCantSee')}</p>