Skip to content

Commit

Permalink
Merge pull request #679 from thematters/update/remove-fallback-cover
Browse files Browse the repository at this point in the history
Hide `<AddCover>` if the draft hasn't image assets
  • Loading branch information
robertu7 authored Feb 7, 2020
2 parents cf0b93a + a347677 commit 36eef31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/views/Me/DraftDetail/Sidebar/AddCover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ const AddCover = ({ draft }: { draft: AddCoverDraft }) => {
'u-area-disable': isPending || isPublished
})

if (imageAssets.length <= 0) {
return null
}

return (
<Collapsable
title={<Translate zh_hans="封面" zh_hant="封面" />}
Expand All @@ -101,7 +105,7 @@ const AddCover = ({ draft }: { draft: AddCoverDraft }) => {
<p className="cover-intro">
<Translate
zh_hant="選擇一張圖片作為封面"
zh_hans="选择一張圖片作為封面"
zh_hans="选择一张图片作为封面"
/>
</p>

Expand Down

0 comments on commit 36eef31

Please sign in to comment.