Skip to content

Commit

Permalink
made format changes and fixed issue #510
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankush1oo8 committed Nov 22, 2024
1 parent 691dfd5 commit 9172507
Showing 1 changed file with 39 additions and 43 deletions.
82 changes: 39 additions & 43 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
import React from "react";
import { Helmet } from "react-helmet";
import React from 'react';
import { Helmet } from 'react-helmet';

import { useIntl } from "@edx/frontend-platform/i18n";
import { logError } from "@edx/frontend-platform/logging";
import { initializeHotjar } from "@edx/frontend-enterprise-hotjar";
import { useIntl } from '@edx/frontend-platform/i18n';
import { logError } from '@edx/frontend-platform/logging';
import { initializeHotjar } from '@edx/frontend-enterprise-hotjar';

import { ErrorPage, AppContext } from "@edx/frontend-platform/react";
import FooterSlot from "@openedx/frontend-slot-footer";
import { Alert } from "@openedx/paragon";
import { ErrorPage, AppContext } from '@edx/frontend-platform/react';
import FooterSlot from '@openedx/frontend-slot-footer';
import { Alert } from '@openedx/paragon';

import { RequestKeys } from "data/constants/requests";
import store from "data/store";
import { selectors, actions } from "data/redux";
import { reduxHooks } from "hooks";
import Dashboard from "containers/Dashboard";
import { RequestKeys } from 'data/constants/requests';
import store from 'data/store';
import {
selectors,
actions,
} from 'data/redux';
import { reduxHooks } from 'hooks';
import Dashboard from 'containers/Dashboard';

import track from "tracking";
import track from 'tracking';

import fakeData from "data/services/lms/fakeData/courses";
import fakeData from 'data/services/lms/fakeData/courses';

import AppWrapper from "containers/WidgetContainers/AppWrapper";
import LearnerDashboardHeader from "containers/LearnerDashboardHeader";
import AppWrapper from 'containers/WidgetContainers/AppWrapper';
import LearnerDashboardHeader from 'containers/LearnerDashboardHeader';

import { getConfig } from "@edx/frontend-platform";
import messages from "./messages";
import "./App.scss";
import { getConfig } from '@edx/frontend-platform';
import messages from './messages';
import './App.scss';

export const App = () => {
const { authenticatedUser } = React.useContext(AppContext);
Expand All @@ -38,17 +41,17 @@ export const App = () => {
const loadData = reduxHooks.useLoadData();

React.useEffect(() => {
if (
authenticatedUser?.administrator ||
getConfig().NODE_ENV === "development"
) {
if (authenticatedUser?.administrator || getConfig().NODE_ENV === 'development') {
window.loadEmptyData = () => {
loadData({ ...fakeData.globalData, courses: [] });
};
window.loadMockData = () => {
loadData({
...fakeData.globalData,
courses: [...fakeData.courseRunData, ...fakeData.entitlementData],
courses: [
...fakeData.courseRunData,
...fakeData.entitlementData,
],
});
};
window.store = store;
Expand All @@ -72,27 +75,20 @@ export const App = () => {
<>
<Helmet>
<title>{formatMessage(messages.pageTitle)}</title>
<link
rel="shortcut icon"
href={getConfig().FAVICON_URL}
type="image/x-icon"
/>
<link rel="shortcut icon" href={getConfig().FAVICON_URL} type="image/x-icon" />
</Helmet>
<div>
<AppWrapper>
<LearnerDashboardHeader />
<main id="main">
{hasNetworkFailure ? (
<Alert variant="danger">
<ErrorPage
message={formatMessage(messages.errorMessage, {
supportEmail,
})}
/>
</Alert>
) : (
<Dashboard />
)}
<main id='main'>

Check failure on line 83 in src/App.jsx

View workflow job for this annotation

GitHub Actions / tests

Unexpected usage of singlequote
{hasNetworkFailure
? (
<Alert variant="danger">
<ErrorPage message={formatMessage(messages.errorMessage, { supportEmail })} />
</Alert>
) : (
<Dashboard />
)}
</main>
</AppWrapper>
<FooterSlot />
Expand All @@ -101,4 +97,4 @@ export const App = () => {
);
};

export default App;
export default App;

Check failure on line 100 in src/App.jsx

View workflow job for this annotation

GitHub Actions / tests

Newline required at end of file but not found

0 comments on commit 9172507

Please sign in to comment.