style: removed static 'app.plane.so' (#813)

This commit is contained in:
Dakshesh Jain 2023-04-13 18:28:23 +05:30 committed by GitHub
parent 657241c9c1
commit 6de94efc7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View File

@ -124,7 +124,9 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
<div className="flex flex-col items-start justify-center gap-2.5">
<span>Workspace URL</span>
<div className="flex w-full items-center rounded-md border border-gray-300 px-3">
<span className="text-sm text-slate-600">https://app.plane.so/</span>
<span className="text-sm text-slate-600">
{typeof window !== "undefined" && window.location.origin}/
</span>
<Input
mode="trueTransparent"
autoComplete="off"
@ -135,7 +137,9 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
required: "Workspace URL is required",
}}
onChange={(e) =>
/^[a-zA-Z0-9_-]+$/.test(e.target.value) ? setInvalidSlug(false) : setInvalidSlug(true)
/^[a-zA-Z0-9_-]+$/.test(e.target.value)
? setInvalidSlug(false)
: setInvalidSlug(true)
}
/>
</div>

View File

@ -238,13 +238,20 @@ const WorkspaceSettings: NextPage = () => {
register={register}
error={errors.name}
className="w-full"
value={`app.plane.so/${activeWorkspace.slug}`}
value={`${
typeof window !== "undefined" &&
window.location.origin.replace("http://", "").replace("https://", "")
}/${activeWorkspace.slug}`}
disabled
/>
<SecondaryButton
className="h-min"
onClick={() =>
copyTextToClipboard(`https://app.plane.so/${activeWorkspace.slug}`).then(() => {
copyTextToClipboard(
`${typeof window !== "undefined" && window.location.origin}/${
activeWorkspace.slug
}`
).then(() => {
setToastAlert({
type: "success",
title: "Link Copied!",