From e5b95755e808ca34b7f3d86c30f69a3940f6b4f2 Mon Sep 17 00:00:00 2001 From: osamu <46447427+sam-osamu@users.noreply.github.com> Date: Sun, 25 Feb 2024 14:22:01 +0900 Subject: [PATCH] wip --- packages/frontend/.storybook/fake-utils.ts | 2 +- .../custom-emojis-manager2.stories.impl.ts | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/frontend/.storybook/fake-utils.ts b/packages/frontend/.storybook/fake-utils.ts index 47675045f9..330acf95f6 100644 --- a/packages/frontend/.storybook/fake-utils.ts +++ b/packages/frontend/.storybook/fake-utils.ts @@ -120,7 +120,7 @@ export function imageDataUrl(options?: { const red = options?.color?.red ?? integer(0, 255); const green = options?.color?.green ?? integer(0, 255); const blue = options?.color?.blue ?? integer(0, 255); - const alpha = options?.color?.alpha ?? 0; + const alpha = options?.color?.alpha ?? 1; ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true); ctx.fillStyle = `rgba(${red}, ${green}, ${blue}, ${alpha})`; ctx.fill(); diff --git a/packages/frontend/src/pages/admin/custom-emojis-manager2.stories.impl.ts b/packages/frontend/src/pages/admin/custom-emojis-manager2.stories.impl.ts index 0e6852a342..21e84d4e47 100644 --- a/packages/frontend/src/pages/admin/custom-emojis-manager2.stories.impl.ts +++ b/packages/frontend/src/pages/admin/custom-emojis-manager2.stories.impl.ts @@ -45,10 +45,8 @@ function createRender(params: { http.post('/api/admin/emoji/v2/list', async (req) => { await delay(100); - const bodyStream = req.request.body. - const body = req.body as entities.AdminEmojiV2ListRequest; - - console.log(req); + const bodyStream = req.request.body as ReadableStream; + const body = await new Response(bodyStream).json() as entities.AdminEmojiV2ListRequest; const emojis = params.emojis; const limit = body.limit ?? 10; @@ -72,8 +70,14 @@ export const Default = createRender({ emojis: [], }); -export const Max10 = createRender({ - emojis: [ - emoji(), emoji(), emoji(), emoji(), emoji(), emoji(), emoji(), emoji(), emoji(), emoji(), - ], +export const List10 = createRender({ + emojis: Array.from({ length: 10 }, (_, i) => emoji({ name: `emoji_${i}` })), +}); + +export const List100 = createRender({ + emojis: Array.from({ length: 100 }, (_, i) => emoji({ name: `emoji_${i}` })), +}); + +export const List1000 = createRender({ + emojis: Array.from({ length: 1000 }, (_, i) => emoji({ name: `emoji_${i}` })), });