Add ShareBtn component and update SettingsOptionLayout

This commit is contained in:
n4ze3m
2024-03-09 18:43:39 +05:30
parent 3eabe10bde
commit 7ce79bb134
10 changed files with 526 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
import { cleanUrl } from "~libs/clean-url"
export const verifyPageShareURL = async (url: string) => {
const res = await fetch(`${cleanUrl(url)}/api/v1/ping`)
if (!res.ok) {
throw new Error("Unable to verify page share")
}
const data = await res.text()
return data === "pong"
}