File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ const UserProfile: React.FC<UserProfileProps> = ({
176
176
177
177
const velogUrl = `/@${ username } /posts` ;
178
178
179
+ const getSocialId = ( link : string ) => link . split ( '/' ) . reverse ( ) [ 0 ] ;
180
+
179
181
return (
180
182
< UserProfileBlock className = { className } style = { style } >
181
183
< Section >
@@ -201,7 +203,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
201
203
< ProfileIcons >
202
204
{ github && (
203
205
< a
204
- href = { `https://github.com/${ github } ` }
206
+ href = { `https://github.com/${ getSocialId ( github ) } ` }
205
207
target = "_blank"
206
208
rel = "noopener noreferrer"
207
209
data-testid = "github"
@@ -211,7 +213,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
211
213
) }
212
214
{ twitter && (
213
215
< a
214
- href = { `https://twitter.com/${ twitter } ` }
216
+ href = { `https://twitter.com/${ getSocialId ( twitter ) } ` }
215
217
target = "_blank"
216
218
rel = "noopener noreferrer"
217
219
data-testid = "twitter"
@@ -221,7 +223,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
221
223
) }
222
224
{ facebook && (
223
225
< a
224
- href = { `https://facebook.com/${ facebook } ` }
226
+ href = { `https://facebook.com/${ getSocialId ( facebook ) } ` }
225
227
target = "_blank"
226
228
rel = "noopener noreferrer"
227
229
data-testid = "facebook"
You can’t perform that action at this time.
0 commit comments