-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Missing paginations and paddings (#9)
* Missing paginations and padding * Add padding on digest edit page * Clean code
- Loading branch information
Showing
11 changed files
with
67 additions
and
47 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,43 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import Pagination from '../list/Pagination'; | ||
import clsx from 'clsx'; | ||
import { useSearchParams, useRouter, usePathname } from 'next/navigation'; | ||
import { useTransition } from 'react'; | ||
|
||
export const BookmarksControls = ({ | ||
linkCount, | ||
}: { linkCount: number } & PropsWithChildren) => { | ||
const searchParams = useSearchParams(); | ||
const path = usePathname(); | ||
let [isPending, startTransition] = useTransition(); | ||
const { replace } = useRouter(); | ||
|
||
return ( | ||
<div className="flex items-center justify-center gap-3"> | ||
<button | ||
title="Show unused bookmarks" | ||
className={clsx( | ||
'm-1 relative top-[2px] inline-flex items-center rounded-full border py-1 px-3 text-sm font-bold cursor-pointer transition ease-in-out duration-150 focus:outline-none', | ||
searchParams?.get('all') === 'true' && | ||
'bg-gray-900 text-white border-black', | ||
searchParams?.get('all') !== 'false' && 'opacity-40 hover:opacity-100' | ||
)} | ||
onClick={() => { | ||
if (!searchParams) return; | ||
const params = new URLSearchParams(searchParams); | ||
if (params.get('all') === 'true') { | ||
params.delete('all'); | ||
} else { | ||
params.set('all', 'true'); | ||
} | ||
startTransition(() => { | ||
replace(path + `?${params.toString()}`); | ||
}); | ||
}} | ||
> | ||
All bookmarks | ||
</button> | ||
<Pagination totalItems={linkCount} className="h-6" /> | ||
</div> | ||
); | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
src/components/digests/block-card/bookmark-card/card-style/Block.tsx
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
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
5427a77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
digestclub – ./
digestclub.vercel.app
digestclub-premieroctet.vercel.app
digestclub-git-main-premieroctet.vercel.app