Skip to content

Commit af4cabc

Browse files
committed
Fix small items from review
1 parent 8ab0dfa commit af4cabc

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

apps/docs/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"extends": ["../../.eslintrc.json", "next", "next/core-web-vitals"],
33
"ignorePatterns": [".next/**/*"],
44
"rules": {
5-
"@next/next/no-html-link-for-pages": ["error", "apps/docs/pages"]
5+
"@next/next/no-html-link-for-pages": ["error", "pages"]
66
}
77
}

apps/docs/components/card/index.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
import cn from 'clsx';
22
import Link from 'next/link';
3-
import React from 'react';
3+
import type {
4+
CSSProperties,
5+
HTMLAttributes,
6+
PropsWithChildren,
7+
ReactNode,
8+
} from 'react';
49

510
import styles from './style.module.css';
611

12+
type CardProps = PropsWithChildren<
13+
HTMLAttributes<HTMLAnchorElement> & {
14+
title: ReactNode;
15+
icon?: ReactNode;
16+
image?: boolean;
17+
arrow?: boolean;
18+
href: string;
19+
}
20+
>;
21+
722
export function Card({
823
children,
924
title,
1025
icon,
1126
image,
1227
arrow,
13-
demo,
1428
href,
1529
...props
16-
}) {
30+
}: CardProps) {
1731
const animatedArrow = arrow ? (
1832
<span
1933
className={cn(
@@ -81,16 +95,26 @@ export function Card({
8195
);
8296
}
8397

84-
export function Cards({ children, num, ...props }) {
98+
type CardsProps = PropsWithChildren<
99+
HTMLAttributes<HTMLDivElement> & {
100+
num?: number;
101+
}
102+
>;
103+
104+
type CardsStyle = CSSProperties & {
105+
'--rows': number;
106+
};
107+
108+
export function Cards({ children, num, ...props }: CardsProps) {
85109
return (
86110
<div
87111
className={cn(styles.cards, 'mt-4 gap-4')}
88112
{...props}
89113
style={
90114
{
91-
'--rows': num || 3,
115+
'--rows': num ?? 3,
92116
...props.style,
93-
} as any
117+
} as CardsStyle
94118
}
95119
>
96120
{children}

apps/docs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"jsx": "preserve",
55
"baseUrl": ".",
6-
"moduleResolution": "bundler",
6+
"moduleResolution": "node",
77
"allowJs": true,
88
"esModuleInterop": true,
99
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)