Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sakerhetspolisen committed Mar 31, 2022
1 parent 01f1a8a commit e9dcad1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-share-on-social",
"description": "Native sharing using the Web Share API if supported, a beautiful fallback if not.",
"author": "Karl Sellergren",
"version": "1.0.6",
"version": "1.0.8",
"license": "MIT",
"repository": "sakerhetspolisen/react-share-on-social",
"module": "dist/react-share-on-social.esm.js",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from "react";

export default function Header({ shareData }) {
const rootDomainFromUri = (url: string) => {
return url.replace(/(https|http):\/\/(www.|)/g, "").replace(/\/.*/g, "");
};
let url = new URL(shareData.link);
let rootDomain = url.hostname.replace("www.", "");
return (
<header
style={{
Expand Down Expand Up @@ -41,6 +40,7 @@ export default function Header({ shareData }) {
<div>
<span
style={{
color: "rgba(0,0,0,1)",
fontSize: "1rem",
fontWeight: "bold",
overflow: "hidden",
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function Header({ shareData }) {
WebkitBoxOrient: "vertical",
}}
>
{rootDomainFromUri(shareData.link)}
{rootDomain}
</span>
</div>
</header>
Expand Down
14 changes: 7 additions & 7 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const windowOptions = {
width: 600,
};
const b = (o) => (o ? "yes" : "no");
export const windowFeatures = `popup=yes, noopener, scrollbars=${b(windowOptions.scrollbars)},resizable=${b(
windowOptions.resizable
)},status=${b(windowOptions.status)},location=${b(windowOptions.location)},toolbar=${b(
windowOptions.toolbar
)},menubar=${b(windowOptions.menubar)}, width=${windowOptions.width},height=${
windowOptions.height
},left=${windowOptions.left},top=${windowOptions.top}`;
export const windowFeatures = `popup=yes, noopener, scrollbars=${b(
windowOptions.scrollbars
)},resizable=${b(windowOptions.resizable)},status=${b(windowOptions.status)},location=${b(
windowOptions.location
)},toolbar=${b(windowOptions.toolbar)},menubar=${b(windowOptions.menubar)}, width=${
windowOptions.width
},height=${windowOptions.height},left=${windowOptions.left},top=${windowOptions.top}`;

0 comments on commit e9dcad1

Please sign in to comment.