Skip to content

Commit

Permalink
Merge pull request #101 from traP-jp/client/feat/stampPicker
Browse files Browse the repository at this point in the history
feat: StampPickerコンポーネントを修正
  • Loading branch information
reiroop authored Jan 25, 2025
2 parents c0aeea2 + 329933f commit 050b586
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions client/src/components/StampPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
import { SmileOutlined } from "@ant-design/icons";
import { Button, Popover } from "antd";
import React, { useState } from "react";
import Reaction, { ReactionAssets } from "../model/reactions";

export const StampPicker: React.FC = () => {
const [isPopoverOpen, setPopoverOpen] = useState(false);
const icons = Array(20).fill(<SmileOutlined />);
const reactions: Reaction[] = Array(8)
.fill([
{
id: "1",
userId: "1",
position: { x: 0, y: 0 },
kind: "iine",
createdAt: new Date(),
expiresAt: new Date(),
},
{
id: "2",
userId: "2",
position: { x: 0, y: 0 },
kind: "kusa",
createdAt: new Date(),
expiresAt: new Date(),
},
{
id: "3",
userId: "3",
position: { x: 0, y: 0 },
kind: "pro",
createdAt: new Date(),
expiresAt: new Date(),
},
])
.flat();

return (
<Popover
content={
<div className="grid grid-cols-4 gap-2">
{icons.map((icon, index) => (
{reactions.map((reaction, index) => (
<Button
key={index}
type="text"
icon={icon}
icon={
<img src={ReactionAssets[reaction.kind]} alt={reaction.kind} />
}
className="hover:bg-background-secondary"
/>
))}
Expand Down

0 comments on commit 050b586

Please sign in to comment.