Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(component): Add displayNames for syntax highlighter, resolving #70 #73

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/Avatar/AvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export type AvatarGroupProps = PropsWithChildren<{
children: ReactNode;
}>;

export const AvatarGroup: React.FC<AvatarGroupProps> = ({ children }) => {
const AvatarGroup: React.FC<AvatarGroupProps> = ({ children }) => {
return <div className="mb-5 flex -space-x-4">{children}</div>;
};

AvatarGroup.displayName = 'Avatar.Group';
export default AvatarGroup;
5 changes: 4 additions & 1 deletion src/components/Avatar/AvatarGroupCounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type AvatarGroupdCounterProps = PropsWithChildren<{
href: string;
}>;

export const AvatarGroupCounter: React.FC<AvatarGroupdCounterProps> = ({ total, href }) => {
const AvatarGroupCounter: React.FC<AvatarGroupdCounterProps> = ({ total, href }) => {
return (
<a
className="relative flex h-10 w-10 items-center justify-center rounded-full bg-gray-700 text-xs font-medium text-white ring-2 ring-gray-300 hover:bg-gray-600 dark:ring-gray-500 "
Expand All @@ -15,3 +15,6 @@ export const AvatarGroupCounter: React.FC<AvatarGroupdCounterProps> = ({ total,
</a>
);
};

AvatarGroupCounter.displayName = 'Avatar.GroupCounter';
export default AvatarGroupCounter;
5 changes: 3 additions & 2 deletions src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import { FC, PropsWithChildren } from 'react';
import { AvatarGroup } from './AvatarGroup';
import { AvatarGroupCounter } from './AvatarGroupCounter';
import AvatarGroup from './AvatarGroup';
import AvatarGroupCounter from './AvatarGroupCounter';

export type AvatarProps = PropsWithChildren<{
alt?: string;
Expand Down Expand Up @@ -99,6 +99,7 @@ const AvatarComponent: FC<AvatarProps> = ({
);
};

AvatarComponent.displayName = 'Avatar';
export const Avatar = Object.assign(AvatarComponent, {
Group: AvatarGroup,
Counter: AvatarGroupCounter,
Expand Down
5 changes: 4 additions & 1 deletion src/components/Button/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type ButtonGroupProps = PropsWithChildren<{
outline?: boolean;
}>;

export const ButtonGroup: FC<ButtonGroupProps> = ({ children, pill, outline }) => {
const ButtonGroup: FC<ButtonGroupProps> = ({ children, pill, outline }) => {
const items = useMemo(
() =>
Children.map(children as ReactElement<ButtonComponentProps>[], (child, index) =>
Expand All @@ -31,3 +31,6 @@ export const ButtonGroup: FC<ButtonGroupProps> = ({ children, pill, outline }) =
</div>
);
};

ButtonGroup.displayName = 'Button.Group';
export default ButtonGroup;
3 changes: 2 additions & 1 deletion src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ComponentProps, FC, ReactNode } from 'react';
import classNames from 'classnames';
import { ButtonGroup } from './ButtonGroup';
import ButtonGroup from './ButtonGroup';

type Color = 'blue' | 'alternative' | 'dark' | 'light' | 'green' | 'red' | 'yellow' | 'purple';
type GradientMonochrome = 'blue' | 'green' | 'cyan' | 'teal' | 'lime' | 'red' | 'pink' | 'purple';
Expand Down Expand Up @@ -152,6 +152,7 @@ const ButtonComponent: FC<ButtonComponentProps> = ({
</button>
);

ButtonComponent.displayName = 'Button';
export const Button = Object.assign(ButtonComponent, {
Group: ButtonGroup,
});