Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 2, 2024
1 parent fb43f79 commit 623f8f9
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 57 deletions.
9 changes: 4 additions & 5 deletions apps/frontend/web/app/components/Resources/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export const Pagination = (props: PaginationProps) => {
const { page, complete, timestamp } = props;
const isPrev = page > 1;
const isNext = !complete;
const pages = isPrev ? [page - 1, page, page + 1, page + 2, page + 3] : [page, page + 1, page + 2, page + 3, page + 4];
const pages = isPrev
? [page - 1, page, page + 1, page + 2, page + 3]
: [page, page + 1, page + 2, page + 3, page + 4];

if (page === 1 && complete) {
// Only one page data, no pagination
Expand Down Expand Up @@ -52,10 +54,7 @@ export const Pagination = (props: PaginationProps) => {
page={p}
link={props.link}
navigate={props.navigate}
className={clsx(
'block',
p === page && 'text-pink-600'
)}
className={clsx('block', p === page && 'text-pink-600')}
>
<span>{p}</span>
</PageItem>
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/web/app/components/Resources/tag.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { memo } from 'react'
import { memo } from 'react';

export const Tag = memo((props: { text: string; color?: string; className?: string }) => {
export const Tag = memo((props: { text: string; color?: string; className?: string }) => {
const { text, className = '', color = 'bg-gray-200' } = props;

return (
Expand Down
10 changes: 5 additions & 5 deletions apps/frontend/web/app/components/Sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useAtom } from "jotai"
import { isOpenSidebar } from "./atom"
import { useAtom } from 'jotai';
import { isOpenSidebar } from './atom';

export function Sidebar() {
const [isOpen] = useAtom(isOpenSidebar);

if (!isOpen) return <div></div>
if (!isOpen) return <div></div>;

return <div className="w-[300px] border-r-1 h-[150vh]"></div>
}
return <div className="w-[300px] border-r-1 h-[150vh]"></div>;
}
6 changes: 3 additions & 3 deletions apps/frontend/web/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* For more information, see https://remix.run/file-conventions/entry.client
*/

import { RemixBrowser } from "@remix-run/react";
import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import { RemixBrowser } from '@remix-run/react';
import { startTransition, StrictMode } from 'react';
import { hydrateRoot } from 'react-dom/client';

startTransition(() => {
hydrateRoot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ export default function Resources() {
<h2 className="text-lg font-bold border-b px4 py2">文件列表</h2>
<div className="mb4 max-h-[80vh] overflow-auto px4">
{files.map((f) => (
<div key={f.name + '_' + f.size} className="py2 flex justify-between items-center gap4">
<div
key={f.name + '_' + f.size}
className="py2 flex justify-between items-center gap4"
>
<div className="text-sm text-base-600">{f.name}</div>
<div className="text-xs text-base-400 select-none">{f.size}</div>
</div>
Expand Down
44 changes: 22 additions & 22 deletions apps/frontend/web/node/rss/schema.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { z } from 'zod';

export const rssSchema = z.object({
title: z.string().optional(),
description: z.string().optional(),
pubDate: z
.union([z.string(), z.number(), z.date()])
.optional()
.transform((value) => (value === undefined ? value : new Date(value)))
.refine((value) => (value === undefined ? value : !isNaN(value.getTime()))),
customData: z.string().optional(),
categories: z.array(z.string()).optional(),
author: z.string().optional(),
commentsUrl: z.string().optional(),
source: z.object({ url: z.string().url(), title: z.string() }).optional(),
enclosure: z
.object({
url: z.string(),
length: z.number().nonnegative().int().finite(),
type: z.string(),
})
.optional(),
link: z.string().optional(),
content: z.string().optional(),
});
title: z.string().optional(),
description: z.string().optional(),
pubDate: z
.union([z.string(), z.number(), z.date()])
.optional()
.transform((value) => (value === undefined ? value : new Date(value)))
.refine((value) => (value === undefined ? value : !isNaN(value.getTime()))),
customData: z.string().optional(),
categories: z.array(z.string()).optional(),
author: z.string().optional(),
commentsUrl: z.string().optional(),
source: z.object({ url: z.string().url(), title: z.string() }).optional(),
enclosure: z
.object({
url: z.string(),
length: z.number().nonnegative().int().finite(),
type: z.string()
})
.optional(),
link: z.string().optional(),
content: z.string().optional()
});
4 changes: 2 additions & 2 deletions apps/frontend/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "remix vite:build",
"deploy:worker": "wrangler deploy",
"dev": "remix vite:dev",
"format": "prettier --write ./*.ts {app,worker}/**/*.{ts,tsx}",
"format": "prettier . **/*.{ts,tsx} --write",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"start": "remix-serve ./build/server/index.js",
"typecheck": "tsc",
Expand Down Expand Up @@ -54,4 +54,4 @@
"unocss-preset-shadcn": "^0.3.1",
"vite-tsconfig-paths": "^4.2.1"
}
}
}
2 changes: 1 addition & 1 deletion apps/frontend/web/public/google79f036f71a58993a.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-site-verification: google79f036f71a58993a.html
google-site-verification: google79f036f71a58993a.html
21 changes: 5 additions & 16 deletions apps/frontend/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"lib": [
"DOM",
"DOM.Iterable",
"ES2022"
],
"types": [
"@remix-run/node",
"vite/client"
],
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/node", "vite/client"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
Expand All @@ -24,12 +17,8 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./app/*"
],
"~/*": [
"./app/*"
]
"@/*": ["./app/*"],
"~/*": ["./app/*"]
},
"noEmit": true
},
Expand All @@ -41,4 +30,4 @@
"**/.client/**/*.ts",
"**/.client/**/*.tsx"
]
}
}

0 comments on commit 623f8f9

Please sign in to comment.