-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INJIWEB-257]: theme customization deployment for injiweb (#57)
Signed-off-by: Vijay <[email protected]>
- Loading branch information
1 parent
ff6d3fd
commit d424823
Showing
10 changed files
with
104 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
#REACT_APP_MIMOTO_URL=http://localhost:3010 | ||
#REACT_APP_AUTHORIZATION_REDIRECT_URL = http://localhost:3001/redirect | ||
REACT_APP_APPLICATION_THEME=orange_theme | ||
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
echo "generating env-config file" | ||
|
||
workingDir=$nginx_dir/html | ||
echo "window._env_ = {" > ${workingDir}/env-config.js | ||
awk -F '=' '{ print $1 ": \"" (ENVIRON[$1] ? ENVIRON[$1] : $2) "\"," }' ${workingDir}/env.env >> ${workingDir}/env-config.js | ||
echo "}" >> ${workingDir}/env-config.js | ||
|
||
echo "generation of env-config file completed!" |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
window._env_ = { | ||
DEFAULT_LANG: "en", | ||
DEFAULT_THEME: "purple_theme", | ||
DEFAULT_FAVICON: "favicon.ico", | ||
DEFAULT_TITLE: "Inji Web", | ||
DEFAULT_FONT_URL: "https://fonts.googleapis.com/css?family=Inter" | ||
}; |
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 |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<link href="/favicon.ico" rel="icon" type="image/x-icon"> | ||
<link id="icon" href="/favicon.ico" rel="icon" type="image/x-icon"> | ||
<link href="https://rsms.me/" rel="preconnect"> | ||
<link href="https://fonts.google.com/share?selection.family=Inter:[email protected] " rel="stylesheet"> | ||
<link id="font" href="https://fonts.google.com/share?selection.family=Inter:[email protected] " rel="stylesheet"> | ||
<meta content="width=device-width, initial-scale=1" name="viewport"/> | ||
<meta content="#000000" name="theme-color"/> | ||
<meta | ||
|
@@ -24,7 +24,13 @@ | |
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>INJI Web</title> | ||
|
||
|
||
<script src="%PUBLIC_URL%/env.config.js"></script> | ||
<script defer src="%PUBLIC_URL%/theme.config.js"></script> | ||
|
||
|
||
<title id="title">INJI Web</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
document.getElementById("title").innerHTML = window._env_.DEFAULT_TITLE; | ||
document.getElementById("font").innerHTML = window._env_.DEFAULT_FONT_URL; | ||
document.getElementById("icon").href = window._env_.DEFAULT_FAVICON; | ||
document.getElementsByTagName("body")[0].classList.add(window._env_.DEFAULT_THEME); |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export {} | ||
|
||
declare global { | ||
interface Window { | ||
_env_: { | ||
DEFAULT_LANG: string; | ||
DEFAULT_THEME: string; | ||
DEFAULT_FAVICON: string; | ||
DEFAULT_TITLE: string; | ||
DEFAULT_FONT_URL: string; | ||
} | ||
} | ||
} |
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