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

Fix(#192): LotusGistLink를 Button으로 변경 #193

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions apps/frontend/src/feature/lotus/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentProps, HTMLProps, ReactNode, createContext, useContext } from 'react';
import { Badge, Text } from '@froxy/design/components';
import { Badge, Button, Text } from '@froxy/design/components';
import { cn } from '@froxy/design/utils';
import { Link } from '@tanstack/react-router';
import { LotusModel } from '.';
Expand Down Expand Up @@ -74,13 +74,20 @@ type LotusGistLinkProps = {
children?: ReactNode;
};

// a태그 내부에서 사용될 가능성이 높아 Button 컴포넌트로 사용
export function LotusGistLink({ className, children }: LotusGistLinkProps) {
const { gistUrl } = useLotusContext();

const handleClick = (e: React.MouseEvent) => {
e.preventDefault();

location.href = gistUrl;
};

return (
<a href={gistUrl} target="_blank" rel="noreferrer" className={className}>
<Button variant={null} onClick={handleClick} rel="noreferrer" className={cn('w-7 h-7', className)}>
{children}
</a>
</Button>
);
}

Expand Down
22 changes: 11 additions & 11 deletions apps/frontend/src/widget/lotusList/SuspenseLotusCardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ export function SuspenseLotusList({ queryOptions }: { queryOptions: LotusLostQue
{lotuses?.map(({ lotus, author }) => (
<Lotus lotus={lotus} key={lotus.id}>
<User user={author}>
<div className="w-full h-full lg:w-82 p-5 shadow-md bg-white rounded-xl hover:shadow-lg hover:shadow-neutral-400 transition-shadow duration-200">
<div className="flex justify-between items-center">
<Lotus.Link>
<Lotus.Link>
<div className="w-full h-full lg:w-82 p-5 shadow-md bg-white rounded-xl hover:shadow-lg hover:shadow-neutral-400 transition-shadow duration-200">
<div className="flex justify-between items-center">
<Lotus.Title className="text-[#1C1D22]" />
</Lotus.Link>
<Lotus.GistLink className="z-10 rounded-full hover:shadow-md hover:shadow-zinc-400 p-2 transition-shadow duration-300">
<FaGithub size={20} />
</Lotus.GistLink>
</div>
<Lotus.Link>

<Lotus.GistLink className="z-10 rounded-full hover:shadow-md hover:shadow-zinc-400 p-2 transition-shadow duration-300">
<FaGithub size={20} />
</Lotus.GistLink>
</div>

<User.Name className="text-[rgba(28,29,34,0.5)]" />
<div className="w-full flex justify-between items-end">
<Lotus.CreateDate className="text-xs font-bold text-[#888DA7] bg-[rgba(136,141,167,0.1)] px-4 py-2 rounded-3xl" />
Expand All @@ -39,8 +39,8 @@ export function SuspenseLotusList({ queryOptions }: { queryOptions: LotusLostQue
<Lotus.TagList className="pt-4 min-h-8" variant={'default'} />
</>
)}
</Lotus.Link>
</div>
</div>
</Lotus.Link>
</User>
</Lotus>
))}
Expand Down
Loading