diff --git a/src/cssStyles.tsx b/src/cssStyles.tsx index b1ec07013..1392b59cf 100644 --- a/src/cssStyles.tsx +++ b/src/cssStyles.tsx @@ -1,7 +1,7 @@ /** * This file contains general css stylings */ -import { css, Global, keyframes } from "@emotion/react"; +import { css, Global } from "@emotion/react"; import React from "react"; import emotionNormalize from "emotion-normalize"; import { createTheme } from "@mui/material/styles"; @@ -405,13 +405,6 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ }, }); -export const spinningStyle = css({ - animation: `2s linear infinite none ${keyframes({ - "0%": { transform: "rotate(0)" }, - "100%": { transform: "rotate(360deg)" }, - })}`, -}); - export const customIconStyle = css(({ maxWidth: "16px", height: "auto", diff --git a/src/main/Save.tsx b/src/main/Save.tsx index 3518b5402..49582b51e 100644 --- a/src/main/Save.tsx +++ b/src/main/Save.tsx @@ -3,10 +3,10 @@ import React, { useEffect } from "react"; import { css } from "@emotion/react"; import { basicButtonStyle, backOrContinueStyle, ariaLive, errorBoxStyle, - navigationButtonStyle, spinningStyle, + navigationButtonStyle, } from "../cssStyles"; -import { LuLoader, LuCheckCircle, LuAlertCircle, LuChevronLeft, LuSave, LuCheck } from "react-icons/lu"; +import { LuCheckCircle, LuAlertCircle, LuChevronLeft, LuSave, LuCheck } from "react-icons/lu"; import { useAppDispatch, useAppSelector } from "../redux/store"; import { @@ -32,8 +32,8 @@ import { import { serializeSubtitle } from "../util/utilityFunctions"; import { useTheme } from "../themes"; import { ThemedTooltip } from "./Tooltip"; +import { Spinner } from "@opencast/appkit"; import { ProtoButton } from "@opencast/appkit"; -import { IconType } from "react-icons"; import { setEnd } from "../redux/endSlice"; /** @@ -102,11 +102,9 @@ const Save: React.FC = () => { * Button that sends a post request to save current changes */ export const SaveButton: React.FC<{ - basicIcon?: IconType text?: string isTransitionToEnd?: boolean }> = ({ - basicIcon = LuSave, text, isTransitionToEnd = false, }) => { @@ -123,22 +121,20 @@ export const SaveButton: React.FC<{ const theme = useTheme(); // Update based on current fetching status - let Icon = basicIcon; - let spin = false; let tooltip = null; - if (workflowStatus === "failed") { - Icon = LuAlertCircle; - spin = false; - tooltip = t("save.confirmButton-failed-tooltip"); - } else if (workflowStatus === "success") { - Icon = LuCheck; - spin = false; - tooltip = t("save.confirmButton-success-tooltip"); - } else if (workflowStatus === "loading") { - Icon = LuLoader; - spin = true; - tooltip = t("save.confirmButton-attempting-tooltip"); - } + const Icon = () => { + if (workflowStatus === "failed") { + tooltip = t("save.confirmButton-failed-tooltip"); + return ; + } else if (workflowStatus === "success") { + tooltip = t("save.confirmButton-success-tooltip"); + return ; + } else if (workflowStatus === "loading") { + tooltip = t("save.confirmButton-attempting-tooltip"); + return ; + } + ; + }; const ariaSaveUpdate = () => { if (workflowStatus === "success") { @@ -181,7 +177,7 @@ export const SaveButton: React.FC<{ onClick={save} css={[basicButtonStyle(theme), navigationButtonStyle(theme)]} > - + {Icon()} {text ?? t("save.confirm-button")}
{ariaSaveUpdate()}
diff --git a/src/main/Timeline.tsx b/src/main/Timeline.tsx index 5061e2925..bd4a19177 100644 --- a/src/main/Timeline.tsx +++ b/src/main/Timeline.tsx @@ -18,7 +18,7 @@ import { moveCut, } from "../redux/videoSlice"; -import { LuMenu, LuLoader } from "react-icons/lu"; +import { LuMenu } from "react-icons/lu"; import useResizeObserver from "use-resize-observer"; @@ -34,7 +34,7 @@ import { ThemedTooltip } from "./Tooltip"; import ScrollContainer from "react-indiana-drag-scroll"; import CuttingActionsContextMenu from "./CuttingActionsContextMenu"; import { useHotkeys } from "react-hotkeys-hook"; -import { spinningStyle } from "../cssStyles"; +import { Spinner } from "@opencast/appkit"; /** * A container for visualizing the cutting of the video, as well as for controlling @@ -664,7 +664,7 @@ export const Waveforms: React.FC<{ timelineHeight: number; }> = ({ timelineHeigh } else { return ( <> - +
{t("timeline.generateWaveform-text")}
); diff --git a/src/main/WorkflowConfiguration.tsx b/src/main/WorkflowConfiguration.tsx index f736c201d..ae8ef7f63 100644 --- a/src/main/WorkflowConfiguration.tsx +++ b/src/main/WorkflowConfiguration.tsx @@ -6,7 +6,7 @@ import { errorBoxStyle, } from "../cssStyles"; -import { LuChevronLeft, LuDatabase, LuMoreHorizontal } from "react-icons/lu"; +import { LuChevronLeft, LuMoreHorizontal } from "react-icons/lu"; import { useAppSelector } from "../redux/store"; @@ -45,7 +45,6 @@ const WorkflowConfiguration: React.FC = () => {