feat: add avatar/bio/links/names/pronouns to user page
This commit is contained in:
parent
412d720abc
commit
862a64840e
16 changed files with 650 additions and 90 deletions
16
Foxnouns.Frontend/app/components/KeyedIcon.tsx
Normal file
16
Foxnouns.Frontend/app/components/KeyedIcon.tsx
Normal file
|
@ -0,0 +1,16 @@
|
|||
import * as icons from "react-bootstrap-icons";
|
||||
import { IconProps as BaseIconProps } from "react-bootstrap-icons";
|
||||
import { pascalCase } from "change-case";
|
||||
|
||||
const startsWithNumberRegex = /^\d/;
|
||||
|
||||
export default function Icon({ iconName, ...props }: BaseIconProps & { iconName: string }) {
|
||||
let icon = pascalCase(iconName);
|
||||
if (startsWithNumberRegex.test(icon)) {
|
||||
icon = `Icon${icon}`;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/namespace
|
||||
const BootstrapIcon = icons[icon as keyof typeof icons];
|
||||
return <BootstrapIcon {...props} />;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue