diff --git a/package.json b/package.json index bb6d7fab..5c94bca5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "axios": "^0.27.2", "bootstrap": "4.6.1", "chart.js": "^2.9.3", + "crypto": "^1.0.1", "d3": "6.7.0", "dayjs": "1.11.7", "from-exponential": "^1.1.1", @@ -20,12 +21,11 @@ "popper.js": "^1.16.1", "prop-types": "15.8.1", "react": "17.0.1", - "react-bootstrap-typeahead": "^6.0.0", + "react-bootstrap-typeahead": "6.0.0", "react-chartjs-2": "^2.8.0", "react-dom": "17.0.1", "react-google-recaptcha": "^3.1.0", "react-helmet": "^6.1.0", - "react-particles-js": "3.5.3", "react-redux": "8.0.5", "react-router-dom": "^5.1.2", "react-scripts": "5.0.1", @@ -33,8 +33,9 @@ "react-tooltip": "^5.11.2", "redux": "^4.0.1", "redux-thunk": "^2.3.0", - "tsparticles": "1.36.0", "victory": "36.4.1", + "vis-data": "^7.1.7", + "vis-network": "^9.1.8", "vis-network-react": "^1.3.6" }, "scripts": { @@ -80,6 +81,7 @@ "autoprefixer": "10.4.5" }, "jest": { + "transform": {}, "transformIgnorePatterns": [ "/node_modules/(?!(vis-network|vis-data))" ] diff --git a/src/Footer/footer.jsx b/src/Footer/footer.jsx index 396bad26..2b85f708 100644 --- a/src/Footer/footer.jsx +++ b/src/Footer/footer.jsx @@ -5,7 +5,7 @@ import React from 'react'; * * @returns {object} JSX representation of the global footer. */ -export function Footer() { +function Footer() { // Get current copyright year const getCopyrightYear = () => { const today = new Date(); diff --git a/src/LandingPage/components/backgroundVideo.jsx b/src/LandingPage/components/backgroundVideo.jsx new file mode 100644 index 00000000..da80d5af --- /dev/null +++ b/src/LandingPage/components/backgroundVideo.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import VideoMoleculeNetwork from '../../assets/LandingPageGraphics/background_video_molecules_221511488.mp4'; + +function BackgroundVideo() { + return ( + + ); +} + +export default BackgroundVideo; diff --git a/src/LandingPage/landingPage.jsx b/src/LandingPage/landingPage.jsx index bb24ae73..70bc391e 100644 --- a/src/LandingPage/landingPage.jsx +++ b/src/LandingPage/landingPage.jsx @@ -13,9 +13,9 @@ import IconSet from '../lib/iconSet'; import LayerRunner from '../assets/LandingPageGraphics/Data_Layer_Runner.png'; import RatFigurePaass1b from '../assets/LandingPageGraphics/rat-figure-pass1b.svg'; import DifferentialAnalytesHeatmap from '../assets/LandingPageGraphics/figure1c-differential-analytes-grid.svg'; -import VideoMoleculeNetwork from '../assets/LandingPageGraphics/background_video_molecules_221511488.mp4'; import TutorialVideoPreviewImage from '../assets/LandingPageGraphics/tutorial_video_preview_image.jpg'; import LandscapePreprintAbstract from '../assets/LandingPageGraphics/landscape_preprint_abstract.jpg'; +import BackgroundVideo from './components/backgroundVideo'; // import figure 4E visualization dataset const figure4eData = require('../data/landscape_figure_4e.json'); @@ -148,7 +148,9 @@ export function LandingPage({ isAuthenticated, profile }) { useEffect(() => { // set video height responsively const el = document.querySelector('#iframe-container'); - setVideoHeight(((el.scrollWidth - 30) / 16) * 9 + 'px'); + if (el) { + setVideoHeight(((el.scrollWidth - 30) / 16) * 9 + 'px'); + } }, []); const handleAddNode = useCallback(() => { @@ -184,9 +186,7 @@ export function LandingPage({ isAuthenticated, profile }) {
- +

About MoTrPAC

diff --git a/src/sass/_base.scss b/src/sass/_base.scss index c3f65a67..45af9e8e 100644 --- a/src/sass/_base.scss +++ b/src/sass/_base.scss @@ -45,7 +45,11 @@ body.homepage { padding-top: 4.30rem; &.authenticated { - padding-top: 4.50rem; + padding-top: 4.30rem; + } + + &.homepage { + padding-top: 0; } } } diff --git a/src/sass/_landingPage.scss b/src/sass/_landingPage.scss index 3124b9b3..4a324160 100644 --- a/src/sass/_landingPage.scss +++ b/src/sass/_landingPage.scss @@ -27,15 +27,15 @@ .animated-down-arrow { position: absolute; - bottom: 4rem; + bottom: 0.5rem; text-align: center; z-index: 5; img { - width: 3.0rem; - height: 3.0rem; + width: 2.75rem; + height: 2.75rem; margin: 0 auto !important; - opacity: 0.65; + opacity: 0.55; } } @@ -113,8 +113,8 @@ background-image: url(./assets/LandingPageGraphics/background_molecule_network_horizontal_wave.jpg); .section-content-container { - height: 65vh; - margin-top: -5.0rem; + height: 60vh; + margin-top: -3.0rem; padding-top: 15px; padding-bottom: 15px; diff --git a/src/setupTests.js b/src/setupTests.js index b8be4a7d..8abf8b5e 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -1,6 +1,8 @@ import { configure } from 'enzyme'; import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; +const crypto = require('crypto'); + configure({ adapter: new Adapter() }); require('jest-canvas-mock'); @@ -8,5 +10,19 @@ require('jest-canvas-mock'); jest.mock('react-chartjs-2', () => ({ Bar: () => null, Pie: () => null, - Doughnut: () => null + Doughnut: () => null, })); + +// fix for 'crypto.getRandomValues() not supported' error +Object.defineProperty(globalThis, 'crypto', { + value: { + getRandomValues: (arr) => crypto.randomBytes(arr.length), + }, +}); + +// fix for 'unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering' error +// when