Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed May 21, 2024
1 parent c8c644f commit 134865a
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/(app)/app/@headerl/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IconLogo } from "@/components/icons";
export default function Page() {
return (
<>
<IconLogo className="h-[2rem] w-[2rem]" />
<IconLogo className="size-8" />
</>
);
}
4 changes: 2 additions & 2 deletions frontend/src/app/(app)/app/@modal/_components/page-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { useRouter } from "next/navigation";
import { useEffect, useRef, useState } from "react";

export function PageModal(
props: Omit<ModalProps, "children" | "onClose" | "opened"> & {
props: {
children:
| (({ close }: { close: () => void }) => React.ReactNode)
| React.ReactNode;
// documentTitle: string;
}
} & Omit<ModalProps, "children" | "onClose" | "opened">
) {
const { children, ...rest } = props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
import { DropIndicator } from "@atlaskit/pragmatic-drag-and-drop-react-indicator/tree-item";
import { createContext } from "react";

export type LocalAiSessionTreeItem = Omit<AiSessionTreeItem, "children"> & {
export type LocalAiSessionTreeItem = {
children: LocalAiSessionTreeItem[];
isOpen: boolean;
};
} & Omit<AiSessionTreeItem, "children">;
export type LocalAiSessionTree = LocalAiSessionTreeItem[];

type TreeAction =
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/(app)/app/@navbart/_components/user-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function UserCard({
image,
username,
withBurger = false,
}: UserButtonProps & {
}: {
withBurger?: boolean;
}) {
} & UserButtonProps) {
return (
<Group className="overflow-hidden" wrap="nowrap">
<Avatar radius="xl" src={image} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ export function QuestionCards({
useEffect(() => {
if (status === "pending" || status === "streaming") {
setShow(false);
} else {
setShow(true);
}
// else {
// setShow(true);
// }
}, [status]);

const hide = () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export default async function LoginPage({
<div className="container mx-auto flex h-screen w-screen flex-col items-center justify-center">
<Link className="absolute left-4 top-4 md:left-8 md:top-8" href="/">
<>
<IconArrowLeft className="mr-2 h-4 w-4" />
<IconArrowLeft className="mr-2 size-4" />
Back
</>
</Link>
<div className="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[400px]">
<div className="flex flex-col space-y-2 text-center">
<IconLogo className="mx-auto h-10 w-10" />
<IconLogo className="mx-auto size-10" />
<h1 className="text-2xl font-semibold tracking-tight">
Welcome to OpenAgent
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ToolChunkSwap({
}) {
return expired ? (
<div className="flex items-center gap-2 rounded-sm bg-gray-300 px-4 py-2">
<IconInfoCircle className="h-5 w-5" />
<IconInfoCircle className="size-5" />
The swap has expired.
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function ToolChunkTransfer(props: {
if (props.expired) {
return (
<div className="flex items-center gap-2 rounded-sm bg-gray-300 px-4 py-2">
<IconInfoCircle className="h-5 w-5" />
<IconInfoCircle className="size-5" />
The transfer has expired.
</div>
);
Expand All @@ -195,7 +195,7 @@ export function ToolChunkTransfer(props: {
if (!chain) {
return (
<div className="flex items-center gap-2 rounded-sm bg-red-200 px-4 py-2">
<IconInfoCircle className="h-5 w-5" />
<IconInfoCircle className="size-5" />
Unsupported chain ID: {props.body.chain_id}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/ai/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export function useAskAi({

// remove the `?new=true` query param
if (searchParams.get("new") === "true") {
router.replace(`/app/sessions/${sessionId}`);
// router.replace(`/app/sessions/${sessionId}`);
window.history.replaceState({}, "", `/app/sessions/${sessionId}`);
}

const _abortController = new AbortController();
Expand Down Expand Up @@ -259,7 +260,6 @@ export function useAskAi({
body,
isOnboarding,
messageId,
router,
scrollToBottom,
searchParams,
sessionId,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { SessionProvider } from "./provider";
export * from "./options";
export { SessionProvider } from "./provider";
2 changes: 1 addition & 1 deletion frontend/src/lib/mantine/screen-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function ScreenIndicator() {
if (process.env.NODE_ENV === "production") return null;

return (
<div className="fixed bottom-1 left-1 z-[9999] flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white dark:bg-gray-100 dark:text-black">
<div className="fixed bottom-1 left-1 z-[9999] flex size-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white dark:bg-gray-100 dark:text-black">
<div className="block sm:hidden">xs</div>
<div className="hidden sm:block md:hidden lg:hidden xl:hidden 2xl:hidden">
sm
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/validations/pipelines/eth-address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
} from "valibot";

export type EthAddressValidation<TInput extends string> =
BaseValidation<TInput> & {
{
requirement: RegExp;
type: "eth_address";
};
} & BaseValidation<TInput>;

export function ethAddress<TInput extends string>(
message: ErrorMessage = "Invalid address"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/validations/pipelines/eth-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
} from "valibot";

export type EthAddressValidation<TInput extends string> =
BaseValidation<TInput> & {
{
requirement: RegExp;
type: "eth_name";
};
} & BaseValidation<TInput>;

/**
* @example "songkeys.eth" (always ends with ".eth")
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/validations/pipelines/token-amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
export type TokenAmountValidation<
TInput extends string,
TRequirement extends number,
> = BaseValidation<TInput> & {
> = {
/**
* Decimals
*/
requirement: TRequirement;
type: "token_amount";
};
} & BaseValidation<TInput>;

/**
* @example "songkeys.eth" (always ends with ".eth")
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/validations/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function valibotResolver<T extends Record<string, unknown>>(
.filter(
(
error
): error is ValiError["issues"][number] & {
): error is {
path: { key: string }[];
} => Boolean(error.path)
} & ValiError["issues"][number] => Boolean(error.path)
)
.reduce<FormErrors>((acc, error) => {
const key = error.path.map((p) => p.key).join(".");
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/server/api/routers/ai/types/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ export type AiSessionMessageToolInputBody<
export type AiSessionMessageToolOutputBody<
T extends AiSessionMessageToolType = AiSessionMessageToolType,
> =
| AiSessionMessageToolOutputBody_Error
| (AiSessionMessageToolOutputBody_Type_Content_Mapping[T] & {
| ({
error: never;
});
} & AiSessionMessageToolOutputBody_Type_Content_Mapping[T])
| AiSessionMessageToolOutputBody_Error;

/**
* @private
Expand Down

0 comments on commit 134865a

Please sign in to comment.