Skip to content

Commit b4b1771

Browse files
sumi-0011claude
andauthored
InventoryGrid(Embla 페이지네이션) 도입 및 SelectPersonaList 통합 (#395)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1b75dfb commit b4b1771

9 files changed

Lines changed: 230 additions & 181 deletions

File tree

apps/web/src/app/[locale]/guild/(subpage)/create/GuildCreate.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client';
22
import { useState } from 'react';
33
import { createGuild } from '@gitanimals/api';
4-
import { Button } from '@gitanimals/ui-tailwind';
4+
import { Button, ScrollArea } from '@gitanimals/ui-tailwind';
55
import { AxiosError } from 'axios';
66
import { toast } from 'sonner';
77

88
import { useRouter } from '@/i18n/routing';
99

10-
import { GuildSelectPersonaList } from '../../_components/GuildSelectPersonaList';
10+
import { SelectPersonaList } from '../../../mypage/PersonaList';
1111

1212
import { GuildCreateForm } from './GuildCreateForm';
1313

@@ -66,10 +66,15 @@ export default function GuildCreate() {
6666
)}
6767
{step === 'guild-persona' && (
6868
<>
69-
<GuildSelectPersonaList
69+
<SelectPersonaList
7070
selectPersona={selectPersona ? [selectPersona] : []}
7171
onSelectPersona={(persona) => setSelectPersona(persona.id)}
72-
/>
72+
>
73+
<SelectPersonaList.Toolbar showSearch />
74+
<ScrollArea height="50vh">
75+
<SelectPersonaList.Grid />
76+
</ScrollArea>
77+
</SelectPersonaList>
7378
<Button className="mx-auto" disabled={!selectPersona} onClick={onSubmit}>
7479
Done
7580
</Button>

apps/web/src/app/[locale]/guild/_components/GuildPetSelectDialog.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import { useState } from 'react';
55
import type { Persona } from '@gitanimals/api';
6-
import { Button } from '@gitanimals/ui-tailwind';
6+
import { Button, ScrollArea } from '@gitanimals/ui-tailwind';
77

8-
import { GuildSelectPersonaList } from './GuildSelectPersonaList';
8+
import { SelectPersonaList } from '../../mypage/PersonaList';
99

1010
export const GuildJoinPetSelectDialog = ({ onSubmit }: { onSubmit: (selectPersona: string) => void }) => {
1111
const [selectPersona, setSelectPersona] = useState<string>();
@@ -22,7 +22,12 @@ export const GuildJoinPetSelectDialog = ({ onSubmit }: { onSubmit: (selectPerson
2222

2323
return (
2424
<>
25-
<GuildSelectPersonaList selectPersona={selectPersona ? [selectPersona] : []} onSelectPersona={onSelectPersona} />
25+
<SelectPersonaList selectPersona={selectPersona ? [selectPersona] : []} onSelectPersona={onSelectPersona}>
26+
<SelectPersonaList.Toolbar showSearch />
27+
<ScrollArea height="50vh">
28+
<SelectPersonaList.Grid />
29+
</ScrollArea>
30+
</SelectPersonaList>
2631
<Button className="mx-auto w-[100px]" onClick={onDone} disabled={!selectPersona}>
2732
Done
2833
</Button>

apps/web/src/app/[locale]/guild/_components/GuildSelectPersonaList.tsx

Lines changed: 0 additions & 77 deletions
This file was deleted.

apps/web/src/app/[locale]/mypage/(github-custom)/FarmPersonaSelect.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState } from 'react';
22
import { useTranslations } from 'next-intl';
33
import type { Persona } from '@gitanimals/api';
44
import { userQueries } from '@gitanimals/react-query';
5-
import { Dialog, ScrollArea } from '@gitanimals/ui-tailwind';
5+
import { Dialog } from '@gitanimals/ui-tailwind';
66
import { useQueryClient } from '@tanstack/react-query';
77
import { ExpandIcon } from 'lucide-react';
88
import { toast } from 'sonner';
@@ -53,9 +53,9 @@ export function FarmPersonaSelect({ onImageRefresh }: { onImageRefresh: () => vo
5353
<ExpandIcon color="white" size={20} />
5454
</button>
5555
</section>
56-
<ScrollArea height="160px">
57-
<SelectPersonaList {...personaListProps} />
58-
</ScrollArea>
56+
<SelectPersonaList {...personaListProps}>
57+
<SelectPersonaList.InventoryGrid rows={2} />
58+
</SelectPersonaList>
5959
<Dialog open={isOpen} onOpenChange={setIsOpen}>
6060
<Dialog.Content size="large" scrollable>
6161
<Dialog.Title>{t('farm-type-select-pet')}</Dialog.Title>
@@ -64,7 +64,7 @@ export function FarmPersonaSelect({ onImageRefresh }: { onImageRefresh: () => vo
6464
<SelectPersonaList.Toolbar showSearch showVisibilityFilter />
6565
</Dialog.TopSlot>
6666
<Dialog.Body>
67-
<SelectPersonaList.Grid />
67+
<SelectPersonaList.InventoryGrid rows="auto" minRows={2} />
6868
</Dialog.Body>
6969
</SelectPersonaList>
7070
</Dialog.Content>

apps/web/src/app/[locale]/mypage/(github-custom)/LinePersonaSelect.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useState } from 'react';
44
import { useTranslations } from 'next-intl';
5-
import { Dialog, ScrollArea } from '@gitanimals/ui-tailwind';
5+
import { Dialog } from '@gitanimals/ui-tailwind';
66
import { ExpandIcon } from 'lucide-react';
77

88
import { SelectPersonaList } from '../PersonaList';
@@ -25,12 +25,12 @@ export const LinePersonaSelect = ({ selectPersona, onChangePersona }: Props) =>
2525
<ExpandIcon color="white" size={20} />
2626
</button>
2727
</section>
28-
<ScrollArea height="160px">
29-
<SelectPersonaList
30-
selectPersona={selectPersona ? [selectPersona] : []}
31-
onSelectPersona={(persona) => onChangePersona(persona.id)}
32-
/>
33-
</ScrollArea>
28+
<SelectPersonaList
29+
selectPersona={selectPersona ? [selectPersona] : []}
30+
onSelectPersona={(persona) => onChangePersona(persona.id)}
31+
>
32+
<SelectPersonaList.InventoryGrid rows={2} />
33+
</SelectPersonaList>
3434
<Dialog open={isExtend} onOpenChange={() => setIsExtend(false)}>
3535
<Dialog.Content size="large" scrollable>
3636
<Dialog.Title>{t('line-type-select-pet')}</Dialog.Title>
@@ -42,7 +42,7 @@ export const LinePersonaSelect = ({ selectPersona, onChangePersona }: Props) =>
4242
<SelectPersonaList.Toolbar showSearch />
4343
</Dialog.TopSlot>
4444
<Dialog.Body>
45-
<SelectPersonaList.Grid />
45+
<SelectPersonaList.InventoryGrid rows="auto" minRows={2} />
4646
</Dialog.Body>
4747
</SelectPersonaList>
4848
</Dialog.Content>

0 commit comments

Comments
 (0)