Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved components and fixed loading spinner #616

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions env-config/example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
SENTRY_ORG=

NEXT_PUBLIC_DSN=
NEXT_PUBLIC_ENVIRONMENT=
NEXT_RELEASE_PACKAGE_NAME=
NEXT_SENTRY_PROJECT=
NEXT_SOURCEMAPS_DIR=
NEXT_SOURCEMAPS_URL_PREFIX=
NEXT_PUBLIC_FLASK_BACKEND=
NEXT_PUBLIC_EXPRESS_BACKEND=
NEXT_PUBLIC_SPRINGBOOT_BACKEND=
NEXT_PUBLIC_ASPNETCORE_BACKEND=
NEXT_PUBLIC_LARAVEL_BACKEND=
NEXT_PUBLIC_RUBY_BACKEND=
NEXT_PUBLIC_RUBYONRAILS_BACKEND=

REACT_APP_DSN=
REACT_APP_ENGINE_SERVICE=
REACT_APP_ENVIRONMENT=
Expand Down
140 changes: 134 additions & 6 deletions next/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"prisma": "^5.21.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-loader-spinner": "~4.0.0",
"react-loader-spinner": "~6.1.6",
"react-redux": "~7.2.4",
"react-router-dom": "~6.3.0",
"react-scripts": "~5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions next/src/app/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';

import { Suspense } from 'react';

import SentryQueryInitializer from '/src/ui/SentryQueryInitializer';
import HomeContent from '/src/ui/HomeContent';
import SentryQueryInitializer from '/src/components/SentryQueryInitializer';
import HomeContent from '/src/components/HomeContent';

export default function RootLayout({
// Layouts must accept a children prop.
Expand Down
3 changes: 1 addition & 2 deletions next/src/app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ const divStyle = {


export default function Page() {
console.log("in home page");
const router = useRouter();
const { backend, frontendSlowdown } = useSearchParams();
const { backend } = useSearchParams();
const backendType = determineBackendType(backend);
const backendUrl = determineBackendUrl(backendType);
console.log('backend is ' + backendUrl);
Expand Down
5 changes: 3 additions & 2 deletions next/src/app/products-sc/page.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import ThreeDotLoader from '/src/ui/ThreeDotLoader';
import ProductCatalog from '/src/ui/ProductCatalog';
import ThreeDotLoader from '/src/components/ThreeDotLoader';
import ProductCatalog from '/src/components/ProductCatalog';
import { Suspense } from 'react';

export const dynamic = 'force-dynamic';
export const fetchCache = 'force-no-store';


export default function Products() {
// ToDo: figure out why three dot animation is frozen when rendering ThreeDotLoader or replace it
return (
<Suspense fallback={<ThreeDotLoader />}>
<ProductCatalog />
Expand Down
4 changes: 2 additions & 2 deletions next/src/app/products/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Sentry from '@sentry/nextjs';
import { connect } from 'react-redux';
import { setProducts, addProduct } from '/src/actions';
import measureRequestDuration from '/src/utils/measureRequestDuration';
import ThreeDotLoader from '/src/ui/ThreeDotLoader'
import ThreeDotLoader from '/src/components/ThreeDotLoader'
import ProductCard from '/src/components/ProductCard';
import { useState, useEffect } from 'react';
import { useSearchParams } from 'next/navigation';
Expand Down Expand Up @@ -144,7 +144,7 @@ function Products() {

getProducts(frontendSlowdown);
}, []);
return products.length > 0 ? (
return false ? (
<div>
<ul className="products-list">
{products.map((product, i) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import '/src/styles/complete.css';
import '/src/styles/product.css';



const sentryReduxEnhancer = Sentry.createReduxEnhancer({});

const store = createStore(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use client'

import Loader from 'react-loader-spinner';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep this 3 dot loader in the /ui directory? General purpose reusable components should live there and custom made ones for a particular page should be in /components

import { ThreeDots } from 'react-loader-spinner';


export default function ThreeDotLoader() {

return (
<div className="loader-container">
<Loader type="ThreeDots" color="#f6cfb2" height={150} width={150} />
<ThreeDots color="#f6cfb2" height={150} width={150} />
</div>
);
}
}
2 changes: 2 additions & 0 deletions next/src/styles/products.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@

.loader-container {
text-align: center;
display: flex;
justify-content: center;
}
Loading
Loading