Skip to content

Commit

Permalink
refactor(style.css and robot-context): 🎉 update context flow and upda…
Browse files Browse the repository at this point in the history
…te style.css
  • Loading branch information
gokhangunduz committed Aug 31, 2023
1 parent 22b21bd commit 10b9951
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 43 deletions.
47 changes: 4 additions & 43 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -841,14 +841,14 @@ video {
margin: 0px;
}

.m-64 {
margin: 16rem;
}

.m-2 {
margin: 0.5rem;
}

.m-64 {
margin: 16rem;
}

.mx-auto {
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -878,10 +878,6 @@ video {
margin-left: -0.375rem;
}

.-mt-4 {
margin-top: -1rem;
}

.-mt-5 {
margin-top: -1.25rem;
}
Expand Down Expand Up @@ -930,10 +926,6 @@ video {
margin-top: 2.5rem;
}

.mt-2 {
margin-top: 0.5rem;
}

.mt-3 {
margin-top: 0.75rem;
}
Expand Down Expand Up @@ -1020,10 +1012,6 @@ video {
height: 3rem;
}

.h-14 {
height: 3.5rem;
}

.h-16 {
height: 4rem;
}
Expand Down Expand Up @@ -1080,10 +1068,6 @@ video {
height: 1.5rem;
}

.h-64 {
height: 16rem;
}

.h-7 {
height: 1.75rem;
}
Expand Down Expand Up @@ -1677,10 +1661,6 @@ video {
gap: 2.25rem;
}

.gap-y-10 {
row-gap: 2.5rem;
}

.overflow-auto {
overflow: auto;
}
Expand Down Expand Up @@ -1923,16 +1903,6 @@ video {
border-color: rgb(12 160 235 / var(--tw-border-opacity));
}

.border-primary {
--tw-border-opacity: 1;
border-color: rgb(172 45 254 / var(--tw-border-opacity));
}

.border-red-500 {
--tw-border-opacity: 1;
border-color: rgb(239 68 68 / var(--tw-border-opacity));
}

.border-yellow-500 {
--tw-border-opacity: 1;
border-color: rgb(234 179 8 / var(--tw-border-opacity));
Expand Down Expand Up @@ -2201,11 +2171,6 @@ video {
padding-right: 0.625rem;
}

.px-20 {
padding-left: 5rem;
padding-right: 5rem;
}

.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
Expand Down Expand Up @@ -3477,10 +3442,6 @@ td {
grid-template-columns: repeat(12, minmax(0, 1fr));
}

.lg\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lg\:p-6 {
padding: 1.5rem;
}
Expand Down
30 changes: 30 additions & 0 deletions src/contexts/RobotContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export default ({ children }: any) => {
const url = useParams();
const [isSettedCookie, setIsSettedCookie] = useState<boolean | null>(null);

const [isRobotReady, setIsRobotReady] = useState<boolean>(false);

// Main Functions
useEffect(() => {
if (
pagesState?.organization?.organizationName !==
Expand Down Expand Up @@ -116,6 +119,32 @@ export default ({ children }: any) => {
responseBuildManager,
responseLaunchManagers,
]);
// Main Functions

// isRobotReady
useEffect(() => {
if (
responseRobot?.robotClusters?.filter(
(robot: any) => robot?.robotStatus !== "EnvironmentReady"
)?.length ||
responseBuildManager?.robotClusters?.filter(
(robot: any) => robot?.buildManagerStatus !== "Ready"
)?.length ||
responseLaunchManagers
?.map((launchStep: any) => {
return launchStep?.robotClusters;
})
.flat()
?.map((cluster: any) => {
return cluster?.launchManagerStatus;
})
?.filter((status: any) => status !== "Running")?.length
) {
return setIsRobotReady(false);
}
return setIsRobotReady(true);
}, [responseRobot, responseBuildManager, responseLaunchManagers]);
// isRobotReady

function handleGetOrganization() {
getOrganization(
Expand Down Expand Up @@ -304,6 +333,7 @@ export default ({ children }: any) => {
responseRobot,
responseBuildManager,
responseLaunchManagers,
isRobotReady,
ros,
setRos,
topicList,
Expand Down

0 comments on commit 10b9951

Please sign in to comment.