aboutsummaryrefslogtreecommitdiff
path: root/src/components/GithubAvatar
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-05-04 12:52:25 +0300
committereug-vs <eugene@eug-vs.xyz>2022-05-04 12:52:25 +0300
commitf35c1cf5480f7506442ac4c9170c5e0a1a4a8b15 (patch)
tree94fa0fa38e8a90df08933c05910bea6bed461291 /src/components/GithubAvatar
parent8dc803f882f31430abb600fba250fdcf3334d9bf (diff)
downloadchrono-cube-ui-f35c1cf5480f7506442ac4c9170c5e0a1a4a8b15.tar.gz
feat: remove material UI and useless functionality
Diffstat (limited to 'src/components/GithubAvatar')
-rw-r--r--src/components/GithubAvatar/GithubAvatar.tsx39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/components/GithubAvatar/GithubAvatar.tsx b/src/components/GithubAvatar/GithubAvatar.tsx
deleted file mode 100644
index 32ac553..0000000
--- a/src/components/GithubAvatar/GithubAvatar.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import React from 'react';
-
-import {
- Avatar,
- Link,
-} from '@material-ui/core';
-
-interface PropTypes {
- username: string;
-}
-
-const githubUrl = 'https://github.com/';
-const getUserGithubUrl = (username: string): string => githubUrl + username;
-
-const GithubAvatar: React.FC<PropTypes> = ({ username }) => {
- if (username === 'anonymous') return <Avatar/>;
-
- const userGithubUrl = getUserGithubUrl(username);
- const avatarUrl = userGithubUrl + '.png';
- const usernameTokens = username.split(/[ ,.\-_#@;]/g);
- const altText = (
- (usernameTokens.length > 1)?
- (usernameTokens[0][0] + usernameTokens[1][0])
- :
- usernameTokens[0][0]
- ).toUpperCase()
-
- return (
- <Link href={userGithubUrl}>
- <Avatar>
- <img src={avatarUrl} alt={altText} />
- </Avatar>
- </Link>
- )
-};
-
-export { getUserGithubUrl };
-export default GithubAvatar;
-