Skip to content

Commit

Permalink
Apply prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Jun 11, 2024
1 parent 615dd04 commit b2048ba
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { REACT_APP_CONFIG_SERVICE_URL, REACT_APP_SHOW_CONFIG_SERVICE_SELECTOR } =

function App() {
const [configServiceUrl, setConfigServiceUrl] = useState<string>(
REACT_APP_CONFIG_SERVICE_URL || ""
REACT_APP_CONFIG_SERVICE_URL || "",
);

const { theme, switchThemeMode, isDarkTheme } = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion src/api/getChainStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CHAIN_STATUS_PATHNAME = "/api/v1/about/indexing/";

async function getChainStatus(
transactionServiceBaseUrl: string,
options?: RawAxiosRequestConfig
options?: RawAxiosRequestConfig,
): Promise<chainStatus> {
const endpoint = `${transactionServiceBaseUrl}${CHAIN_STATUS_PATHNAME}`;

Expand Down
2 changes: 1 addition & 1 deletion src/api/getChains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CHAINS_PATHNAME = "/api/v1/chains/";

async function getChains(
configServiceBaseUrl: string,
options?: RawAxiosRequestConfig
options?: RawAxiosRequestConfig,
): Promise<chain[]> {
const endpoint = `${configServiceBaseUrl}${CHAINS_PATHNAME}`;

Expand Down
2 changes: 1 addition & 1 deletion src/components/block-label/BlockLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function BlockLabel({
// we build the block href from the tx template
const blockExplorerHref = getBlockExplorerHref(
blockExplorerUriTemplate.txHash,
blockNumber
blockNumber,
);

// fetch block timestamp from getBlock
Expand Down
4 changes: 2 additions & 2 deletions src/components/chain-status-table/ChainStatusRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function ChainStatusRow({ chain }: { chain: chain }) {
signal,
});
},
[chain]
[chain],
);

// fetch chain status with a polling (5 secs)
Expand All @@ -48,7 +48,7 @@ function ChainStatusRow({ chain }: { chain: chain }) {

return blockInfo;
},
[provider, chain]
[provider, chain],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/chain-status-table/ChainStatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ChainStatusTable({ configServiceUrl }: StatusTableProps) {
}
return Promise.resolve([]);
},
[configServiceUrl]
[configServiceUrl],
);

const { isLoading, data: chains } = useApi(fetchChains);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function ConfigServiceUrlSelector({
value={configServiceUrl}
onChange={(
event: SyntheticEvent,
option: string | optionsType | null
option: string | optionsType | null,
) => {
const isStringValue = typeof option === "string";
const newValue = isStringValue ? option : option?.value;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type useApiHookReturnValue<T> = {

function useApi<T>(
apiCall: apiCallParam<T>,
pollingTime?: number
pollingTime?: number,
): useApiHookReturnValue<T> {
const [isLoading, setIsLoading] = useState<boolean>(true);
const [data, setData] = useState<T>();
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useLocalStorageState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { useEffect, useState } from "react";

type useLocalStorageStateReturnType<T> = [
value: T,
setValue: React.Dispatch<React.SetStateAction<T>>
setValue: React.Dispatch<React.SetStateAction<T>>,
];

function useLocalStorageState<T extends string>(
key: string,
initialValue: T
initialValue: T,
): useLocalStorageStateReturnType<T> {
const reactState = useState<T>(
() => (localStorage.getItem(key) as T) || initialValue
() => (localStorage.getItem(key) as T) || initialValue,
);

const [value] = reactState;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const STORAGE_KEY_THEME_MODE = "THEME_MODE_REACT_SERVICE_STATUS_KEY";
function useTheme(): useThemeReturnValue {
const [themeMode, setThemeMode] = useLocalStorageState<PaletteMode>(
STORAGE_KEY_THEME_MODE, // key
DARK_THEME // initial value
DARK_THEME, // initial value
);

const switchThemeMode = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ReactDOM from "react-dom/client";
import App from "src/App";

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
document.getElementById("root") as HTMLElement,
);

root.render(<App />);
2 changes: 1 addition & 1 deletion src/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const getTheme = (themeMode: PaletteMode): Theme => {
},
},
},
})
}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/utils/getBlockExplorerHref.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// we build the block template from the tx template
function getBlockExplorerHref(
blockExplorerTxTemplate: string,
blockNumber?: number
blockNumber?: number,
): string {
const transactionTemplate = "/tx/{{txHash}}";
const blockTemplate = `/block/${blockNumber}`;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/memoizedGetBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const THRESHOLD_CLEAN_CACHE_TIME = 20 * 60 * 1000; // purge block cache each 20
async function memoizedGetBlock(
blockNumber: number,
provider: ethers.providers.JsonRpcProvider,
chainId: string
chainId: string,
): returnBlockInfoType {
// we clean the cache each 20 mins
if (Date.now() > lastTimeCleaned + THRESHOLD_CLEAN_CACHE_TIME) {
Expand Down

0 comments on commit b2048ba

Please sign in to comment.