diff --git a/components/lobby/CreateRoomModal/GameListModal/GameList/index.tsx b/components/lobby/CreateRoomModal/GameListModal/GameList/index.tsx index 8a74ef2d..2a267e97 100644 --- a/components/lobby/CreateRoomModal/GameListModal/GameList/index.tsx +++ b/components/lobby/CreateRoomModal/GameListModal/GameList/index.tsx @@ -14,7 +14,7 @@ type GroupedGamesType = { function GameList({ gameList, onGameChange, activeGameId }: GameListProp) { const groupedGames = gameList.reduce((result: GroupedGamesType, game) => { - const category = game.category || "其他"; + const category = "其他"; if (!result[category]) { result[category] = []; } diff --git a/components/shared/Button/v2/Button.tsx b/components/shared/Button/v2/Button.tsx index 92819f68..d9138c3b 100644 --- a/components/shared/Button/v2/Button.tsx +++ b/components/shared/Button/v2/Button.tsx @@ -7,6 +7,7 @@ import { PolymorphicRef } from "@/lib/types"; export enum ButtonVariant { PRIMARY = "primary", + PRIMARY_TRANSPARENT = "primaryTransparent", SECONDARY = "secondary", HIGHLIGHT = "highlight", } @@ -22,6 +23,8 @@ const commonDisabledClasses = const buttonTypeClasses: Record = { primary: "text-primary-700 bg-primary-200 hover:text-primary-50 hover:bg-primary-300 active:text-primary-50 active:bg-primary-400", + primaryTransparent: + "text-primary-800 bg-primary-200/60 hover:text-primary-800 hover:bg-primary-300/50 active:text-primary-800 active:bg-primary-300/50", secondary: "text-primary-200 bg-transparent hover:bg-primary-300/40 active:bg-primary-200/20 disabled:bg-transparent disabled:border", highlight: @@ -51,6 +54,8 @@ type InnerButtonComponent = ( const iconTypeClasses: Record = { primary: "stroke-primary-700 hover:stroke-primary-50 active:stroke-primary-50", + primaryTransparent: + "stroke-primary-700 hover:stroke-primary-700 active:stroke-primary-700", secondary: "stroke-primary-200 disabled:stroke-grey-500", highlight: "stroke-primary-50", }; diff --git a/components/shared/Carousel/v2/Carousel.stories.tsx b/components/shared/Carousel/v2/Carousel.stories.tsx index ec6d9e42..27cc64a7 100644 --- a/components/shared/Carousel/v2/Carousel.stories.tsx +++ b/components/shared/Carousel/v2/Carousel.stories.tsx @@ -21,7 +21,7 @@ const meta: Meta = { }, ], args: { - uniqueKey: "name", + renderKey: (props: any) => props.name, items: [{ name: "TEST 1" }, { name: "TEST 2" }, { name: "TEST 3" }], Component: Card, }, diff --git a/components/shared/Carousel/v2/Carousel.tsx b/components/shared/Carousel/v2/Carousel.tsx index 5c010fd7..3f1249bb 100644 --- a/components/shared/Carousel/v2/Carousel.tsx +++ b/components/shared/Carousel/v2/Carousel.tsx @@ -1,18 +1,15 @@ -import { CSSProperties, FC, useEffect, useRef, useState } from "react"; +import { CSSProperties, FC, Key, useEffect, useRef, useState } from "react"; import Icon from "../../Icon/v2/Icon"; -interface CarouselProps< - Item extends Record, - Key extends keyof Item = keyof Item, -> { - items: (Item & Record)[]; - uniqueKey: Key; +interface CarouselProps> { + items: Item[]; + renderKey: (item: Item) => Key; Component: FC; } export default function Carousel>({ items, - uniqueKey, + renderKey, Component, }: Readonly>) { const [showIndex, setShowIndex] = useState(0); @@ -68,7 +65,7 @@ export default function Carousel>({ {Array.isArray(items) && items.map((item) => (
  • ) => void; }; @@ -23,7 +24,7 @@ export default function Chat({ lobbyMessages, friendList, roomMessages, - maxHeight = "calc(100vh - 168px)", + className, onSubmit, }: Readonly) { const [messages, setMessages] = useState(lobbyMessages); @@ -74,17 +75,14 @@ export default function Chat({ }; return ( -
    +
    -
    +
    {isFriendList ? ( +
    {messages.map(({ from, content }, index) => { diff --git a/components/shared/Header.tsx b/components/shared/Header.tsx index d0cd3111..8ed31784 100644 --- a/components/shared/Header.tsx +++ b/components/shared/Header.tsx @@ -21,10 +21,14 @@ interface ButtonProps { } interface HeaderProps { + className?: string; onClickChatButton: () => void; } -export default function Header({ onClickChatButton }: Readonly) { +export default function Header({ + className, + onClickChatButton, +}: Readonly) { const [openProfile, setOpenProfile] = useState(false); const buttons: ButtonProps[] = [ @@ -51,7 +55,12 @@ export default function Header({ onClickChatButton }: Readonly) { ]; return ( -
    +

    遊戲微服務大平台

    diff --git a/components/shared/Sidebar.tsx b/components/shared/Sidebar.tsx index cfdaad59..8d4b2232 100644 --- a/components/shared/Sidebar.tsx +++ b/components/shared/Sidebar.tsx @@ -20,7 +20,11 @@ interface RouteProps { isShow: boolean; } -export default function Sidebar() { +interface SidebarProps { + className?: string; +} + +export default function Sidebar({ className }: SidebarProps) { const { pathname } = useRouter(); const { currentUser } = useAuth(); const { logout, getRoomId } = useUser(); @@ -52,7 +56,12 @@ export default function Sidebar() { }; return ( -