Skip to content

Commit

Permalink
Merge pull request #384 from AppQuality/reduce-unguess-intern-icon-size
Browse files Browse the repository at this point in the history
feat: added new component for internal avatar
  • Loading branch information
iacopolea authored Jun 10, 2024
2 parents ce4430a + fb2add3 commit 8110ab4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/stories/avatar/InternalAvatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styled from "styled-components";
import LogoIcon from "../../assets/logo-icon.svg";

const StyledInternalAvatar = styled.div`
display: flex;
align-items: center;
justify-content: center;
`;

const InternalAvatar = () => {
return (
<StyledInternalAvatar>
<img alt="avatar" src={LogoIcon} />
</StyledInternalAvatar>
);
};

export default InternalAvatar;
4 changes: 2 additions & 2 deletions src/stories/avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Avatar as ZendeskAvatar } from "@zendeskgarden/react-avatars";
import { theme } from "../theme";
import styled from "styled-components";
import { AvatarArgs } from "./_types";
import LogoIcon from "../../assets/logo-icon.svg";
import { getColor } from "../theme/utils";
import InternalAvatar from "./InternalAvatar";

const UgAvatar = styled(ZendeskAvatar)<AvatarArgs>`
text-transform: uppercase;
Expand Down Expand Up @@ -35,7 +35,7 @@ const Avatar = ({ isSystem, badge, ...props }: AvatarArgs) => {
if (type === "image")
return <img alt="avatar" src={props.children as string} />;
if (type === "text") return <Avatar.Text>{props.children}</Avatar.Text>;
if (type === "system") return <img alt="avatar" src={LogoIcon} />;
if (type === "system") return <InternalAvatar />;
};

return (
Expand Down

0 comments on commit 8110ab4

Please sign in to comment.