Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: client -> server #276

Merged
merged 33 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
61d829f
refactor: guild dialog๋ฅผ Intercepting Routes์„ ์ด์šฉํ•ด ์ˆ˜์ •
sumi-0011 Jan 5, 2025
fc9c338
refactor: components๋กœ ํŒŒ์ผ ์ •๋ฆฌ
sumi-0011 Jan 5, 2025
3d8d475
refactor: guild detail page refactor
sumi-0011 Jan 5, 2025
27068ff
feat: guild create init
sumi-0011 Jan 5, 2025
7f2a686
feat: get guild icons API
sumi-0011 Jan 5, 2025
c67f5a6
feat: get background API
sumi-0011 Jan 5, 2025
205cdab
feat: ๋‚ด๊ฐ€ ๊ฐ€์ž…ํ•œ ๊ธธ๋“œ ํŽ˜์ด์ง€ ์ถ”๊ฐ€
sumi-0011 Jan 7, 2025
ee1e625
feat: guild create ํ›„ ํŽ˜์ด์ง€ ์ด๋™
sumi-0011 Jan 7, 2025
90ee5ba
feat: guild type img ์ถ”๊ฐ€
sumi-0011 Jan 7, 2025
76fddb8
feat: dropdown menu ์ปค์Šคํ…€
sumi-0011 Jan 7, 2025
0aa3543
feat: guild ๋”๋ณด๊ธฐ ๋ฒ„ํŠผ ์ถ”๊ฐ€
sumi-0011 Jan 7, 2025
cb9b5dd
Merge remote-tracking branch 'origin/feat/guild-create' into feat/guiโ€ฆ
sumi-0011 Jan 8, 2025
5e2799e
refactor: state -> form ๋ฐฉ์‹์œผ๋กœ ๋ณ€๊ฒฝ ์ง„ํ–‰์ค‘
sumi-0011 Jan 8, 2025
9bb8712
feat: ์„ ํƒ ๊ฐ€๋Šฅํ•œ ํผ ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€
sumi-0011 Jan 8, 2025
40a80f6
feat: guild form ์ œ์ž‘
sumi-0011 Jan 8, 2025
9a3cfb9
feat: update guild ์ถ”๊ฐ€
sumi-0011 Jan 8, 2025
315b3fe
feat: ๊ธธ๋“œ ์„ค์ • ๋ฉ”๋‰ด ์ ‘๊ทผ ์ œ์–ด
sumi-0011 Jan 9, 2025
7c7c3e1
feat: setting ์ ‘๊ทผ ์ œ์–ด
sumi-0011 Jan 9, 2025
b2fd77d
feat: Intercepting์šฉ Dialog ์ถ”๊ฐ€
sumi-0011 Jan 9, 2025
f47351f
feat: update setting dialog ์ถ”๊ฐ€
sumi-0011 Jan 9, 2025
caa8ca0
feat: component ๊ตฌํ˜„์ค‘
sumi-0011 Jan 9, 2025
f98c850
fix: member setting ssr error fix
sumi-0011 Jan 10, 2025
c6fe182
feat: kick member form ์ถ”๊ฐ€
sumi-0011 Jan 10, 2025
724160f
feat: ๊ธธ๋“œ ๊ฐ€์ž… ์ˆ˜๋ฝ
sumi-0011 Jan 10, 2025
9ad6531
feat: ๊ธธ๋“œ ๊ฐ€์ž…, ๊ฑฐ์ ˆ API ์—ฐ๊ฒฐ
sumi-0011 Jan 10, 2025
104b2b0
refactor: member card ํŒŒ์ผ ์ด๋™
sumi-0011 Jan 10, 2025
f205dbf
feat: ๊ฐ€์ž… ์ˆ˜๋ฝ, ์ œ๊ฑฐ
sumi-0011 Jan 10, 2025
4749ba6
feat: member page min height
sumi-0011 Jan 10, 2025
7cecdf2
refactor: layout ํ•˜๋‚˜๋กœ ์ •์˜
sumi-0011 Jan 10, 2025
0cac774
feat: back trigger ์ถ”๊ฐ€
sumi-0011 Jan 10, 2025
1e593dd
refactor: client -> server
sumi-0011 Jan 10, 2025
5878fae
fix: image ๋ Œ๋”๋ง ์ˆ˜์ •
sumi-0011 Jan 10, 2025
edf73a5
Merge branch 'guild' into refactor/guild-detail
sumi-0011 Jan 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apps/web/src/app/[locale]/guild/@modal/(.)detail/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { getGuildById } from '@gitanimals/api';
import { Button } from '@gitanimals/ui-panda';

import { GuildDetail } from '@/app/[locale]/guild/_components/GuildDetail';
import GuildModal from '@/app/[locale]/guild/@modal/GuildModal';
import { Link } from '@/i18n/routing';

import { GuildDetail } from '../../../_components/GuildDetail';
import GuildModal from '../../GuildModal';

export default function GuildDetailModal({ params }: { params: { id: string } }) {
export default async function GuildDetailModal({ params }: { params: { id: string } }) {
const details = await getGuildById({ guildId: params.id });
return (
<GuildModal>
<GuildDetail guildId={params.id} />
<GuildDetail guildId={params.id} details={details} />
<Link href={`/guild/detail/${params.id}/join`} style={{ margin: 'auto' }}>
<Button w="100px">Join</Button>
</Link>
Expand Down
103 changes: 48 additions & 55 deletions apps/web/src/app/[locale]/guild/_components/GuildDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,63 @@ import { css, cx } from '_panda/css';
import { Box, Flex } from '_panda/jsx';
import { flex } from '_panda/patterns';
import Flicking from '@egjs/react-flicking';
import { guildQueries } from '@gitanimals/react-query';
import type { Guild } from '@gitanimals/api';
import { BannerPetSelectMedium } from '@gitanimals/ui-panda';
import { wrap } from '@suspensive/react';
import { useSuspenseQuery } from '@tanstack/react-query';
import { UsersRoundIcon } from 'lucide-react';

import { getPersonaImage } from '@/utils/image';

export const GuildDetail = wrap
.Suspense({ fallback: null })
.ErrorBoundary({ fallback: null })
.on(({ guildId }: { guildId: string }) => {
const { data } = useSuspenseQuery(guildQueries.getGuildByIdOptions(guildId));

return (
<>
<div>
<div className={titleStyle}>
<img src={data.guildIcon} width={40} height={40} alt={data.title} />
<h2>{data.title}</h2>
</div>
<div className={bodyStyle}>{data.body}</div>
export const GuildDetail = ({ details }: { guildId: string; details: Guild }) => {
return (
<>
<div>
<div className={titleStyle}>
<img src={details.guildIcon} width={40} height={40} alt={details.title} />
<h2>{details.title}</h2>
</div>
<div className={bodyStyle}>{details.body}</div>
</div>
<div className={listStyle}>
<div className={leaderStyle}>
<p> Leader</p>
<BannerPetSelectMedium
name={details.leader.name}
count={details.leader.contributions}
image={getPersonaImage(details.leader.personaType)}
status="gradient"
/>
</div>
<div className={listStyle}>
<div className={leaderStyle}>
<p> Leader</p>
<BannerPetSelectMedium
name={data.leader.name}
count={data.leader.contributions}
image={getPersonaImage(data.leader.personaType)}
status="gradient"
/>
</div>
<div className={membersStyle}>
<Flex mb="1" justifyContent="space-between">
<p>Members</p>
<Flex gap="6px" alignItems="center">
<UsersRoundIcon size={16} color="#FFFFFF80" />
<span>{data.members.length}/ 15</span>
</Flex>
<div className={membersStyle}>
<Flex mb="1" justifyContent="space-between">
<p>Members</p>
<Flex gap="6px" alignItems="center">
<UsersRoundIcon size={16} color="#FFFFFF80" />
<span>{details.members.length}/ 15</span>
</Flex>
<Flicking moveType="freeScroll" align="prev" bound={true}>
{data.members.map((member) => (
<div
className={cx('flicking-panel', css({ height: 'fit-content', _first: { ml: 0 }, marginLeft: 1 }))}
</Flex>
<Flicking moveType="freeScroll" align="prev" bound={true}>
{details.members.map((member) => (
<div
className={cx('flicking-panel', css({ height: 'fit-content', _first: { ml: 0 }, marginLeft: 1 }))}
key={member.id}
>
<BannerPetSelectMedium
key={member.id}
>
<BannerPetSelectMedium
key={member.id}
name={member.name}
count={member.contributions}
image={member.personaId}
/>
</div>
))}
</Flicking>
</div>
name={member.name}
count={member.contributions}
image={getPersonaImage(member.personaType)}
/>
</div>
))}
</Flicking>
</div>
<Box aspectRatio="1/0.5" width="100%" bg="white.white_50">
farm type
</Box>
</>
);
});
</div>
<Box aspectRatio="1/0.5" width="100%" bg="white.white_50">
farm type
</Box>
</>
);
};

const listStyle = flex({
gap: 4,
Expand Down
8 changes: 6 additions & 2 deletions apps/web/src/app/[locale]/guild/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { getGuildById } from '@gitanimals/api';

import { GuildDetail } from '../../_components/GuildDetail';

export default function GuildDetailPage({ params }: { params: { id: string } }) {
return <GuildDetail guildId={params.id} />;
export default async function GuildDetailPage({ params }: { params: { id: string } }) {
const details = await getGuildById({ guildId: params.id });

return <GuildDetail guildId={params.id} details={details} />;
}
Loading