-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
598 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,26 @@ | ||
export const ConfigVariables = { | ||
"tenantLogo": "assets/school/THSM_128x128.svg", | ||
"siteName": "Hummingbird School in Assam", | ||
"siteByLine": "Listen, Learn & Grow !!!", | ||
"splashImage": "assets/school/THSM_152x152.png", | ||
"headerFilters": [{ | ||
"defaultFilter": { | ||
"id": "All", | ||
"label": "All", | ||
"query": "", | ||
"filters": "All" | ||
}, | ||
"additionalFilters": [ | ||
{ | ||
"id": "Stories", | ||
"label": "Stories", | ||
"query": "Stories", | ||
"filters": "Stories" | ||
}, | ||
{ | ||
"id": "Activities", | ||
"label": "Activities", | ||
"query": "Activities", | ||
"filters": "Activities" | ||
}, | ||
{ | ||
"id": "Songs", | ||
"label": "Songs", | ||
"query": "Songs", | ||
"filters": "Songs" | ||
}, | ||
{ | ||
"id": "Audio Books", | ||
"label": "Audio Books", | ||
"query": "Audio Books", | ||
"filters": "Audio Books" | ||
}, | ||
{ | ||
"id": "Handbooks", | ||
"label": "Handbooks", | ||
"query": "Handbooks", | ||
"filters": "Handbooks" | ||
}, | ||
] | ||
}], | ||
"languages": [ | ||
{ | ||
"id": "en", | ||
"label": "English", | ||
"default": false | ||
}, | ||
{ | ||
"id": "hi", | ||
"label": "हिंदी", | ||
"default": true | ||
}, | ||
{ | ||
"id": "as", | ||
"label": "অসমীয়া", | ||
"default": false | ||
}, | ||
{ | ||
"id": "bn", | ||
"label": "বাংলা", | ||
"default": true | ||
} | ||
], | ||
"kathaSakhiBotName": "Story Baideo", | ||
"parentTaraBotName": "Parent Bondhu", | ||
"teacherTaraBotName": "Teacher Bondhu", | ||
// "apiEndPoint": "/dsep/search", | ||
// "bookmark": "BookMark", | ||
// "rating": "Rating", | ||
// "share": "Share", | ||
// "pagination": "10", | ||
// "orderBy": "", | ||
// "filterBy": "default", | ||
"footerText": "Developed with ❤️ by Tekdi Technologies ", | ||
"headerColor": "brown", | ||
"headerFontSize": "16", | ||
"footerColor": "brown", | ||
"footerFontSize": "16", | ||
// "positionByLine": "false", | ||
// "positionLogo": "false", | ||
// "positionSiteName": "false", | ||
// "labelTitle": "शीर्षक", | ||
// "labelAuthor": "लेखक", | ||
// "labelDesc": "Desc", | ||
// "labelRating": "Rating", | ||
// "displayOrder": { | ||
// "title": "3", | ||
// "author": "1", | ||
// "description": "2", | ||
// "publisher": "4" | ||
// }, | ||
// "filters": { | ||
// "minAge": "", | ||
// "language": "", | ||
// "contentType": "" | ||
// }, | ||
// "searchFilters":{ | ||
// "age":["1","2","3","4","5","6","7","8","9","10"], | ||
// "language":["English","Hindi","Gujarati","Tamil","Kannada"], | ||
// "type":["Video","Audio","Read","Others"] | ||
// }, | ||
// "contentSource":{ | ||
// "source":["onest","SB"] | ||
// }, | ||
// "logo": "photo-1492144534655-ae79c964c9d71699539070789.avif" | ||
} | ||
// config.ts | ||
const urlObj = new URL(document.baseURI); | ||
const hostname = urlObj.hostname; // e.g., "subdomain.example.com" | ||
const domainParts = hostname.split('.'); | ||
console.log(domainParts); | ||
const jsonFilename = domainParts[0] + '.json'; | ||
const jsonUrl = `../assets/appConfig/${jsonFilename}`; | ||
// const jsonUrl = `../assets/appConfig/localhost.json`; | ||
|
||
console.log(`Fetching configuration from: ${jsonUrl}`); | ||
|
||
export const ConfigVariables = fetch(jsonUrl) | ||
.then(response => { | ||
console.log({ response }); | ||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
return response.json(); | ||
}) | ||
.then(data => { | ||
console.log('Fetched data:', data); | ||
return data; // Return the fetched data so that it can be used by other parts of the application | ||
}) | ||
.catch(error => { | ||
console.error('There was a problem with the fetch operation:', error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.