File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import { useMemo } from "react";
3
3
4
4
import { LANGUAGE_ID_TO_LABEL } from "../../feature/search/language" ;
5
5
import {
6
- birdWatchLinkFromNote ,
7
- postLinkFromNote ,
6
+ birdWatchLinkFromPostId ,
7
+ postLinkFromPostId ,
8
8
} from "../../feature/twitter/link-builder" ;
9
9
import type { SearchedNote } from "../../generated/api/schemas" ;
10
10
import { isNonEmptyString } from "../../utils/string" ;
@@ -66,7 +66,7 @@ export const Note = ({ note }: NoteProps) => {
66
66
< Button
67
67
color = "pink"
68
68
component = "a"
69
- href = { postLinkFromNote ( note ) }
69
+ href = { postLinkFromPostId ( note . postId ) }
70
70
size = "xs"
71
71
target = "_blank"
72
72
variant = "light"
@@ -76,7 +76,7 @@ export const Note = ({ note }: NoteProps) => {
76
76
< Button
77
77
color = "pink"
78
78
component = "a"
79
- href = { birdWatchLinkFromNote ( note ) }
79
+ href = { birdWatchLinkFromPostId ( note . postId ) }
80
80
size = "xs"
81
81
target = "_blank"
82
82
variant = "light"
Original file line number Diff line number Diff line change 1
- import type { Note } from "../../generated/api/schemas" ;
2
-
3
- export const birdWatchLinkFromNote = ( note : Note ) : string => {
4
- return `https://x.com/i/birdwatch/t/${ note . postId } ` ;
1
+ export const birdWatchLinkFromPostId = ( postId : string ) : string => {
2
+ return `https://x.com/i/birdwatch/t/${ postId } ` ;
5
3
} ;
6
4
7
- export const postLinkFromNote = ( note : Note ) : string => {
5
+ export const postLinkFromPostId = ( postId : string ) : string => {
8
6
// X redirects to correct post url regardless of userId, so just specify `i`
9
- return `https://x.com/i/status/${ note . postId } ` ;
7
+ return `https://x.com/i/status/${ postId } ` ;
10
8
} ;
You can’t perform that action at this time.
0 commit comments