We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 633b239 commit 14fc030Copy full SHA for 14fc030
src/components/common/UserProfile.tsx
@@ -138,6 +138,10 @@ export interface UserProfileProps {
138
username: string;
139
}
140
141
+function includeProtocol(address: string) {
142
+ return /^https?:\/\//.test(address) ? address : `https://${address}`;
143
+}
144
+
145
const UserProfile: React.FC<UserProfileProps> = ({
146
className,
147
style,
@@ -211,7 +215,7 @@ const UserProfile: React.FC<UserProfileProps> = ({
211
215
)}
212
216
{url && (
213
217
<a
214
- href={url}
218
+ href={includeProtocol(url)}
219
target="_blank"
220
rel="noopener noreferrer"
221
data-testid="facebook"
0 commit comments