Skip to content

Commit

Permalink
Fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Oct 16, 2024
1 parent 623036b commit 898d4c4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const Screen = ({
const { configVisible } = useControlsState();
const { toggleConfig } = useControlsDispatch();
const openConfig = useCallback(
(scrollTo) => {
(scrollTo?: keyof ConfigInfoPayload["configuration"]) => {
toggleConfig(true);
if (scrollTo)
setTimeout(() => {
Expand Down
5 changes: 0 additions & 5 deletions src/components/SidebarTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const SidebarTop = ({ api }: SidebarTopProps) => {
subHeadline: "Check the visual test addon to see the progress of your build.",
},
icon: <PassedIcon color={color.positive} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
duration: 8_000,
onClick: clickNotification,
});
Expand All @@ -116,7 +115,6 @@ export const SidebarTop = ({ api }: SidebarTopProps) => {
subHeadline: "Aborted by user.",
},
icon: <FailedIcon color={color.negative} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
duration: 8_000,
onClick: clickNotification,
});
Expand All @@ -142,7 +140,6 @@ export const SidebarTop = ({ api }: SidebarTopProps) => {
: "No visual changes detected",
},
icon: <PassedIcon color={color.positive} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
duration: 8_000,
onClick: clickNotification,
});
Expand All @@ -159,7 +156,6 @@ export const SidebarTop = ({ api }: SidebarTopProps) => {
subHeadline: "Check the Storybook process on the command line for more details.",
},
icon: <FailedIcon color={color.negative} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
onClick: clickNotification,
});
}
Expand All @@ -173,7 +169,6 @@ export const SidebarTop = ({ api }: SidebarTopProps) => {
"Your account has insufficient snapshots remaining to run this build. Visit your billing page to find out more.",
},
icon: <FailedIcon color={color.negative} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
onClick: clickNotification,
});
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Stack.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { CSSObject } from "@storybook/theming";
import { styled } from "@storybook/theming";

// @ts-expect-error TODO fix overload
export const Stack = styled.div<Pick<CSSObject, "alignItems" | "textAlign">>((props) => ({
display: "flex",
flexDirection: "column",
Expand Down
3 changes: 2 additions & 1 deletion src/components/design-system/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
forwardRef,
MutableRefObject,
ReactNode,
SyntheticEvent,
useCallback,
useEffect,
useRef,
Expand Down Expand Up @@ -405,7 +406,7 @@ export const Input = forwardRef<HTMLInputElement, ComponentProps<typeof PureInpu
({ type: startingType, startFocused, ...rest }, ref) => {
const [type, setType] = useState(startingType);
const togglePasswordType = useCallback(
(event) => {
(event: SyntheticEvent) => {
// Make sure this does not submit a form
event.preventDefault();
event.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion src/screens/VisualTests/VisualTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const VisualTestsWithoutSelectedBuildId = ({
} = buildInfo;

const clickNotification = useCallback(
({ onDismiss }) => {
({ onDismiss }: { onDismiss: () => void }) => {
onDismiss();
setOptions({ selectedPanel: PANEL_ID });
togglePanel(true);
Expand Down
3 changes: 1 addition & 2 deletions src/utils/useErrorNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function useErrorNotification() {

const { addNotification, setOptions, togglePanel } = api;
const clickNotification = useCallback(
({ onDismiss }) => {
({ onDismiss }: { onDismiss: () => void }) => {
onDismiss();
setOptions({ selectedPanel: PANEL_ID });
togglePanel(true);
Expand All @@ -27,7 +27,6 @@ export function useErrorNotification() {
subHeadline: err.toString(),
},
icon: <FailedIcon color={color.negative} />,
// @ts-expect-error `duration` and `onClick` require a newer version of Storybook
onClick: clickNotification,
});
},
Expand Down

0 comments on commit 898d4c4

Please sign in to comment.