Skip to content

Commit a472a37

Browse files
committed
fix(UI-1394): adjust toast
1 parent ad030b4 commit a472a37

File tree

2 files changed

+15
-31
lines changed

2 files changed

+15
-31
lines changed

src/components/organisms/topbar/project/manualRun/manualRunButtons.tsx

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ export const ManualRunButtons = () => {
2323
const { fetchDeployments } = useCacheStore();
2424
const [savingManualRun, setSavingManualRun] = useState(false);
2525

26-
const { activeDeploymentStore, entrypointFunction, isManualRunEnabled, saveProjectManualRun } = useManualRunStore(
27-
(state) => ({
28-
activeDeploymentStore: state.projectManualRun[projectId!]?.activeDeployment,
29-
entrypointFunction: state.projectManualRun[projectId!]?.entrypointFunction,
30-
isManualRunEnabled: state.projectManualRun[projectId!]?.isManualRunEnabled,
31-
saveProjectManualRun: state.saveAndExecuteManualRun,
32-
})
33-
);
26+
const { entrypointFunction, isManualRunEnabled, saveProjectManualRun } = useManualRunStore((state) => ({
27+
activeDeploymentStore: state.projectManualRun[projectId!]?.activeDeployment,
28+
entrypointFunction: state.projectManualRun[projectId!]?.entrypointFunction,
29+
isManualRunEnabled: state.projectManualRun[projectId!]?.isManualRunEnabled,
30+
saveProjectManualRun: state.saveAndExecuteManualRun,
31+
}));
3432

3533
const openManualRunSettings = useCallback(() => {
3634
openDrawer(DrawerName.projectManualRunSettings);
@@ -54,13 +52,7 @@ export const ManualRunButtons = () => {
5452
return;
5553
}
5654
addToast({
57-
message: (
58-
<ManualRunSuccessToastMessage
59-
deploymentId={activeDeploymentStore?.deploymentId}
60-
projectId={projectId}
61-
sessionId={sessionId}
62-
/>
63-
),
55+
message: <ManualRunSuccessToastMessage projectId={projectId} sessionId={sessionId} />,
6456
type: "success",
6557
position: "top-right",
6658
offset: 35,
@@ -85,30 +77,30 @@ export const ManualRunButtons = () => {
8577
<div className="relative flex h-8 gap-1.5 self-center rounded-3xl border border-gray-750 p-1 transition hover:border-white">
8678
<Button
8779
ariaLabel={t("ariaSettingsRun")}
88-
className="group h-full whitespace-nowrap p-1 hover:bg-gray-1050 active:bg-black"
80+
className="h-full p-1 group whitespace-nowrap hover:bg-gray-1050 active:bg-black"
8981
disabled={!isManualRunEnabled}
9082
onClick={openManualRunSettings}
9183
title={t("ariaSettingsRun")}
9284
variant="light"
9385
>
9486
<IconSvg
95-
className="stroke-white transition group-hover:stroke-green-200 group-active:stroke-green-800"
87+
className="transition stroke-white group-hover:stroke-green-200 group-active:stroke-green-800"
9688
src={GearIcon}
9789
/>
9890
</Button>
9991

100-
<div className="w-px bg-gray-750 transition" />
92+
<div className="w-px transition bg-gray-750" />
10193

10294
<Button
10395
ariaLabel={t("manual")}
104-
className="group h-full gap-2 whitespace-nowrap hover:bg-gray-1050 active:bg-black"
96+
className="h-full gap-2 group whitespace-nowrap hover:bg-gray-1050 active:bg-black"
10597
disabled={isRunDisabled}
10698
id="tourManualRunButton"
10799
onClick={startManualRun}
108100
variant="light"
109101
>
110102
<IconSvg
111-
className="stroke-white transition group-hover:stroke-green-200 group-active:stroke-green-800"
103+
className="transition stroke-white group-hover:stroke-green-200 group-active:stroke-green-800"
112104
src={!savingManualRun ? RunIcon : Spinner}
113105
/>
114106

src/components/organisms/topbar/project/manualRun/manualRunSuccessToastMessage.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,15 @@ import { useNavigate } from "react-router-dom";
55

66
import { FileArrowRightIcon } from "@assets/image/icons";
77

8-
export const ManualRunSuccessToastMessage = ({
9-
deploymentId,
10-
projectId,
11-
sessionId,
12-
}: {
13-
deploymentId?: string;
14-
projectId?: string;
15-
sessionId?: string;
16-
}) => {
8+
export const ManualRunSuccessToastMessage = ({ projectId, sessionId }: { projectId?: string; sessionId?: string }) => {
179
const { t } = useTranslation("deployments", { keyPrefix: "history.manualRun" });
1810
const navigate = useNavigate();
1911

2012
return (
2113
<button
2214
aria-label={t("executionSucceed")}
23-
className="cursor-pointer px-4 py-3"
24-
onClick={() => navigate(`/projects/${projectId}/deployments/${deploymentId}/sessions/${sessionId}`)}
15+
className="px-4 py-3 cursor-pointer"
16+
onClick={() => navigate(`/projects/${projectId}/sessions/${sessionId}`)}
2517
>
2618
<div className="flex flex-col">
2719
<span className="font-semibold text-green-800">{t("executionSucceed")}</span>

0 commit comments

Comments
 (0)