Skip to content

Commit

Permalink
Remove wrong controller theme context
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura authored and tarrencev committed Jan 6, 2025
1 parent 0d915d8 commit deff0bf
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/keychain/.storybook/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ function ControllerThemeProvider({
theme = defaultTheme,
}: PropsWithChildren<{ theme?: ControllerTheme }>) {
useThemeEffect({ theme, assetUrl: "" });
const chakraTheme = useChakraTheme(theme);
const chakraTheme = useChakraTheme({ ...theme, verified: false });

return (
<ControllerThemeContext.Provider value={theme}>
<ControllerThemeContext.Provider value={{ ...theme, verified: false }}>
<ChakraProvider theme={chakraTheme}>{children}</ChakraProvider>
</ControllerThemeContext.Provider>
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion packages/keychain/src/context/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ControllerTheme } from "@cartridge/presets";
import { createContext } from "react";

export type VerifiableControllerTheme = ControllerTheme & {
verified: boolean;
};

export const ControllerThemeContext = createContext<
ControllerTheme | undefined
VerifiableControllerTheme | undefined
>(undefined);
2 changes: 1 addition & 1 deletion packages/keychain/src/hooks/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
ControllerTheme,
} from "@cartridge/presets";
import { ParsedSessionPolicies, parseSessionPolicies } from "./session";
import { VerifiableControllerTheme } from "./theme";
import { VerifiableControllerTheme } from "@/context/theme";

type ParentMethods = AsyncMethodReturns<{ close: () => Promise<void> }>;

Expand Down
16 changes: 6 additions & 10 deletions packages/keychain/src/hooks/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { ControllerColor, ControllerTheme } from "@cartridge/presets";
import {
ControllerThemeContext,
VerifiableControllerTheme,
} from "@/context/theme";
import { ControllerColor } from "@cartridge/presets";
import { CartridgeTheme } from "@cartridge/ui";
import { useContext, createContext, useMemo } from "react";

export type VerifiableControllerTheme = ControllerTheme & {
verified: boolean;
};

export const ControllerThemeContext = createContext<
VerifiableControllerTheme | undefined
>(undefined);
import { useContext, useMemo } from "react";

export function useControllerTheme() {
const ctx = useContext<VerifiableControllerTheme | undefined>(
Expand Down

0 comments on commit deff0bf

Please sign in to comment.