-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bose/2433' into staging
- Loading branch information
Showing
33 changed files
with
1,537 additions
and
2,209 deletions.
There are no files selected for viewing
File renamed without changes.
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,6 @@ | ||
export const localeCompareUndefined = (a: any, b: any) => { | ||
Check warning on line 1 in web/common/helpers/compare.ts GitHub Actions / check-code
|
||
if (a === undefined && b === undefined) return 0 | ||
else if (a === undefined) return -1 | ||
else if (b === undefined) return 1 | ||
else return b - a | ||
} |
36 changes: 0 additions & 36 deletions
36
web/components/src/Backgrounds/BackgroundContainer.test.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,67 @@ | ||
import envisTwMerge from '../../twMerge' | ||
import { useIntl } from 'react-intl' | ||
import { MediaButton } from '@core/MediaButton/MediaButton' | ||
import { useContext } from 'react' | ||
import { PaginationContext } from '../../common/contexts/PaginationContext' | ||
import { usePrefersReducedMotion } from '../../common/hooks/usePrefersReducedMotion' | ||
|
||
export type SimplePaginationProps = { | ||
className?: string | ||
onNextPage: () => void | ||
onPreviousPage: () => void | ||
isFirstPage: boolean | ||
isLastPage: boolean | ||
} | ||
|
||
export const SimplePagination = ({ | ||
className = '', | ||
onNextPage, | ||
onPreviousPage, | ||
isFirstPage = false, | ||
isLastPage = false, | ||
...rest | ||
}: SimplePaginationProps) => { | ||
const intl = useIntl() | ||
const { resultsRef } = useContext(PaginationContext) | ||
const prefersReducedMotion = usePrefersReducedMotion() | ||
|
||
const handleNextPagination = () => { | ||
if (!prefersReducedMotion && resultsRef?.current) { | ||
resultsRef.current.scrollIntoView({ behavior: 'smooth' }) | ||
} | ||
onNextPage() | ||
} | ||
const handlePrevPagination = () => { | ||
if (!prefersReducedMotion && resultsRef?.current) { | ||
resultsRef.current.scrollIntoView({ behavior: 'smooth' }) | ||
} | ||
onPreviousPage() | ||
} | ||
|
||
return ( | ||
<ul className={envisTwMerge(`max-w-viewport flex flex-wrap gap-2 my-2`, className)} {...rest}> | ||
<div className="flex gap-3 items-center"> | ||
<MediaButton | ||
title={intl.formatMessage({ | ||
id: 'previous', | ||
defaultMessage: 'Previous', | ||
})} | ||
mode="previous" | ||
disabled={isFirstPage} | ||
onClick={handlePrevPagination} | ||
className="" | ||
/> | ||
<MediaButton | ||
title={intl.formatMessage({ | ||
id: 'next', | ||
defaultMessage: 'Next', | ||
})} | ||
mode="next" | ||
disabled={isLastPage} | ||
onClick={handleNextPagination} | ||
className="" | ||
/> | ||
</div> | ||
</ul> | ||
) | ||
} |
Oops, something went wrong.