Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Common/Constants/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const ENV = process.env.ENV || "local";

export const enum envs {
LOCAL = "LOCAL",
PROD = "PROD",
}
12 changes: 7 additions & 5 deletions src/Components/Dictionary/AddWord/AddWord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
newWordPlaceholders,
translationPlaceholders,
} from "../../../Common/Constants/dictionary";
import { ENV, envs } from "../../../Common/Constants/global";

interface IAddWordProps {
title?: string;
Expand Down Expand Up @@ -158,11 +159,12 @@ const AddWord: FC<IAddWordProps> = (props) => {
>
Save translation
</Button>

<button onClick={() => console.log(props.dictionary)}>
{/*The button for the debug purpose */}
show dictionary
</button>
{ENV !== envs.PROD && (
<button onClick={() => console.log(props.dictionary)}>
{/*The button for the debug purpose */}
show dictionary
</button>
)}
</div>
</Page>
);
Expand Down
13 changes: 8 additions & 5 deletions src/Components/Dictionary/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Page } from "../../Page";
import { NavLink } from "react-router-dom";
import styles from "./Dashboard.module.scss";
import classNames from "classnames";
import { ENV, envs } from "../../../Common/Constants/global";

interface IDashboardProps {
title?: string;
Expand Down Expand Up @@ -35,11 +36,13 @@ const Dashboard: FC<IDashboardProps> = (props) => {
Bring To Mind
</NavLink>
</div>
<div>
<NavLink className="styled-btn fancy-btn width-80" to="/exam">
Check Yourself
</NavLink>
</div>
{ENV !== envs.PROD && (
<div>
<NavLink className="styled-btn fancy-btn width-80" to="/exam">
Check Yourself
</NavLink>
</div>
)}
</div>
</Page>
);
Expand Down
19 changes: 12 additions & 7 deletions src/Router/routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IRoute } from "../Types/route";
import { ENV, envs } from "../Common/Constants/global";

export const appRoutes: IRoute[] = [
{
Expand All @@ -13,17 +14,15 @@ export const appRoutes: IRoute[] = [
path: "/bring-to-mind",
name: "Bring To Mind",
},
{
];
if (ENV !== envs.PROD) {
appRoutes.push({
path: "/exam",
name: "Check Yourself",
},
];
});
}

export const profileRoutes: IRoute[] = [
{
path: "/settings",
name: "Settings",
},
{
path: `${process.env.REACT_APP_SERVER_URL}/auth/google`,
name: "Login",
Expand All @@ -35,3 +34,9 @@ export const profileRoutes: IRoute[] = [
external: true,
},
];
if (ENV !== envs.PROD) {
profileRoutes.unshift({
path: "/settings",
name: "Settings",
});
}
1 change: 1 addition & 0 deletions src/Styles/Base/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ body {
display: flex;
flex-direction: column;
z-index: 0;
overflow-x: hidden;
}

/* ORIENTATION-BASED WIDTHS */
Expand Down
32 changes: 22 additions & 10 deletions src/Styles/Base/_reset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*, *::before, *::after {
*,
*::before,
*::after {
box-sizing: border-box;
}

Expand All @@ -7,28 +9,38 @@
padding: 0;
}

html, body {
height: 100%;
}

body {
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
img,
picture,
video,
canvas,
svg {
display: block;
max-width: 100%;
}

input, button, textarea, select {
input,
button,
textarea,
select {
font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: break-word;
}

#root, #__next {
#root,
#__next {
isolation: isolate;
}
}