import { PrivyProvider } from "@privy-io/react-auth"
import cssText from "data-text:~/contents/style.css"
import type {
PlasmoCSConfig,
PlasmoCSUIAnchor,
PlasmoGetInlineAnchor
} from "plasmo"
import { PRIVY_APP_ID } from "../constants/env"
export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText
return style
}
export const config: PlasmoCSConfig = {
matches: ["https://x.com/*"]
}
export const getInlineAnchor: PlasmoGetInlineAnchor = async () =>
document.querySelector(`body`)
// Use this to optimize unmount lookups
export const getShadowHostId = ({ element }) => `shadow-host-inline-modal`
export default function InlineModal({ anchor }: { anchor?: PlasmoCSUIAnchor }) {
console.log(PRIVY_APP_ID)
return (
<PrivyProvider appId={PRIVY_APP_ID}>hello world</PrivyProvider>
)
}
import { PrivyProvider } from "@privy-io/react-auth"
import cssText from "data-text:~/contents/style.css"
import type {
PlasmoCSConfig,
PlasmoCSUIAnchor,
PlasmoGetInlineAnchor
} from "plasmo"
import { PRIVY_APP_ID } from "../constants/env"
export const getStyle = () => {
const style = document.createElement("style")
style.textContent = cssText
return style
}
export const config: PlasmoCSConfig = {
matches: ["https://x.com/*"]
}
export const getInlineAnchor: PlasmoGetInlineAnchor = async () =>
document.querySelector(`body`)
// Use this to optimize unmount lookups
export const getShadowHostId = ({ element }) => `shadow-host-inline-modal`
export default function InlineModal({ anchor }: { anchor?: PlasmoCSUIAnchor }) {
console.log(PRIVY_APP_ID)
return (
<PrivyProvider appId={PRIVY_APP_ID}>hello world</PrivyProvider>
)
}