File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 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> = ({
176176
177177 const velogUrl = `/@${ username } /posts` ;
178178
179+ const getSocialId = ( link : string ) => link . split ( '/' ) . reverse ( ) [ 0 ] ;
180+
179181 return (
180182 < UserProfileBlock className = { className } style = { style } >
181183 < Section >
@@ -201,7 +203,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
201203 < ProfileIcons >
202204 { github && (
203205 < a
204- href = { `https://github.com/${ github } ` }
206+ href = { `https://github.com/${ getSocialId ( github ) } ` }
205207 target = "_blank"
206208 rel = "noopener noreferrer"
207209 data-testid = "github"
@@ -211,7 +213,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
211213 ) }
212214 { twitter && (
213215 < a
214- href = { `https://twitter.com/${ twitter } ` }
216+ href = { `https://twitter.com/${ getSocialId ( twitter ) } ` }
215217 target = "_blank"
216218 rel = "noopener noreferrer"
217219 data-testid = "twitter"
@@ -221,7 +223,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
221223 ) }
222224 { facebook && (
223225 < a
224- href = { `https://facebook.com/${ facebook } ` }
226+ href = { `https://facebook.com/${ getSocialId ( facebook ) } ` }
225227 target = "_blank"
226228 rel = "noopener noreferrer"
227229 data-testid = "facebook"
You can’t perform that action at this time.
0 commit comments