forked from rooch-network/rooch
-
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.
[portal]: ui improvements (rooch-network#1659)
* chore: comment the session guard * refactor: get assets using SDK * feat: add pagination component on BTC page * feat: add pagination component on Ordi page * feat: add pagination component on NFT page * feat: add some comments * chore: uncomment the SDK functionalities * chore: uncomment the SDK functionalities on indexed-assets-ordi.tsx * refactor: add transfer modal and pagination on assets-coin.tsx * refactor: add pagination on indexed-assets-btc.tsx * refactor: add pagination on indexed-assets-ordi.tsx * feat: update next page logic on the custom-pagination.tsx * feat: update next page logic on the assets-nft.tsx * feat: add loading component for assets page * feat: add loading component for assets-nft.tsx * feat: update gitignore * chore: change the sdk usage on package.json * chore: update .gitignore * chore: update the pnpm-lock.yaml * chore: fix the type bugs on Session modal * chore: fix some import bugs on asset-coin.tsx
- Loading branch information
1 parent
4197fce
commit 6c55f9d
Showing
11 changed files
with
660 additions
and
307 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -23,3 +23,6 @@ dist-ssr | |
*.sln | ||
*.sw? | ||
script/nohup.out | ||
|
||
# script logs | ||
.script/nohup.out |
Large diffs are not rendered by default.
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,62 @@ | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import React from 'react' | ||
import { | ||
Pagination, | ||
PaginationContent, | ||
PaginationItem, | ||
PaginationLink, | ||
PaginationNext, | ||
PaginationPrevious, | ||
} from '@/components/ui/pagination.tsx' | ||
|
||
interface PaginationComponentProps { | ||
currentPage: number | ||
hasNextPage: boolean | ||
onPageChange: (page: number) => void | ||
} | ||
|
||
const PaginationComponent: React.FC<PaginationComponentProps> = ({ | ||
currentPage, | ||
hasNextPage, | ||
onPageChange, | ||
}) => { | ||
return ( | ||
<Pagination className="mt-6 justify-end"> | ||
<PaginationContent> | ||
<PaginationItem> | ||
<PaginationPrevious | ||
href="#" | ||
onClick={() => currentPage > 0 && onPageChange(currentPage - 1)} | ||
className={`cursor-pointer border-none hover:bg-inherit ${ | ||
currentPage <= 0 ? 'text-gray-500 cursor-not-allowed hover:text-gray-500' : '' | ||
}`} | ||
isActive={currentPage <= 0} | ||
/> | ||
</PaginationItem> | ||
<PaginationItem> | ||
<PaginationLink | ||
href="#" | ||
onClick={() => onPageChange(currentPage)} | ||
isActive={true} | ||
className="cursor-pointer" | ||
> | ||
{currentPage + 1} | ||
</PaginationLink> | ||
</PaginationItem> | ||
<PaginationItem> | ||
<PaginationNext | ||
href="#" | ||
onClick={() => currentPage > 0 && onPageChange(currentPage + 1)} | ||
className={`cursor-pointer border-none hover:bg-inherit ${ | ||
!hasNextPage ? 'text-gray-500 cursor-not-allowed hover:text-gray-500' : '' | ||
}`} | ||
isActive={hasNextPage} | ||
/> | ||
</PaginationItem> | ||
</PaginationContent> | ||
</Pagination> | ||
) | ||
} | ||
|
||
export default PaginationComponent |
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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import * as React from "react" | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import * as React from 'react' | ||
|
||
import { cn } from "@/lib/utils" | ||
import { cn } from '@/lib/utils' | ||
|
||
export interface TextareaProps | ||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
|
||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", | ||
className | ||
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', | ||
className, | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
} | ||
}, | ||
) | ||
Textarea.displayName = "Textarea" | ||
Textarea.displayName = 'Textarea' | ||
|
||
export { Textarea } |
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
Oops, something went wrong.