Moves identicon svg to TS

This commit is contained in:
Josh Perez 2021-08-24 20:17:51 -04:00 committed by GitHub
parent 347f542ac0
commit e76f603233
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 111 additions and 129 deletions

View file

@ -0,0 +1,33 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
export type PropsType = {
backgroundColor: string;
content: string;
foregroundColor: string;
};
export function IdenticonSVG({
backgroundColor,
content,
foregroundColor,
}: PropsType): JSX.Element {
return (
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<circle cx="50" cy="50" r="40" fill={backgroundColor} />
<text
baselineShift="-8px"
fill={foregroundColor}
fontFamily="sans-serif"
fontSize="24px"
textAnchor="middle"
x="50"
y="50"
>
{content}
</text>
</svg>
);
}