mirror of
https://github.com/penxio/penx.git
synced 2026-05-12 03:03:12 -04:00
feat: can remove favorite
This commit is contained in:
@@ -2,6 +2,7 @@ import { Box } from '@fower/react'
|
||||
import { Trash2 } from 'lucide-react'
|
||||
import { Button, ColumnsType, Table } from 'uikit'
|
||||
import { Doc, DocService } from '@penx/domain'
|
||||
import { store } from '@penx/store'
|
||||
|
||||
interface Props {
|
||||
docs: Doc[]
|
||||
@@ -44,7 +45,16 @@ export const AllDocsTable = ({ docs }: Props) => {
|
||||
render(_, item) {
|
||||
return (
|
||||
<Box toCenterY gap1>
|
||||
<Button size={28} variant="ghost" colorScheme="gray500" isSquare>
|
||||
<Button
|
||||
size={28}
|
||||
variant="ghost"
|
||||
colorScheme="gray500"
|
||||
isSquare
|
||||
onClick={async (e) => {
|
||||
e.stopPropagation()
|
||||
await store.trashDoc(item.id)
|
||||
}}
|
||||
>
|
||||
<Trash2 />
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useDoc } from '@penx/hooks'
|
||||
interface Props {}
|
||||
|
||||
export const FavoriteButton: FC<PropsWithChildren<Props>> = () => {
|
||||
const { doc, docService } = useDoc()
|
||||
const { docService } = useDoc()
|
||||
const isFavorite = docService.isFavorite()
|
||||
return (
|
||||
<Button
|
||||
|
||||
@@ -28,8 +28,6 @@ export const MorePopover = () => {
|
||||
<MenuItem
|
||||
gap2
|
||||
onClick={async () => {
|
||||
// await store.trashDoc(doc.id)
|
||||
console.log('docId:', doc.id, store.getDoc().id)
|
||||
await store.trashDoc(store.getDoc().id)
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user