Skip to content

Commit

Permalink
XPower UI: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kârūn The Rich committed May 5, 2024
1 parent 5d67202 commit d3b215a
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 30 deletions.
2 changes: 1 addition & 1 deletion public/images/tsx/arrow-down-circle-fill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ArrowDownCircle({
<path d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z' />
</svg>
: <svg xmlns='http://www.w3.org/2000/svg' height={height} width={width} fill='currentColor' className='bi bi-arrow-down-circle' viewBox='0 0 16 16' style={style}>
<path fill-rule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z' />
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z' />
</svg>;
}
export default ArrowDownCircle;
2 changes: 1 addition & 1 deletion public/images/tsx/arrow-left-circle-fill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ArrowLeftCircle({
<path d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.5 7.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5z' />
</svg>
: <svg xmlns='http://www.w3.org/2000/svg' height={height} width={width} fill='currentColor' className='bi bi-arrow-left-circle' viewBox='0 0 16 16' style={style}>
<path fill-rule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-4.5-.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5z' />
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-4.5-.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5z' />
</svg>;
}
export default ArrowLeftCircle;
2 changes: 1 addition & 1 deletion public/images/tsx/arrow-right-circle-fill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ArrowRightCircle({
<path d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z' />
</svg>
: <svg xmlns='http://www.w3.org/2000/svg' height={height} width={width} fill='currentColor' className='bi bi-arrow-right-circle' viewBox='0 0 16 16' style={style}>
<path fill-rule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z' />
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z' />
</svg>;
}
export default ArrowRightCircle;
2 changes: 1 addition & 1 deletion public/images/tsx/arrow-up-circle-fill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ArrowUpCircle({
<path d='M16 8A8 8 0 1 0 0 8a8 8 0 0 0 16 0zm-7.5 3.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11.5z' />
</svg>
: <svg xmlns='http://www.w3.org/2000/svg' height={height} width={width} fill='currentColor' className='bi bi-arrow-up-circle' viewBox='0 0 16 16' style={style}>
<path fill-rule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-7.5 3.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11.5z' />
<path fillRule='evenodd' d='M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8zm15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-7.5 3.5a.5.5 0 0 1-1 0V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11.5z' />
</svg>;
}
export default ArrowUpCircle;
2 changes: 1 addition & 1 deletion source/contract/avvy-domains/avvy-domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AvvyDomains extends Base {
public async reverseResolveEVMToName(
account: Account
): Promise<string> {
if (await Blockchain.isMainnet() || testing()) {
if ((await Blockchain.isMainnet()) || testing()) {
const contract = await this.get;
return reverse(account, contract);
}
Expand Down
40 changes: 25 additions & 15 deletions source/react/element/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import React from 'react';

function enrich<
A extends React.HTMLAttributes<E>,
E extends HTMLElement
>(
props: React.DetailedHTMLProps<A, E>
) {
if (props.title) return {
'aria-label': props.title,
'data-bs-placement': 'top',
'data-bs-toggle': 'tooltip',
'data-bs-original-title': props.title,
...props
};
return props;
}
export const A = React.forwardRef(<
A extends React.AnchorHTMLAttributes<E>,
E extends HTMLAnchorElement
Expand Down Expand Up @@ -130,18 +145,13 @@ export const Ul = React.forwardRef(<
{props.children}
</ul>;
});
function enrich<
A extends React.HTMLAttributes<E>,
E extends HTMLElement
>(
props: React.DetailedHTMLProps<A, E>
) {
if (props.title) return {
'aria-label': props.title,
'data-bs-placement': 'top',
'data-bs-toggle': 'tooltip',
'data-bs-original-title': props.title,
...props
};
return props;
}
A.displayName = 'A';
Button.displayName = 'Button';
Div.displayName = 'Div';
Input.displayName = 'Input';
Img.displayName = 'Img';
Li.displayName = 'Li';
Nav.displayName = 'Nav';
Select.displayName = 'Select';
Span.displayName = 'Span';
Ul.displayName = 'Ul';
1 change: 0 additions & 1 deletion source/react/hooks/use-buffered-effect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint react-hooks/exhaustive-deps: [off] */
import { useEffect, useRef } from 'react';

/**
Expand Down
1 change: 0 additions & 1 deletion source/react/hooks/use-buffered-if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function useBufferedIf<S>(
const [state, set_state_now] = useState(initial);
const set_state = useMemo(
() => bufferedIf(set_state_now, iff2(iff), ms),
// eslint-disable-next-line react-hooks/exhaustive-deps
[set_state_now, ms] // no iff to allow inline functions
);
return [state, set_state, set_state_now];
Expand Down
3 changes: 1 addition & 2 deletions source/react/hooks/use-delayed-effect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint react-hooks/exhaustive-deps: [off] */
import { useEffect, useRef } from 'react';
/**
* A hook that delays the execution of an effect callback.
Expand All @@ -24,7 +23,7 @@ export function useDelayedEffect(
);
return () => clearTimeout(tid);
}, [
ms, ...deps ?? []
ms, ...(deps ?? [])
]);
}
export default useDelayedEffect;
1 change: 0 additions & 1 deletion source/react/hooks/use-delayed-if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function useDelayedIf<S>(
const [state, set_state_now] = useState(initial);
const set_state = useMemo(
() => delayedIf(set_state_now, iff2(iff), ms),
// eslint-disable-next-line react-hooks/exhaustive-deps
[set_state_now, ms] // no iff to allow inline functions
);
return [state, set_state, set_state_now];
Expand Down
2 changes: 1 addition & 1 deletion source/services/minting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const MintingService = (
onNonceChanged(store, async function updateMinters(
nonce, { account, amount }, total
) {
if (account !== await Blockchain.account) {
if (account !== (await Blockchain.account)) {
return;
}
const level = Tokenizer.level(amount);
Expand Down
2 changes: 1 addition & 1 deletion source/wallet/nft-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class NftWallet extends ERC1155Wallet {
async year(
delta: Year | Promise<Year> = 0
): Promise<Year> {
return Promise.resolve(new Date().getFullYear() - await delta);
return Promise.resolve(new Date().getFullYear() - (await delta));
}
get put() {
return this._nft.connect();
Expand Down
2 changes: 1 addition & 1 deletion source/wallet/ppt-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PptWallet extends ERC1155Wallet {
async year(
delta: Year | Promise<Year> = 0
): Promise<Year> {
return Promise.resolve(new Date().getFullYear() - await delta);
return Promise.resolve(new Date().getFullYear() - (await delta));
}
get put() {
return this._ppt.connect();
Expand Down
4 changes: 2 additions & 2 deletions views/connector/rpc-address/rpc-address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function $enable(
React.SetStateAction<Rpc | null>
>
) {
return (
return function RpcAddressEnable(
rpc: Rpc | null, valid: boolean | null
) => {
) {
return <Button
className='form-control input-group-text'
id='rpc-address-enable'
Expand Down
1 change: 1 addition & 0 deletions views/swap/swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Iframe = memo(({ dex, token }: {
: URLS[dex](x40(address));
return <iframe src={src} />;
});
Iframe.displayName = 'Iframe';
const URLS = {
[DEX.paraswap]: (a: Address) => {
return `https://app.paraswap.io/#/0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE-${a}/1/SELL?network=avalanche&version=5`;
Expand Down

0 comments on commit d3b215a

Please sign in to comment.