Skip to content

Commit

Permalink
WIP: Adding configuratble login page text through external txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
Hina Shah committed Jan 29, 2024
1 parent 70495bc commit 9205154
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/contexts/environment-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,23 @@ export const EnvironmentProvider = ({ children }) => {
)
}
else {
context.login_text = (
<Fragment>
{ context.login_text }
</Fragment>
)
context.login_text = (<Fragment>Testing out read</Fragment>)
fetch('https://raw.githubusercontent.com/helxplatform/appstore/test-hs/appstore/core/static/html/test-read.html')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(text => {
console.log('File contents:', text);
context.login_text = ( <Fragment>
<div dangerouslySetInnerHTML={{ __html: text }} />
</Fragment> )
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
}
// switch (context.brand) {
// case "eduhelx":
Expand Down

0 comments on commit 9205154

Please sign in to comment.