Merge pull request #2672 from calcom/main

v1.5.4
This commit is contained in:
Omar López authored and GitHub committed 2022-05-09 14:56:23 -06:00
1 parent 7399d6421e
commit ed808c3be6
244 files changed
+7237 -3128

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
function getAnchor(text) {
return text
.toLowerCase()
.replace(/[^a-z0-9 ]/g, "")
.replace(/[ ]/g, "-")
.replace(/ /g, "%20");
}
export default function Anchor({ as, children }) {
const anchor = getAnchor(children);
const link = `#${anchor}`;
const Component = as || "div";
return (
<Component id={anchor}>
<a href={link} className="anchor-link">
§
</a>
{children}
</Component>
);
}