Skip to content

Commit

Permalink
feat: 首页工具卡片优化
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Jan 25, 2024
1 parent 95abe3c commit f8b67d8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions frontend/src/components/ToolCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Badge, Column, Icon, LargeText, Row, Text } from "@sscreator/ui";
import { AiOutlineRight } from "react-icons/ai";
import { Badge, Card, Column, Icon, LargeText, Row, Text } from "@sscreator/ui";
import { MdKeyboardArrowRight } from "react-icons/md";
import { useLocation } from "wouter-preact";

interface Props {
Expand All @@ -21,23 +21,22 @@ export default function ToolCard({
return (
<button
type="button"
className={unavaliable ? "cursor-not-allowed" : undefined}
onClick={!unavaliable ? () => setLocation(path) : undefined}
>
<Row className="justify-between" itemsCenter>
<Column className="items-start" gap="gap-2">
<Card className="flex items-center justify-between gap-2" withPadding>
<Column gap="gap-2">
<Row gap="gap-2">
<LargeText className="text-left" bold>
{toolName}
</LargeText>
<LargeText bold>{toolName}</LargeText>
{downgraded && <Badge colorScheme="warning">降级</Badge>}
{unavaliable && <Badge colorScheme="danger">不可用</Badge>}
</Row>
<Text colorScheme="gray" className="text-left">
{description}
</Text>
</Column>
{!unavaliable && <Icon icon={<AiOutlineRight size={24} />} />}
</Row>
{!unavaliable && <Icon icon={<MdKeyboardArrowRight size={36} />} />}
</Card>
</button>
);
}

0 comments on commit f8b67d8

Please sign in to comment.