File tree Expand file tree Collapse file tree 2 files changed +27
-22
lines changed Expand file tree Collapse file tree 2 files changed +27
-22
lines changed Original file line number Diff line number Diff line change 7
7
postLinkFromNote ,
8
8
} from "../../feature/twitter/link-builder" ;
9
9
import type { SearchedNote } from "../../generated/api/schemas" ;
10
+ import { isNonEmptyString } from "../../utils/string" ;
10
11
import { Post } from "../post/Post" ;
11
12
import { NoteStatus } from "./NoteStatus" ;
12
13
import { NoteTopic } from "./NoteTopics" ;
@@ -60,28 +61,30 @@ export const Note = ({ note }: NoteProps) => {
60
61
</ div >
61
62
</ Stack >
62
63
< Post post = { note . post } />
63
- < Group justify = "flex-end" >
64
- < Button
65
- color = "pink"
66
- component = "a"
67
- href = { postLinkFromNote ( note ) }
68
- size = "xs"
69
- target = "_blank"
70
- variant = "light"
71
- >
72
- ポストを見る
73
- </ Button >
74
- < Button
75
- color = "pink"
76
- component = "a"
77
- href = { birdWatchLinkFromNote ( note ) }
78
- size = "xs"
79
- target = "_blank"
80
- variant = "light"
81
- >
82
- このポストについたノートを見る
83
- </ Button >
84
- </ Group >
64
+ { isNonEmptyString ( note . postId ) && (
65
+ < Group justify = "flex-end" >
66
+ < Button
67
+ color = "pink"
68
+ component = "a"
69
+ href = { postLinkFromNote ( note ) }
70
+ size = "xs"
71
+ target = "_blank"
72
+ variant = "light"
73
+ >
74
+ ポストを見る
75
+ </ Button >
76
+ < Button
77
+ color = "pink"
78
+ component = "a"
79
+ href = { birdWatchLinkFromNote ( note ) }
80
+ size = "xs"
81
+ target = "_blank"
82
+ variant = "light"
83
+ >
84
+ このポストについたノートを見る
85
+ </ Button >
86
+ </ Group >
87
+ ) }
85
88
</ Stack >
86
89
</ Card >
87
90
) ;
Original file line number Diff line number Diff line change
1
+ export const isNonEmptyString = ( value ?: unknown ) : value is string =>
2
+ typeof value === "string" && value !== "" ;
You can’t perform that action at this time.
0 commit comments