feat: Add ability to star collection (#3327)
* Migrations, models, commands * ui * Move starred hint to location state * lint * tsc * refactor * Add collection empty state in expanded sidebar * Add empty placeholder within starred collections * Drag and drop improves, Relative refactor * fix: Starring untitled draft leaves empty space * fix: Creating draft in starred collection shouldnt open main * fix: Dupe drop cursor * Final fixes * fix: Canonical redirect replaces starred location state * fix: Don't show reorder cursor at the top of collection with no permission to edit when dragging
This commit is contained in:
@@ -13,7 +13,6 @@ import Document from "~/models/Document";
|
||||
import ContentEditable, { RefHandle } from "~/components/ContentEditable";
|
||||
import Star, { AnimatedStar } from "~/components/Star";
|
||||
import useEmojiWidth from "~/hooks/useEmojiWidth";
|
||||
import usePolicy from "~/hooks/usePolicy";
|
||||
import { isModKey } from "~/utils/keyboard";
|
||||
|
||||
type Props = {
|
||||
@@ -49,7 +48,6 @@ const EditableTitle = React.forwardRef(
|
||||
}: Props,
|
||||
ref: React.RefObject<RefHandle>
|
||||
) => {
|
||||
const can = usePolicy(document.id);
|
||||
const normalizedTitle =
|
||||
!value && readOnly ? document.titleWithDefault : value;
|
||||
|
||||
@@ -135,9 +133,7 @@ const EditableTitle = React.forwardRef(
|
||||
dir="auto"
|
||||
ref={ref}
|
||||
>
|
||||
{(can.star || can.unstar) && starrable !== false && (
|
||||
<StarButton document={document} size={32} />
|
||||
)}
|
||||
{starrable !== false && <StarButton document={document} size={32} />}
|
||||
</Title>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user