diff options
| author | mehekj <mehek.jethani@gmail.com> | 2022-06-20 18:27:29 -0400 |
|---|---|---|
| committer | mehekj <mehek.jethani@gmail.com> | 2022-06-20 18:27:29 -0400 |
| commit | 3415f672292bb349c7d9ec66564933a746ee3b25 (patch) | |
| tree | 69e3c6284211fbaf8fc51f8b661ca855165c701e /src/client/views/nodes/button/FontIconBadge.tsx | |
| parent | 145117365b2708ef6b365c6f0f10c38b85a87307 (diff) | |
Revert "Merge branch 'master' into temporalmedia-mehek"
This reverts commit 145117365b2708ef6b365c6f0f10c38b85a87307, reversing
changes made to 7eedde332010c8896be636f0b5c6a7b2c8043e48.
Diffstat (limited to 'src/client/views/nodes/button/FontIconBadge.tsx')
| -rw-r--r-- | src/client/views/nodes/button/FontIconBadge.tsx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/client/views/nodes/button/FontIconBadge.tsx b/src/client/views/nodes/button/FontIconBadge.tsx index df17d603f..cf86b5e07 100644 --- a/src/client/views/nodes/button/FontIconBadge.tsx +++ b/src/client/views/nodes/button/FontIconBadge.tsx @@ -6,31 +6,31 @@ import { emptyFunction, returnFalse, setupMoveUpEvents } from "../../../../Utils import { DragManager } from "../../../util/DragManager"; import "./FontIconBadge.scss"; -interface FontIconBadgeProps { - value: string | undefined; +interface FontIconBadgeProps { + collection: Doc | undefined; } @observer export class FontIconBadge extends React.Component<FontIconBadgeProps> { _notifsRef = React.createRef<HTMLDivElement>(); - // onPointerDown = (e: React.PointerEvent) => { - // setupMoveUpEvents(this, e, - // (e: PointerEvent) => { - // const dragData = new DragManager.DocumentDragData([this.props.collection!]); - // DragManager.StartDocumentDrag([this._notifsRef.current!], dragData, e.x, e.y); - // return true; - // }, - // returnFalse, emptyFunction, false); - // } + onPointerDown = (e: React.PointerEvent) => { + setupMoveUpEvents(this, e, + (e: PointerEvent) => { + const dragData = new DragManager.DocumentDragData([this.props.collection!]); + DragManager.StartDocumentDrag([this._notifsRef.current!], dragData, e.x, e.y); + return true; + }, + returnFalse, emptyFunction, false); + } render() { - if (this.props.value === undefined) return (null); + if (!(this.props.collection instanceof Doc)) return (null); + const length = DocListCast(this.props.collection.data).filter(d => GetEffectiveAcl(d) !== AclPrivate).length; // Object.keys(d).length).length; // filter out any documents that we can't read return <div className="fontIconBadge-container" ref={this._notifsRef}> - <div className="fontIconBadge" style={{ "display": "initial" }} - // onPointerDown={this.onPointerDown} - > - {this.props.value} + <div className="fontIconBadge" style={length > 0 ? { "display": "initial" } : { "display": "none" }} + onPointerDown={this.onPointerDown} > + {length} </div> </div>; } |
