Skip to content

Commit

Permalink
rename dynamicFavicon.ts to setFavicon.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kostya Bats committed Mar 11, 2024
1 parent 378faba commit 976e391
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/frontend/admin/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import BackendLog from "./components/BackendLog";
import Dashboard from "./components/Dashboard";
import Analytics from "./components/Analytics";
import TeamSpotlight from "./components/TeamSpotlight";
import { createApiGet, dynamicFavicon, isShouldUseDarkColor, useLocalStorageState } from "./utils";
import { createApiGet, setFavicon, isShouldUseDarkColor, useLocalStorageState } from "./utils";
import FullScreenClockManager from "./components/FullScreenClockManager";
import AdvancedJson from "./components/AdvancedJson";
import MediaFiles from "./components/MediaFiles";
Expand Down Expand Up @@ -75,7 +75,7 @@ function App() {
.then(c => {
if (c["CONTEST_COLOR"]) {
setContestColor(c["CONTEST_COLOR"]);
dynamicFavicon(faviconTemplate
setFavicon(faviconTemplate
.replaceAll("{CONTEST_COLOR}", c["CONTEST_COLOR"])
.replaceAll("{TEXT_COLOR}", isShouldUseDarkColor(contestColor) ? "#000000" : "#FFFFFF"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/admin/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const isShouldUseDarkColor = (backgroundColor) => {
return brightness > 125;
};

export const dynamicFavicon = (svg) => {
export const setFavicon = (svg) => {
const link = document.createElement("link");
link.type = "image/x-icon";
link.rel = "shortcut icon";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dynamicFavicon = (svg: string) => {
export const setFavicon = (svg: string) => {
const link = document.createElement("link");
link.type = "image/x-icon";
link.rel = "shortcut icon";
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/overlay/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Strings
import { dynamicFavicon } from "@shared/dynamicFavicon";
import { setFavicon } from "@shared/setFavicon";
import { isShouldUseDarkColor } from "@/utils/colors";
import { faviconTemplate } from "@/consts";

Expand Down Expand Up @@ -212,7 +212,7 @@ config.CELL_INFO_VERDICT_WIDTH= "100px"; // css property
// layers (z-indexes)
config.QUEUE_BASIC_ZINDEX = 20;

dynamicFavicon(faviconTemplate
setFavicon(faviconTemplate
.replaceAll("{CONTEST_COLOR}", config_["CONTEST_COLOR"])
.replaceAll("{TEXT_COLOR}", isShouldUseDarkColor(config_["CONTEST_COLOR"]) ? "#000000" : "#FFFFFF"));

Expand Down

0 comments on commit 976e391

Please sign in to comment.