replaced window.location with NEXT_PUBLIC_APP_URL (#769)

* replaced window.location with process.env.NEXT_PUBLIC_APP_URL, removed empty classNames

* wip
This commit is contained in:
Peer Richelsen authored and GitHub committed 2021-09-24 09:03:28 -06:00
1 parent f709972f86
commit a8ec6e7060
9 files changed
+29 -18

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ export default function EditTeam(props: { team: Team | undefined | null; onClose
Back
</Button>
</div>
<div className="">
<div>
<div className="pb-5 pr-4 sm:pb-6">
<h3 className="text-lg font-bold leading-6 text-gray-900">{props.team?.name}</h3>
<div className="max-w-xl mt-2 text-sm text-gray-500">
+8 -5
View File
@@ -59,19 +59,20 @@ export default function TeamListItem(props: {
<div className="flex justify-between my-4">
<div className="flex">
<Avatar
size={9}
imageSrc={
props.team.logo
? props.team.logo
: "https://eu.ui-avatars.com/api/?background=fff&color=039be5&name=" +
encodeURIComponent(props.team.name || "")
}
displayName="Team Logo"
alt="Team Logo"
className="rounded-full w-9 h-9"
/>
<div className="inline-block ml-3">
<span className="text-sm font-bold text-neutral-700">{props.team.name}</span>
<span className="block -mt-1 text-xs text-gray-400">
{window.location.hostname}/{props.team.slug}
{process.env.NEXT_PUBLIC_APP_URL}/{props.team.slug}
</span>
</div>
</div>
@@ -100,7 +101,9 @@ export default function TeamListItem(props: {
<Tooltip content="Copy link">
<Button
onClick={() => {
navigator.clipboard.writeText(window.location.hostname + "/team/" + props.team.slug);
navigator.clipboard.writeText(
process.env.NEXT_PUBLIC_APP_URL + "/team/" + props.team.slug
);
showToast("Link copied!", "success");
}}
color="minimal"
@@ -124,8 +127,8 @@ export default function TeamListItem(props: {
Edit team
</Button>
</DropdownMenuItem>
<DropdownMenuItem className="">
<Link href={`/team/${props.team.slug}`} passHref={true}>
<DropdownMenuItem>
<Link href={`${process.env.NEXT_PUBLIC_APP_URL}/team/${props.team.slug}`} passHref={true}>
<a target="_blank">
<Button type="button" color="minimal" className="w-full" StartIcon={ExternalLinkIcon}>
{" "}