aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionCarousel3DView.tsx
diff options
context:
space:
mode:
authorMelissa Zhang <mzhang19096@gmail.com>2020-05-26 23:33:31 -0700
committerMelissa Zhang <mzhang19096@gmail.com>2020-05-26 23:33:31 -0700
commit04e285a5b65d0b66c0792fafcd97d7f80e05b7f4 (patch)
treef0649c53221016912ac85456eebb4723ad651059 /src/client/views/collections/CollectionCarousel3DView.tsx
parent481ce09aa523de3792295e766c1bc4c80982bf53 (diff)
added dots bar for navigating through carousel
Diffstat (limited to 'src/client/views/collections/CollectionCarousel3DView.tsx')
-rw-r--r--src/client/views/collections/CollectionCarousel3DView.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionCarousel3DView.tsx b/src/client/views/collections/CollectionCarousel3DView.tsx
index 9665e23ff..aefac3512 100644
--- a/src/client/views/collections/CollectionCarousel3DView.tsx
+++ b/src/client/views/collections/CollectionCarousel3DView.tsx
@@ -141,6 +141,13 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
</>;
}
+ @computed get dots() {
+ return (this.childLayoutPairs.map((_child, index) => {
+ return <div key={index} className={`dot${index === NumCast(this.layoutDoc._itemIndex) ? "-active" : ""}`}
+ onClick={() => this.layoutDoc._itemIndex = index} />;
+ }));
+ }
+
render() {
const index = NumCast(this.layoutDoc._itemIndex);
const offset = (index - 1) * (this.mainPanelWidth() - this.sidePanelWidth()) / this.childLayoutPairs.length;
@@ -151,6 +158,9 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
{this.content}
</div>
{this.props.Document._chromeStatus !== "replaced" ? this.buttons : (null)}
+ <div className="dot-bar">
+ {this.dots}
+ </div>
</div>;
}
} \ No newline at end of file