style: tweak environment switch (#3102)

This commit is contained in:
Dhruwang Jariwala
2024-09-05 15:59:59 +05:30
committed by GitHub
parent 954c435404
commit 86bf2accc9
3 changed files with 7 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ export const EnvironmentSwitch = ({ environment, environments }: EnvironmentSwit
<Label
htmlFor="development-mode"
className={cn("hover:cursor-pointer", isEnvSwitchChecked && "text-orange-800")}>
Test mode
Dev Env
</Label>
<Switch
className="focus:ring-orange-800 data-[state=checked]:bg-orange-800"

View File

@@ -36,6 +36,7 @@ export const TopControlBar = ({
environments={environments}
isFormbricksCloud={IS_FORMBRICKS_CLOUD}
membershipRole={membershipRole}
currentProductChannel={currentProductChannel}
/>
</div>
</div>

View File

@@ -6,6 +6,7 @@ import { useRouter } from "next/navigation";
import formbricks from "@formbricks/js/app";
import { TEnvironment } from "@formbricks/types/environment";
import { TMembershipRole } from "@formbricks/types/memberships";
import { TProductConfigChannel } from "@formbricks/types/product";
import { Button } from "@formbricks/ui/Button";
interface TopControlButtonsProps {
@@ -13,6 +14,7 @@ interface TopControlButtonsProps {
environments: TEnvironment[];
isFormbricksCloud: boolean;
membershipRole?: TMembershipRole;
currentProductChannel: TProductConfigChannel;
}
export const TopControlButtons = ({
@@ -20,11 +22,13 @@ export const TopControlButtons = ({
environments,
isFormbricksCloud,
membershipRole,
currentProductChannel,
}: TopControlButtonsProps) => {
const router = useRouter();
const showEnvironmentSwitch = currentProductChannel !== "link";
return (
<div className="z-50 flex items-center space-x-2">
<EnvironmentSwitch environment={environment} environments={environments} />
{showEnvironmentSwitch && <EnvironmentSwitch environment={environment} environments={environments} />}
{isFormbricksCloud && (
<Button
variant="minimal"