Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Tauffer-Consulting/domino in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
vinicvaz committed May 21, 2024
2 parents ba82d27 + 2229795 commit 33efa67
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 30 deletions.
24 changes: 4 additions & 20 deletions frontend/src/context/storage/useStorage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React, {
type ReactNode,
createContext,
useCallback,
useContext,
} from "react";
import { createCustomContext } from "@utils/createCustomContext.function";
import React, { type ReactNode, useCallback } from "react";

import { stringifyOrKepOriginal, tryParseJSON } from "./utils/parseJson";

Expand All @@ -14,20 +10,8 @@ interface IStorageContext {
clear: () => void;
}

const defaultStorageState = {
getItem: (_k: string) => null,
setItem: (_k: string, _v: string | object) => {},
removeItem: (_k: string) => {},
clear: () => {},
};

const StorageContext = createContext<IStorageContext>(defaultStorageState);

export function useStorage(): IStorageContext {
const context = useContext(StorageContext);

return context;
}
export const [StorageContext, useStorage] =
createCustomContext<IStorageContext>("Storage Context");

export const StorageProvider: React.FC<{ children?: ReactNode }> = ({
children,
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/context/theme/theme.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ export const darkTheme = createTheme({
defaultProps: {
color: "secondary",
},
styleOverrides: {
root: ({ ownerState }) => ({
...(ownerState.variant === "outlined" &&
ownerState.color === "secondary" && {
color: "#00B140",
borderColor: "#00B140",
}),
...(ownerState.variant === "outlined" &&
ownerState.color === "primary" && {
color: "#283D52",
borderColor: "#283D52",
}),
}),
},
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const ResultsReport: React.FC = () => {
navigate(-1);
}}
variant="text"
color="primary"
>
<Typography component="span">{`< Go back to ${workflow?.name} Detail`}</Typography>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ResultsReportSkeleton: React.FC = () => {
navigate(-1);
}}
variant="text"
color="primary"
>
<Typography component="span">{`< Go back to Detail`}</Typography>
</Button>
Expand Down
23 changes: 13 additions & 10 deletions frontend/src/providers/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ import "react-toastify/dist/ReactToastify.css";
import { AppRoutes } from "../routes";

export const App: FC = () => (
<ColorModeProvider>
<QueryClientProvider client={queryClient}>
<ReactQueryDevtools initialIsOpen={false} buttonPosition="bottom-right" />
<BrowserRouter>
<StorageProvider>
<StorageProvider>
<ColorModeProvider>
<QueryClientProvider client={queryClient}>
<ReactQueryDevtools
initialIsOpen={false}
buttonPosition="bottom-right"
/>
<BrowserRouter>
<AuthenticationProvider>
<AppRoutes />
</AuthenticationProvider>
</StorageProvider>
</BrowserRouter>
</QueryClientProvider>
<ToastContainer />
</ColorModeProvider>
</BrowserRouter>
</QueryClientProvider>
<ToastContainer />
</ColorModeProvider>
</StorageProvider>
);

export default App;

0 comments on commit 33efa67

Please sign in to comment.