-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2726 from laogou717/4.70版本-Heo主题封面比例、动画更改
4.70版本 heo主题封面比例、动画更改
- Loading branch information
Showing
2 changed files
with
30 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import LazyImage from '@/components/LazyImage' | ||
|
||
/** | ||
* notion的图标icon | ||
* 可能是emoji 可能是 svg 也可能是 图片 | ||
* @returns | ||
*/ | ||
const NotionIcon = ({ icon, className = 'w-8 h-8 my-auto inline mr-1' }) => { | ||
if (!icon) { | ||
return <></> | ||
} | ||
|
||
if (icon.startsWith('http') || icon.startsWith('data:')) { | ||
// 这里优先使用传入的 className | ||
return <LazyImage src={icon} className={className} /> | ||
} | ||
|
||
// 对于 emoji 或 svg,设置默认 className,也可以传递不同的样式 | ||
return <span className={`inline-block ${className}`}>{icon}</span> | ||
} | ||
|
||
export default NotionIcon |