Skip to content

[dashboard] Unify animated spinner for both light and dark themes #5792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dashboard/src/icons/Spinner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion components/dashboard/src/icons/SpinnerDark.svg

This file was deleted.

5 changes: 2 additions & 3 deletions components/dashboard/src/projects/ConfigureProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { getGitpodService } from "../service/service";
import { getCurrentTeam, TeamsContext } from "../teams/teams-context";
import Header from "../components/Header";
import Spinner from "../icons/Spinner.svg";
import SpinnerDark from "../icons/SpinnerDark.svg";
import PrebuildLogsEmpty from "../images/prebuild-logs-empty.svg";
import PrebuildLogsEmptyDark from "../images/prebuild-logs-empty-dark.svg";
import { ThemeContext } from "../theme-context";
Expand Down Expand Up @@ -163,7 +162,7 @@ export default function () {
<MonacoEditor classes="w-full flex-grow" disabled={isEditorDisabled} language="dockerfile" value={dockerfile} onChange={setDockerfile} />}
</Suspense>
{isDetecting && <div className="absolute h-full w-full bg-gray-100 dark:bg-gray-700 flex items-center justify-center space-x-2">
<img className="h-5 w-5 animate-spin" src={isDark ? SpinnerDark : Spinner} />
<img className="h-5 w-5 animate-spin" src={Spinner} />
<span className="font-semibold text-gray-400">Detecting project configuration ...</span>
</div>}
</div>
Expand All @@ -177,7 +176,7 @@ export default function () {
</div>)
}</div>
<div className="h-20 px-6 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-600 flex space-x-2">
{prebuildWasTriggered && <PrebuildInstanceStatus prebuildInstance={prebuildInstance} isDark={isDark} />}
{prebuildWasTriggered && <PrebuildInstanceStatus prebuildInstance={prebuildInstance} />}
<div className="flex-grow" />
{(prebuildInstance?.status.phase === "stopped" && !prebuildInstance?.status.conditions.failed)
? <a className="my-auto" href={`/#${project?.cloneUrl}`}><button className="secondary">New Workspace</button></a>
Expand Down
4 changes: 1 addition & 3 deletions components/dashboard/src/projects/Prebuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Header from "../components/Header";
import PrebuildLogs from "../components/PrebuildLogs";
import { getGitpodService, gitpodHostUrl } from "../service/service";
import { TeamsContext, getCurrentTeam } from "../teams/teams-context";
import { ThemeContext } from "../theme-context";
import { PrebuildInstanceStatus } from "./Prebuilds";
import { shortCommitMessage } from "./render-utils";

Expand All @@ -28,7 +27,6 @@ export default function () {

const [ prebuild, setPrebuild ] = useState<PrebuildWithStatus | undefined>();
const [ prebuildInstance, setPrebuildInstance ] = useState<WorkspaceInstance | undefined>();
const { isDark } = useContext(ThemeContext);

useEffect(() => {
if (!teams || !projectName || !prebuildId) {
Expand Down Expand Up @@ -88,7 +86,7 @@ export default function () {
<PrebuildLogs workspaceId={prebuild?.info?.buildWorkspaceId} onInstanceUpdate={onInstanceUpdate} />
</div>
<div className="h-20 px-6 bg-gray-50 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-600 flex space-x-2">
{prebuildInstance && <PrebuildInstanceStatus prebuildInstance={prebuildInstance} isDark={isDark} />}
{prebuildInstance && <PrebuildInstanceStatus prebuildInstance={prebuildInstance} />}
<div className="flex-grow" />
{prebuildInstance?.status.phase === "stopped"
? <a className="my-auto" href={gitpodHostUrl.withContext(`${prebuild?.info.changeUrl}`).toString()}><button>New Workspace</button></a>
Expand Down
7 changes: 3 additions & 4 deletions components/dashboard/src/projects/Prebuilds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Header from "../components/Header";
import DropDown, { DropDownEntry } from "../components/DropDown";
import { ItemsList, Item, ItemField, ItemFieldContextMenu } from "../components/ItemsList";
import Spinner from "../icons/Spinner.svg";
import SpinnerDark from "../icons/SpinnerDark.svg";
import StatusDone from "../icons/StatusDone.svg";
import StatusFailed from "../icons/StatusFailed.svg";
import StatusPaused from "../icons/StatusPaused.svg";
Expand Down Expand Up @@ -233,7 +232,7 @@ export function prebuildStatusIcon(status: PrebuiltWorkspaceState | undefined) {
}
}

export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInstance, isDark?: boolean }) {
export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInstance }) {
let status = <></>;
let details = <></>;
switch (props.prebuildInstance?.status.phase) {
Expand All @@ -244,7 +243,7 @@ export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInst
<span>PENDING</span>
</div>;
details = <div className="flex space-x-1 items-center text-gray-400">
<img className="h-4 w-4 animate-spin" src={props.isDark ? SpinnerDark : Spinner} />
<img className="h-4 w-4 animate-spin" src={Spinner} />
<span>Prebuild in progress ...</span>
</div>;
break;
Expand All @@ -259,7 +258,7 @@ export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInst
<span>RUNNING</span>
</div>;
details = <div className="flex space-x-1 items-center text-gray-400">
<img className="h-4 w-4 animate-spin" src={props.isDark ? SpinnerDark : Spinner} />
<img className="h-4 w-4 animate-spin" src={Spinner} />
<span>Prebuild in progress ...</span>
</div>;
break;
Expand Down