Skip to content

Commit

Permalink
Merge pull request #19 from EPAM-JS-Competency-center/feat/update-core
Browse files Browse the repository at this point in the history
feat: update core & fix local dev
  • Loading branch information
Ayzrian authored Mar 12, 2024
2 parents 78665d1 + 198b7a6 commit 0af2c11
Show file tree
Hide file tree
Showing 5 changed files with 10,038 additions and 36 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"optionalDependencies": {
"@ebook/access-epm-wrapper": "^1.0.3",
"@ebook/core": "^0.0.16"
"@ebook/core": "^0.0.18"
},
"browserslist": {
"production": [
Expand Down
26 changes: 12 additions & 14 deletions src/theme/Footer/Copyright/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React from 'react';

let LearnFooter = ({ children }) => <>{children}</>; // Default fallback component
import Copyright from '@theme-original/Footer/Copyright';
let Footer = ({...props}) => <Copyright {...props} />;

if (process.env.NODE_ENV === 'production') {
// NODE_ENV is always equal to 'production' for npm run build
try {
LearnFooter = require('@ebook/core').LearnFooter;
} catch(e) {
console.error('Failed to load @ebook/access-epm-wrapper:', e);
}
// NODE_ENV is always equal to 'production' for npm run build
try {
Footer = require('@ebook/core').LearnFooter;
} catch(e) {
console.error('Failed to load @ebook/core:', e);
}
}



export default function CopyrightWrapper(props) {
return (
<LearnFooter {...props}/>
);

return (
<Footer {...props} />
);
}
21 changes: 0 additions & 21 deletions src/theme/SearchBar.js

This file was deleted.

22 changes: 22 additions & 0 deletions src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import SearchBar from '@theme-original/SearchBar';

let Header = ({...props}) => <SearchBar {...props} /> // Default fallback component

if (process.env.NODE_ENV === 'production') {
// NODE_ENV is always equal to 'production' for npm run build
try {
Header = require('@ebook/core').LearnHeader;
require('@ebook/core/dist/customeStyles.css');
} catch(e) {
console.error('Failed to load @ebook/core:', e);
}
}

export default function SearchBarWrapper(props) {
return (
<div id='learnHeader'>
<Header {...props} />
</div>
);
}
Loading

0 comments on commit 0af2c11

Please sign in to comment.