aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/newlightbox/ExploreView
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-19 01:01:02 -0400
committerbobzel <zzzman@gmail.com>2024-05-19 01:01:02 -0400
commit6e72f969029c22fe797397a6437836a0482260b6 (patch)
treee8ccde75702e557b2226c9069263e1bc3bd21a4b /src/client/views/newlightbox/ExploreView
parent5ff0bef5d3c4825aa7210a26c98aae3b24f4a835 (diff)
parent13dc6de0e0099f699ad0d2bb54401e6a0aa25018 (diff)
Merge branch 'restoringEslint' into alyssa-starter
Diffstat (limited to 'src/client/views/newlightbox/ExploreView')
-rw-r--r--src/client/views/newlightbox/ExploreView/ExploreView.tsx30
-rw-r--r--src/client/views/newlightbox/ExploreView/index.ts2
-rw-r--r--src/client/views/newlightbox/ExploreView/utils.ts21
3 files changed, 28 insertions, 25 deletions
diff --git a/src/client/views/newlightbox/ExploreView/ExploreView.tsx b/src/client/views/newlightbox/ExploreView/ExploreView.tsx
index a1d6375c4..f8c07cc43 100644
--- a/src/client/views/newlightbox/ExploreView/ExploreView.tsx
+++ b/src/client/views/newlightbox/ExploreView/ExploreView.tsx
@@ -1,32 +1,34 @@
-import './ExploreView.scss';
-import { IBounds, IExploreView, emptyBounds } from './utils';
-import { IRecommendation } from '../components';
+/* eslint-disable jsx-a11y/no-static-element-interactions */
+/* eslint-disable jsx-a11y/click-events-have-key-events */
import * as React from 'react';
-import { NewLightboxView } from '../NewLightboxView';
import { StrCast } from '../../../../fields/Types';
+import { NewLightboxView } from '../NewLightboxView';
+import './ExploreView.scss';
+import { IExploreView, emptyBounds } from './utils';
-export const ExploreView = (props: IExploreView) => {
+export function ExploreView(props: IExploreView) {
const { recs, bounds = emptyBounds } = props;
return (
- <div className={`exploreView-container`}>
+ <div className="exploreView-container">
{recs &&
recs.map(rec => {
- const x_bound: number = Math.max(Math.abs(bounds.max_x), Math.abs(bounds.min_x));
- const y_bound: number = Math.max(Math.abs(bounds.max_y), Math.abs(bounds.min_y));
+ const xBound: number = Math.max(Math.abs(bounds.max_x), Math.abs(bounds.min_x));
+ const yBound: number = Math.max(Math.abs(bounds.max_y), Math.abs(bounds.min_y));
if (rec.embedding) {
- const x = (rec.embedding.x / x_bound) * 50;
- const y = (rec.embedding.y / y_bound) * 50;
+ const x = (rec.embedding.x / xBound) * 50;
+ const y = (rec.embedding.y / yBound) * 50;
return (
- <div className={`exploreView-doc`} onClick={() => {}} style={{ top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)` }}>
+ <div className="exploreView-doc" onClick={() => {}} style={{ top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)` }}>
{rec.title}
</div>
);
- } else return null;
+ }
+ return null;
})}
- <div className={`exploreView-doc`} style={{ top: `calc(50% + ${0}%)`, left: `calc(50% + ${0}%)`, background: '#073763', color: 'white' }}>
+ <div className="exploreView-doc" style={{ top: `calc(50% + ${0}%)`, left: `calc(50% + ${0}%)`, background: '#073763', color: 'white' }}>
{StrCast(NewLightboxView.LightboxDoc?.title)}
</div>
</div>
);
-};
+}
diff --git a/src/client/views/newlightbox/ExploreView/index.ts b/src/client/views/newlightbox/ExploreView/index.ts
index bf94eedcd..f2ebf511f 100644
--- a/src/client/views/newlightbox/ExploreView/index.ts
+++ b/src/client/views/newlightbox/ExploreView/index.ts
@@ -1 +1 @@
-export * from './ExploreView' \ No newline at end of file
+export * from './ExploreView';
diff --git a/src/client/views/newlightbox/ExploreView/utils.ts b/src/client/views/newlightbox/ExploreView/utils.ts
index 7d9cf226d..2d1bd75a9 100644
--- a/src/client/views/newlightbox/ExploreView/utils.ts
+++ b/src/client/views/newlightbox/ExploreView/utils.ts
@@ -1,20 +1,21 @@
-import { IRecommendation } from "../components";
+import { IRecommendation } from '../components';
export interface IExploreView {
- recs?: IRecommendation[],
- bounds?: IBounds
+ recs?: IRecommendation[];
+ // eslint-disable-next-line no-use-before-define
+ bounds?: IBounds;
}
export const emptyBounds = {
max_x: 0,
max_y: 0,
min_x: 0,
- min_y: 0
-}
+ min_y: 0,
+};
export interface IBounds {
- max_x: number,
- max_y: number,
- min_x: number,
- min_y: number
-} \ No newline at end of file
+ max_x: number;
+ max_y: number;
+ min_x: number;
+ min_y: number;
+}