Skip to content

Commit

Permalink
move some constants strings to config (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mond1c authored Mar 6, 2024
1 parent 7a0900f commit 635ee46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const ScoreboardContent = styled.div`


export const nameTable = {
normal: "Current",
optimistic: "Optimistic",
pessimistic: "Pessimistic",
normal: c.SCOREBOARD_NORMAL_NAME,
optimistic: c.SCOREBOARD_OPTIMISTIC_NAME,
pessimistic: c.SCOREBOARD_PESSIMISTIC_NAME,
};

const ScoreboardTableRowWrap = styled.div<{needPenalty: boolean, nProblems: number}>`
Expand Down Expand Up @@ -287,7 +287,7 @@ export const Scoreboard = ({ widgetData: { settings } }) => {
return <ScoreboardWrap>
<ScoreboardHeader>
<ScoreboardTitle>
{nameTable[settings.optimismLevel] ?? "??"} standings
{nameTable[settings.optimismLevel] ?? c.SCOREBOARD_UNDEFINED_NAME} standings
</ScoreboardTitle>
<ScoreboardCaption>
{c.SCOREBOARD_CAPTION}
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/overlay/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ config.SCOREBOARD_CELL_POINTS_ALIGN = "center";
config.SCOREBOARD_CELL_PENALTY_SIZE = "92px";
config.SCOREBOARD_CELL_PENALTY_ALIGN = "center";

config.SCOREBOARD_NORMAL_NAME = "Current";
config.SCOREBOARD_OPTIMISTIC_NAME = "Optimistic";
config.SCOREBOARD_PESSIMISTIC_NAME = "Pessimistic";
config.SCOREBUARD_UNDEFINED_NAME = "??";


config.QUEUE_ROW_FONT_SIZE = config.GLOBAL_DEFAULT_FONT_SIZE;
config.QUEUE_ROW_BACKGROUND = "rgba(0, 0, 0, 0.08)";
Expand Down

0 comments on commit 635ee46

Please sign in to comment.