Commit 45da714 1 parent 57b04ed commit 45da714 Copy full SHA for 45da714
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,17 @@ export const SpeakersDetails = ({ session }: { session: Session }) => {
14
14
if ( ! showChild ) {
15
15
return null
16
16
}
17
+
18
+ const getTwitterUsername = ( url : string ) => {
19
+ if ( url . includes ( 'twitter.com/' ) ) {
20
+ return url . split ( 'twitter.com/' ) [ 1 ]
21
+ }
22
+ if ( url . includes ( 'x.com/' ) ) {
23
+ return url . split ( 'x.com/' ) [ 1 ]
24
+ }
25
+ return null
26
+ }
27
+
17
28
return (
18
29
< div className = "w-full flex-wrap lg:w-4/12 flex border-r-0 pr-0 lg:pr-4 mb-6 md:mb-0" >
19
30
< div className = "w-full py-4" >
@@ -63,7 +74,7 @@ export const SpeakersDetails = ({ session }: { session: Session }) => {
63
74
>
64
75
@
65
76
{ speaker . twitter
66
- ? speaker . twitter . split ( 'twitter.com/' ) [ 1 ]
77
+ ? getTwitterUsername ( speaker . twitter )
67
78
: speaker . name }
68
79
</ a >
69
80
</ a >
You can’t perform that action at this time.
0 commit comments