Skip to content
Open
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
11 changes: 6 additions & 5 deletions apps/admin-x-design-system/src/global/button-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ const ButtonGroup: React.FC<ButtonGroupProps> = ({size = 'md', buttons, link, li

return (
<div className={groupColorClasses}>
{buttons.map(({key, ...props}) => {
{buttons.map(({key, ...props}, index) => {
const buttonKey = key ?? `button-${index}`;
const buttonProps = {...props};

if (!link && !clearBg) {
buttonProps.className = clsx(props.className, 'w-8 rounded-lg border !px-0');

if (key === activeKey) {
if (buttonKey === activeKey) {
buttonProps.color = 'white';
buttonProps.className = clsx(buttonProps.className, 'border-grey-300 shadow-xs dark:border-grey-800');
} else {
Expand All @@ -55,10 +56,10 @@ const ButtonGroup: React.FC<ButtonGroupProps> = ({size = 'md', buttons, link, li

return (
(props.tooltip ?
<Tooltip key={key} content={props.tooltip}>
<Button key={`btn-${key}`} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
<Tooltip key={buttonKey} content={props.tooltip}>
<Button link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
</Tooltip> :
<Button key={key} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
<Button key={buttonKey} link={link} linkWithPadding={linkWithPadding} size={size} {...buttonProps} />
)
);
})}
Expand Down
4 changes: 2 additions & 2 deletions apps/admin-x-design-system/src/global/form/checkbox-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const CheckboxGroup: React.FC<CheckboxGroupProps> = ({
<div>
{title && <Heading grey={true} level={6}>{title}</Heading>}
<div className='mt-2 flex flex-col gap-1'>
{checkboxes?.map(({key, ...props}) => (
<Checkbox key={key} {...props} />
{checkboxes?.map(({key, ...props}, index) => (
<Checkbox key={key ?? `checkbox-${index}`} {...props} />
))}
</div>
<div className={`flex flex-col ${hint && 'mb-2'}`}>
Expand Down
4 changes: 2 additions & 2 deletions apps/admin-x-design-system/src/global/tab-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const TabList: React.FC<TabListProps> = ({
<TabsPrimitive.List className={`${stickyHeader ? 'sticky top-0 z-50 bg-white dark:bg-black' : ''}`}>
<div className={containerClasses} role='tablist'>
{tabs.map(tab => (
<div>
<div key={tab.id}>
<TabButton
border={buttonBorder}
counter={tab.counter}
Expand Down Expand Up @@ -162,7 +162,7 @@ function TabView<ID extends string = string>({
/>
{tabs.map((tab) => {
return (
<TabsPrimitive.Content className={tab.tabWrapperClassName} value={tab.id}>
<TabsPrimitive.Content key={tab.id} className={tab.tabWrapperClassName} value={tab.id}>
<div className={tab.containerClassName}>{tab.contents}</div>
</TabsPrimitive.Content>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-x-design-system/src/global/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Tooltip: React.FC<TooltipProps> = ({content, size = 'sm', children, contai
return (
<TooltipPrimitive.Provider delayDuration={0}>
<TooltipPrimitive.Root>
<TooltipPrimitive.Trigger className={containerClassName} onClick={event => event.preventDefault()}>
<TooltipPrimitive.Trigger className={containerClassName} asChild onClick={event => event.preventDefault()}>
{children}
</TooltipPrimitive.Trigger>
<TooltipPrimitive.Content align={origin} className={tooltipClassName} sideOffset={4} onPointerDownOutside={event => event.preventDefault()}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ const NewsletterItemContainer: React.FC<Partial<SortableItemContainerProps>> = (
isDragging,
style,
children,
separator,
...props
}) => {
void separator; // we don't use the separator prop and it will error if it gets passed to the DragIndicator component

const {updateRoute} = useRouting();

const showDetails = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const TiersList: React.FC<TiersListProps> = ({
return (
<div className='mt-4 grid grid-cols-1 gap-4 min-[900px]:grid-cols-3'>
{tiers.map((tier) => {
return <TierCard tier={tier} />;
return <TierCard key={tier.id} tier={tier} />;
})}
{tab === 'active-tiers' && (
<button className={`${cardContainerClasses} group cursor-pointer`} type='button' onClick={() => {
Expand Down
Loading