feat(BOOK-743): Replaced deprecated Button component
Approved-by: Bianca Widstam
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
|
||||
import { ShowMoreButton } from "@scandic-hotels/design-system/ShowMoreButton"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Grids from "@/components/TempDesignSystem/Grids"
|
||||
@@ -8,7 +9,6 @@ import useLang from "@/hooks/useLang"
|
||||
|
||||
import ListContainer from "../ListContainer"
|
||||
import OldStayCard from "../OldStayCard"
|
||||
import ShowMoreButton from "../ShowMoreButton"
|
||||
|
||||
import type {
|
||||
PreviousStaysClientProps,
|
||||
@@ -58,7 +58,7 @@ export function ClientPreviousStays({
|
||||
))}
|
||||
</Grids.Stackable>
|
||||
{hasNextPage ? (
|
||||
<ShowMoreButton disabled={isFetching} loadMoreData={loadMoreData} />
|
||||
<ShowMoreButton isPending={isFetching} loadMoreData={loadMoreData} />
|
||||
) : null}
|
||||
</ListContainer>
|
||||
)
|
||||
|
||||
@@ -6,13 +6,13 @@ import { useIntl } from "react-intl"
|
||||
import { useSidePeekScrollToTop } from "@scandic-hotels/common/hooks/useSidePeekScrollToTop"
|
||||
import { BackToTopButton } from "@scandic-hotels/design-system/BackToTopButton"
|
||||
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
|
||||
import { ShowMoreButton } from "@scandic-hotels/design-system/ShowMoreButton"
|
||||
import SidePeekSelfControlled from "@scandic-hotels/design-system/SidePeekSelfControlled"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import ShowMoreButton from "../../ShowMoreButton"
|
||||
import { StayCard } from "../../StayCard"
|
||||
import { groupStaysByYear } from "../../utils/groupStaysByYear"
|
||||
|
||||
@@ -113,7 +113,7 @@ export function PreviousStaysSidePeek({
|
||||
))}
|
||||
{hasNextPage && (
|
||||
<ShowMoreButton
|
||||
disabled={isFetching}
|
||||
isPending={isFetching}
|
||||
loadMoreData={loadMoreData}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||
|
||||
import styles from "./button.module.css"
|
||||
|
||||
import type { ShowMoreButtonParams } from "@/types/components/myPages/stays/button"
|
||||
|
||||
export default function ShowMoreButton({
|
||||
disabled,
|
||||
loadMoreData,
|
||||
}: ShowMoreButtonParams) {
|
||||
const intl = useIntl()
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Button
|
||||
disabled={disabled}
|
||||
onClick={loadMoreData}
|
||||
variant="icon"
|
||||
type="button"
|
||||
theme="base"
|
||||
intent="text"
|
||||
>
|
||||
<MaterialIcon
|
||||
icon="keyboard_arrow_down"
|
||||
size={20}
|
||||
color="CurrentColor"
|
||||
/>
|
||||
{intl.formatMessage({
|
||||
id: "common.showMore",
|
||||
defaultMessage: "Show more",
|
||||
})}
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
|
||||
import { ShowMoreButton } from "@scandic-hotels/design-system/ShowMoreButton"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Grids from "@/components/TempDesignSystem/Grids"
|
||||
@@ -8,7 +9,6 @@ import useLang from "@/hooks/useLang"
|
||||
|
||||
import ListContainer from "../ListContainer"
|
||||
import OldStayCard from "../OldStayCard"
|
||||
import ShowMoreButton from "../ShowMoreButton"
|
||||
|
||||
import type {
|
||||
UpcomingStaysClientProps,
|
||||
@@ -58,7 +58,7 @@ export default function ClientUpcomingStays({
|
||||
))}
|
||||
</Grids.Stackable>
|
||||
{hasNextPage ? (
|
||||
<ShowMoreButton disabled={isFetching} loadMoreData={loadMoreData} />
|
||||
<ShowMoreButton isPending={isFetching} loadMoreData={loadMoreData} />
|
||||
) : null}
|
||||
</ListContainer>
|
||||
) : null
|
||||
|
||||
@@ -6,13 +6,13 @@ import { useIntl } from "react-intl"
|
||||
import { useSidePeekScrollToTop } from "@scandic-hotels/common/hooks/useSidePeekScrollToTop"
|
||||
import { BackToTopButton } from "@scandic-hotels/design-system/BackToTopButton"
|
||||
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
|
||||
import { ShowMoreButton } from "@scandic-hotels/design-system/ShowMoreButton"
|
||||
import SidePeekSelfControlled from "@scandic-hotels/design-system/SidePeekSelfControlled"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import ShowMoreButton from "../../ShowMoreButton"
|
||||
import { StayCard } from "../../StayCard"
|
||||
import { groupStaysByYear } from "../../utils/groupStaysByYear"
|
||||
|
||||
@@ -113,7 +113,7 @@ export function UpcomingStaysSidePeek({
|
||||
))}
|
||||
{hasNextPage && (
|
||||
<ShowMoreButton
|
||||
disabled={isFetching}
|
||||
isPending={isFetching}
|
||||
loadMoreData={loadMoreData}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user