-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Include avatar in User model and update related components
- Loading branch information
1 parent
2bab42f
commit a00ae32
Showing
5 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useState } from "preact/hooks" | ||
import { Container3D } from "./Container3D" | ||
import { MemberCard } from "./MemberCard" | ||
|
||
export const SharedMemberCard = ({ stickers = [], number, avatar, username }: { stickers: string[], number: number, avatar: string, username: string }) => { | ||
const [selectedStickers, setSelectedStickers] = useState(() => { | ||
const stickersList = new Array(3).fill(null) | ||
stickers.forEach((sticker, index) => { | ||
stickersList[index] = sticker | ||
}) | ||
return { | ||
limit: 3, | ||
list: stickersList, | ||
} | ||
}) | ||
|
||
return ( | ||
<Container3D> | ||
<MemberCard | ||
className="max-w-[400px] md:max-w-[700px] mx-auto" | ||
number={number} | ||
selectedStickers={selectedStickers} | ||
user={{ | ||
avatar, | ||
username, | ||
}} | ||
/> | ||
</Container3D> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters