-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
92 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { sveltify } from '@svelte-preprocess-react'; | ||
import { Divider as ADivider, type GetProps } from 'antd'; | ||
|
||
export const Divider = sveltify<GetProps<typeof ADivider>, ['children']>( | ||
({ ...props }) => { | ||
return <ADivider {...props} />; | ||
} | ||
); | ||
export const Divider = sveltify<GetProps<typeof ADivider>>(({ ...props }) => { | ||
return <ADivider {...props} />; | ||
}); | ||
|
||
export default Divider; |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
import { sveltify } from '@svelte-preprocess-react'; | ||
import { ReactSlot } from '@svelte-preprocess-react/react-slot'; | ||
import React from 'react'; | ||
import { useTargets } from '@utils/hooks/useTargets'; | ||
import { type GetProps, Tag as ATag } from 'antd'; | ||
|
||
export const Tag = sveltify<GetProps<typeof ATag>, ['closeIcon', 'icon']>( | ||
({ slots, ...props }) => { | ||
return ( | ||
<ATag | ||
{...props} | ||
icon={slots.icon ? <ReactSlot slot={slots.icon} /> : props.icon} | ||
closeIcon={ | ||
slots.closeIcon ? ( | ||
<ReactSlot slot={slots.closeIcon} /> | ||
) : ( | ||
props.closeIcon | ||
) | ||
} | ||
/> | ||
); | ||
} | ||
); | ||
export const Tag = sveltify< | ||
GetProps<typeof ATag> & { | ||
value?: string; | ||
}, | ||
['closeIcon', 'icon'] | ||
>(({ slots, value, children, ...props }) => { | ||
const targets = useTargets(children); | ||
return ( | ||
<ATag | ||
{...props} | ||
icon={slots.icon ? <ReactSlot slot={slots.icon} /> : props.icon} | ||
closeIcon={ | ||
slots.closeIcon ? <ReactSlot slot={slots.closeIcon} /> : props.closeIcon | ||
} | ||
> | ||
{targets.length > 0 ? ( | ||
children | ||
) : ( | ||
<> | ||
{children} | ||
{value} | ||
</> | ||
)} | ||
</ATag> | ||
); | ||
}); | ||
|
||
export default Tag; |
This file contains 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 characters