Skip to content

Commit

Permalink
remove unused styled util function
Browse files Browse the repository at this point in the history
  • Loading branch information
phlmn committed Jan 9, 2025
1 parent 779f026 commit 456589c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions frontend/src/styled.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import clsx, { ClassValue } from 'clsx';
import { ComponentType, createElement, forwardRef, ReactHTML } from 'react';

export function withClassname<P extends { className?: string }>(
Component: ComponentType<P>,
classValue: ClassValue,
) {
const C = forwardRef((props: JSX.IntrinsicAttributes & P, ref) => {
return <Component {...props} className={clsx(classValue, props.className)} ref={ref} />;
});

C.displayName = (Component.displayName || 'Anonymous') + 'WithClassname';
return C;
}
import { createElement, forwardRef, ReactHTML } from 'react';

export function primitiveWithClassname<T extends keyof ReactHTML>(type: T, classValue: ClassValue) {
const C = forwardRef((props: JSX.IntrinsicElements[T], ref) => {
Expand Down

0 comments on commit 456589c

Please sign in to comment.