@@ -13,6 +13,6 @@
|
|||||||
"**/.DS_Store",
|
"**/.DS_Store",
|
||||||
"**/Thumbs.db",
|
"**/Thumbs.db",
|
||||||
"**/.classpath",
|
"**/.classpath",
|
||||||
"**/.settings",
|
"**/.settings"
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import pluginQuery from '@tanstack/eslint-plugin-query';
|
|||||||
|
|
||||||
export default antfu({
|
export default antfu({
|
||||||
gitignore: true,
|
gitignore: true,
|
||||||
ignores: ['**/node_modules/**', '**/dist/**', 'bun.lock', '**/routeTree.gen.ts', '**/ui/**', 'src/components/editor/**/*', 'src/client/**/*', 'openapi-ts.config.ts'],
|
ignores: ['**/node_modules/**', '**/dist/**', 'bun.lock', '**/routeTree.gen.ts', '**/ui/**', 'src/components/editor/**/*', 'src/client/**/*', 'openapi-ts.config.ts', 'vitest.shims.d.ts', '.storybook/**/*'],
|
||||||
react: true,
|
react: true,
|
||||||
stylistic: {
|
stylistic: {
|
||||||
semi: true,
|
semi: true,
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ export function EventGridContainer() {
|
|||||||
const allEvents: EventInfo[] = isLoading
|
const allEvents: EventInfo[] = isLoading
|
||||||
? []
|
? []
|
||||||
: data.pages.flatMap(page => page.data!).map(it => ({
|
: data.pages.flatMap(page => page.data!).map(it => ({
|
||||||
type: it.type! as EventInfo['type'],
|
type: it.type! as EventInfo['type'],
|
||||||
coverImage: it.thumbnail! || PlaceholderImage,
|
coverImage: it.thumbnail! || PlaceholderImage,
|
||||||
eventName: it.name!,
|
eventName: it.name!,
|
||||||
description: it.description!,
|
description: it.description!,
|
||||||
startTime: new Date(it.start_time!),
|
startTime: new Date(it.start_time!),
|
||||||
endTime: new Date(it.end_time!),
|
endTime: new Date(it.end_time!),
|
||||||
onJoinEvent: () => mutate({ body: { event_id: it.event_id } }),
|
onJoinEvent: () => mutate({ body: { event_id: it.event_id } }),
|
||||||
} satisfies EventInfo));
|
} satisfies EventInfo));
|
||||||
|
|
||||||
return <EventGridView events={allEvents} />;
|
return <EventGridView events={allEvents} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ export function ProfileView({ user, onSaveBio }: { user: ServiceUserUserInfoData
|
|||||||
{/* Bio */}
|
{/* Bio */}
|
||||||
{enableBioEdit
|
{enableBioEdit
|
||||||
? (
|
? (
|
||||||
<MDEditor
|
<MDEditor
|
||||||
value={bio}
|
value={bio}
|
||||||
onChange={setBio}
|
onChange={setBio}
|
||||||
height="100%"
|
height="100%"
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
: <div className="p-6 prose dark:prose-invert"><Markdown>{bio}</Markdown></div>}
|
: <div className="p-6 prose dark:prose-invert"><Markdown>{bio}</Markdown></div>}
|
||||||
<Button
|
<Button
|
||||||
className="absolute bottom-4 right-4"
|
className="absolute bottom-4 right-4"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export function useIsMobile() {
|
|||||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||||
};
|
};
|
||||||
mql.addEventListener('change', onChange);
|
mql.addEventListener('change', onChange);
|
||||||
|
// eslint-disable-next-line react-hooks-extra/no-direct-set-state-in-use-effect
|
||||||
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
||||||
return () => mql.removeEventListener('change', onChange);
|
return () => mql.removeEventListener('change', onChange);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ function RouteComponent() {
|
|||||||
if (mutation.isIdle) {
|
if (mutation.isIdle) {
|
||||||
mutation.mutate({ body: { code } });
|
mutation.mutate({ body: { code } });
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <div>{status}</div>;
|
return <div>{status}</div>;
|
||||||
|
|||||||
@@ -1,35 +1,36 @@
|
|||||||
/// <reference types="vitest/config" />
|
/// <reference types="vitest/config" />
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import tailwindcss from '@tailwindcss/vite';
|
|
||||||
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
|
||||||
import react from '@vitejs/plugin-react';
|
|
||||||
import { defineConfig } from 'vite';
|
|
||||||
import svgr from 'vite-plugin-svgr';
|
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
||||||
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
||||||
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
import { playwright } from '@vitest/browser-playwright';
|
import { playwright } from '@vitest/browser-playwright';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import svgr from 'vite-plugin-svgr';
|
||||||
|
|
||||||
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [tanstackRouter({
|
plugins: [tanstackRouter({
|
||||||
target: 'react',
|
target: 'react',
|
||||||
autoCodeSplitting: true
|
autoCodeSplitting: true,
|
||||||
}), react(), tailwindcss(), svgr()],
|
}), react(), tailwindcss(), svgr()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, './src')
|
'@': path.resolve(__dirname, './src'),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': 'http://10.0.0.10:8000'
|
'/api': 'http://10.0.0.10:8000',
|
||||||
},
|
},
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5173,
|
port: 5173,
|
||||||
allowedHosts: ['nix.org.cn', 'nixos.party']
|
allowedHosts: ['nix.org.cn', 'nixos.party'],
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
projects: [{
|
projects: [{
|
||||||
@@ -37,9 +38,10 @@ export default defineConfig({
|
|||||||
plugins: [
|
plugins: [
|
||||||
// The plugin will run tests for the stories defined in your Storybook config
|
// The plugin will run tests for the stories defined in your Storybook config
|
||||||
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
// See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
|
||||||
storybookTest({
|
storybookTest({
|
||||||
configDir: path.join(dirname, '.storybook')
|
configDir: path.join(dirname, '.storybook'),
|
||||||
})],
|
}),
|
||||||
|
],
|
||||||
test: {
|
test: {
|
||||||
name: 'storybook',
|
name: 'storybook',
|
||||||
browser: {
|
browser: {
|
||||||
@@ -47,11 +49,11 @@ export default defineConfig({
|
|||||||
headless: true,
|
headless: true,
|
||||||
provider: playwright({}),
|
provider: playwright({}),
|
||||||
instances: [{
|
instances: [{
|
||||||
browser: 'chromium'
|
browser: 'chromium',
|
||||||
}]
|
}],
|
||||||
},
|
},
|
||||||
setupFiles: ['.storybook/vitest.setup.ts']
|
setupFiles: ['.storybook/vitest.setup.ts'],
|
||||||
}
|
},
|
||||||
}]
|
}],
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user