Skip to content

Commit

Permalink
fix: add types to Avatar component
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmak2 committed Nov 22, 2022
1 parent cfdb255 commit f12ea9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions admin/src/components/AdminAvatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { AdminAvatarWrapper, AdminShield } from "./styles";
import {Shield} from "@strapi/icons";
// @ts-ignore
import {Icon} from "@strapi/design-system/Icon";
import { ToBeFixed } from "../../../../types";

const AdminAvatar = ({ children }: ToBeFixed ) => {
const AdminAvatar: React.FC<React.PropsWithChildren<{}>> = ({ children } ) => {
return (
<AdminAvatarWrapper>
<AdminShield>
Expand Down
14 changes: 8 additions & 6 deletions admin/src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ import { Avatar, Initials } from "@strapi/design-system/Avatar";
import { renderInitials } from "../../utils";
import { IntlContext } from "react-intl";
import AdminAvatar from "../AdminAvatar";
import { ToBeFixed } from "../../../../types";

const UserAvatar = ({ avatar, name, isAdminComment }) => {
interface IProps {
avatar: string | ToBeFixed;
name: string;
isAdminComment?: boolean;
};

const UserAvatar = ({ avatar, name, isAdminComment = false }) => {
if (avatar) {
let image = avatar;
if (isObject(avatar)) {
Expand All @@ -31,9 +38,4 @@ const UserAvatar = ({ avatar, name, isAdminComment }) => {
)
};

UserAvatar.propTypes = {
avatar: PropTypes.oneOfType(PropTypes.string, PropTypes.object).isRequired,
name: PropTypes.string,
};

export default UserAvatar;
1 change: 0 additions & 1 deletion server/services/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export = ({ strapi }: StrapiContext): IServiceClient => ({
`You're not allowed to take an action on that entity. Make sure that comment exist or you've authenticated your request properly.`
);
} catch (e) {
console.log(e);
throw e;
}
},
Expand Down

0 comments on commit f12ea9c

Please sign in to comment.