move move frontend to progress-test
This commit is contained in:
27
app/javascript/components/UserAvatar/UserAvatar.tsx
Normal file
27
app/javascript/components/UserAvatar/UserAvatar.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React, {FC} from "react";
|
||||
import {User} from "../../__generated__/graphql-schema";
|
||||
import BoringAvatar from "boring-avatars";
|
||||
|
||||
type Props = {
|
||||
user: User
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const UserAvatar: FC<Props> = ({user, className}) => {
|
||||
return (
|
||||
<div className={`rounded-full border-2 border-primary-light shadow ${className || ''}`}>
|
||||
{user.avatarUrl ?
|
||||
<img
|
||||
src={`${process.env.REACT_APP_BACKEND_URL}/${user.avatarUrl}`}
|
||||
alt={`Avatar do usuário ${user.name}`}
|
||||
/>
|
||||
: <BoringAvatar
|
||||
size={"100%"}
|
||||
name={user.name}
|
||||
variant="pixel"
|
||||
colors={["#595F72", "#575D90", "#84A07C", "#C3D350", "#E6F14A"]}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
1
app/javascript/components/UserAvatar/index.ts
Normal file
1
app/javascript/components/UserAvatar/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { UserAvatar } from "./UserAvatar";
|
||||
Reference in New Issue
Block a user