Last active
February 18, 2025 02:17
-
-
Save hellokaton/62e21a86c9ee4c36ce97f7e0ebfe58ac to your computer and use it in GitHub Desktop.
Revisions
-
hellokaton revised this gist
Feb 18, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { forwardRef } from "react"; export type ShareButtonProps = ButtonProps; // 创建新的Button组件,继承原有功能 export const Button = forwardRef<HTMLButtonElement, ShareButtonProps>( ({ className, ...props }, ref) => ( <BaseButton ref={ref} -
hellokaton revised this gist
Feb 18, 2025 . 1 changed file with 16 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,22 @@ import { Button as BaseButton, type ButtonProps } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { forwardRef } from "react"; // 扩展原有的ButtonProps类型 export type ShareButtonProps = ButtonProps; // 创建新的Button组件,继承原有功能 export const Button = forwardRef<HTMLButtonElement, ButtonProps>( ({ className, ...props }, ref) => ( <BaseButton ref={ref} className={cn( // 添加默认阴影效果 "shadow-lg shadow-black/10 hover:shadow-xl hover:shadow-black/20 transition-shadow duration-200", className )} {...props} /> ) ); Button.displayName = "ShareButton"; -
hellokaton created this gist
Feb 18, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ import { Button as BaseButton, type ButtonProps, } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import * as React from "react"; // 扩展原有的ButtonProps类型 export type ShareButtonProps = ButtonProps // 创建新的Button组件,继承原有功能 const Button = React.forwardRef<HTMLButtonElement, ShareButtonProps>( ({ className, ...props }, ref) => { return ( <BaseButton ref={ref} className={cn( // 添加默认阴影效果 "shadow-lg shadow-black/10 hover:shadow-xl hover:shadow-black/20 transition-shadow duration-200", className )} {...props} /> ); } ); Button.displayName = "ShareButton"; export { Button }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ import React from 'react' import {Button} from "@/components/share/button"; export const Usage = () => { return ( <div> <Button>Hello World</Button> </div> ) }