aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authoraidahosa1 <aisosa_idahosa@brown.edu>2024-07-14 14:06:10 -0400
committeraidahosa1 <aisosa_idahosa@brown.edu>2024-07-14 14:06:10 -0400
commit3e46e59b3919458d945745f457d8c76f13094796 (patch)
treee1608e8bbcd8c63e33785ac9c7fb407da6bc0455 /src/client/views/collections
parent5a7eee0c82c28b609b3ce628a918bd4209464579 (diff)
in it to win it
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 60befebec..907a5a343 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -613,9 +613,11 @@ export class CollectionCardView extends CollectionSubView() {
const isEmpty = this.childDocsWithoutLinks.length === 0;
const isDesc = BoolCast(this.Document.cardSort_isDesc)
+ console.log(this.childDocsWithoutLinks.length + "length")
+
if (isEmpty) {
return (
- <span className="no-card-span" style={{ width: `100%` }}>
+ <span className="no-card-span" style={{ width: ` ${this._props.PanelWidth()}px`, height: ` ${this._props.PanelHeight()}px` }}>
Sorry ! There are no cards in this group
</span>
);
@@ -676,6 +678,10 @@ export class CollectionCardView extends CollectionSubView() {
};
render() {
+ const isEmpty = this.childDocsWithoutLinks.length === 0;
+ const transformValue = `scale(${1 / this.fitContentScale})`;
+ const heightValue = `${100 * this.fitContentScale}%`;
+
return (
<div
onPointerMove={e => this.onPointerMove(e)}
@@ -688,9 +694,9 @@ export class CollectionCardView extends CollectionSubView() {
<div
className="card-wrapper"
style={{
- transform: ` scale(${1 / this.fitContentScale})`,
- height: `${100 * this.fitContentScale}%`,
- gridAutoRows: `${100/this.numRows}%`
+ ...(!isEmpty && { transform: transformValue }),
+ ...(!isEmpty && { height: heightValue }),
+ gridAutoRows: `${100 / this.numRows}%`
}}
onMouseLeave={() => this.setHoveredNodeIndex(-1)}>
{this.renderCards()}
@@ -698,4 +704,5 @@ export class CollectionCardView extends CollectionSubView() {
</div>
);
}
+
}