lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
12 deletions
-
src/components/Button.tsx
-
src/components/MDX/ExpandableCallout.tsx
|
|
@ -8,7 +8,7 @@ import cn from 'classnames'; |
|
|
|
interface ButtonProps { |
|
|
|
children: React.ReactNode; |
|
|
|
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; |
|
|
|
active: boolean; |
|
|
|
active?: boolean; |
|
|
|
className?: string; |
|
|
|
style?: Record<string, string>; |
|
|
|
} |
|
|
@ -16,7 +16,7 @@ interface ButtonProps { |
|
|
|
export function Button({ |
|
|
|
children, |
|
|
|
onClick, |
|
|
|
active, |
|
|
|
active = false, |
|
|
|
className, |
|
|
|
style, |
|
|
|
}: ButtonProps) { |
|
|
@ -43,9 +43,4 @@ export function Button({ |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Button.defaultProps = { |
|
|
|
active: false, |
|
|
|
style: {}, |
|
|
|
}; |
|
|
|
|
|
|
|
export default Button; |
|
|
|
|
|
@ -52,7 +52,7 @@ const variantMap = { |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
function ExpandableCallout({children, type}: ExpandableCalloutProps) { |
|
|
|
function ExpandableCallout({children, type = 'note'}: ExpandableCalloutProps) { |
|
|
|
const contentRef = useRef<HTMLDivElement>(null); |
|
|
|
const variant = variantMap[type]; |
|
|
|
|
|
|
@ -78,8 +78,4 @@ function ExpandableCallout({children, type}: ExpandableCalloutProps) { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
ExpandableCallout.defaultProps = { |
|
|
|
type: 'note', |
|
|
|
}; |
|
|
|
|
|
|
|
export default ExpandableCallout; |
|
|
|