From 123dd957a6a85a1c105757bd4d94f5c26661d9b9 Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Mon, 27 May 2024 12:55:28 +0200 Subject: [PATCH 1/6] refactor: remove unused API paths --- TokanPages.ClientApp/src/Api/Request/Paths/index.ts | 2 -- TokanPages.ClientApp/src/Api/Request/index.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/TokanPages.ClientApp/src/Api/Request/Paths/index.ts b/TokanPages.ClientApp/src/Api/Request/Paths/index.ts index 881ac79b6..a9374f402 100644 --- a/TokanPages.ClientApp/src/Api/Request/Paths/index.ts +++ b/TokanPages.ClientApp/src/Api/Request/Paths/index.ts @@ -96,6 +96,4 @@ export const GET_TESTIMONIALS_URL = `${API_NON_VIDEO_ASSETS_URI}?blobName=images export const GET_ICONS_URL = `${API_NON_VIDEO_ASSETS_URI}?blobName=images/icons`; export const GET_FLAG_URL = `${API_NON_VIDEO_ASSETS_URI}?blobName=images/flags`; -export const MAIN_ICON = `${GET_ICONS_URL}/main_logo.svg`; -export const MEDIUM_ICON = `${GET_ICONS_URL}/medium_icon.svg`; export const ARTICLE_PATH = "/articles?title={title}"; diff --git a/TokanPages.ClientApp/src/Api/Request/index.ts b/TokanPages.ClientApp/src/Api/Request/index.ts index 82574fdfd..e5067fc16 100644 --- a/TokanPages.ClientApp/src/Api/Request/index.ts +++ b/TokanPages.ClientApp/src/Api/Request/index.ts @@ -69,8 +69,6 @@ export { GET_FEATURED_IMAGE_URL, GET_TESTIMONIALS_URL, GET_ICONS_URL, - MAIN_ICON, - MEDIUM_ICON, ARTICLE_PATH, GET_FLAG_URL, GET_BICYCLE_CONTENT, From 17323851304b8e23244e0acda14108f1b013e4bd Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Mon, 27 May 2024 12:56:41 +0200 Subject: [PATCH 2/6] feat: use image instead of the rendered text for logos --- .../Layout/Navigation/SideMenu/sideMenuStyle.tsx | 11 +++++------ .../Layout/Navigation/SideMenu/sideMenuView.tsx | 7 +++---- .../Layout/Navigation/View/navigationStyle.tsx | 10 ++-------- .../Layout/Navigation/View/navigationView.tsx | 11 +++++------ .../src/Components/Layout/Navigation/navigation.tsx | 1 + 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuStyle.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuStyle.tsx index 5558fcb4c..59b33a1f0 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuStyle.tsx @@ -15,11 +15,10 @@ export const SideMenuStyle = makeStyles(() => ({ alignItems: "center", backgroundColor: Colours.colours.lightViolet, }, - drawer_logo: { - fontSize: "3.5rem", - fontWeight: 900, - color: Colours.colours.violet, - textAlign: "center", - cursor: "default", + logo: { + height: 120, + marginLeft: "auto", + marginRight: "auto", + alignSelf: "center", }, })); diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx index 36c02239c..375458232 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx @@ -1,7 +1,8 @@ import * as React from "react"; import { Box, Drawer } from "@material-ui/core"; -import { RenderList } from "../../../../Shared/Components"; +import { RenderImage, RenderList } from "../../../../Shared/Components"; import { Item } from "../../../../Shared/Components/ListRender/Models"; +import { GET_ICONS_URL } from "../../../../Api/Request"; import { SideMenuStyle } from "./sideMenuStyle"; interface Properties { @@ -13,13 +14,11 @@ interface Properties { export const SideMenuView = (props: Properties): JSX.Element => { const classes = SideMenuStyle(); - const logo = ""; - return (
-
{logo}
+ {RenderImage(GET_ICONS_URL, props.menu.image, classes.logo)}
diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationStyle.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationStyle.tsx index 986379e9f..b48152b0d 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationStyle.tsx @@ -12,12 +12,9 @@ export const NavigationStyle = makeStyles(theme => ({ [theme.breakpoints.down(700)]: { display: "none", }, + height: 30, marginLeft: "auto", marginRight: "auto", - fontSize: "1.5rem", - fontWeight: 500, - color: Colours.colours.violet, - cursor: "default", alignSelf: "center", }, app_just_logo: { @@ -27,12 +24,9 @@ export const NavigationStyle = makeStyles(theme => ({ [theme.breakpoints.up(700)]: { display: "none", }, + height: 40, marginLeft: "auto", marginRight: "auto", - fontSize: "1.5rem", - fontWeight: 500, - color: Colours.colours.violet, - cursor: "default", alignSelf: "center", }, nav_menu: { diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx index 29e3e64f0..fa5255e1a 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx @@ -4,9 +4,9 @@ import Toolbar from "@material-ui/core/Toolbar"; import IconButton from "@material-ui/core/IconButton"; import Avatar from "@material-ui/core/Avatar"; import MenuIcon from "@material-ui/icons/Menu"; -import { FormControl, Grid, MenuItem, Select, Box, Typography } from "@material-ui/core"; +import { FormControl, Grid, MenuItem, Select, Box } from "@material-ui/core"; import { LanguageItemDto } from "../../../../Api/Models/"; -import { GET_FLAG_URL } from "../../../../Api/Request"; +import { GET_FLAG_URL, GET_ICONS_URL } from "../../../../Api/Request"; import { ApplicationLanguageState } from "../../../../Store/States/"; import { HideOnScroll } from "../../../../Shared/Components/Scroll"; import { Item } from "../../../../Shared/Components/ListRender/Models"; @@ -27,6 +27,7 @@ interface BaseProperties extends ViewProperties { avatarName: string; avatarSource: string; userAliasText: string; + logoImgName: string; languages: ApplicationLanguageState; languageId: string; languageHandler: (event: LanguageChangeEvent) => void; @@ -127,8 +128,6 @@ const RenderLanguageSelection = (props: Properties): JSX.Element => { export const NavigationView = (props: Properties): JSX.Element => { const classes = NavigationStyle(); - const logo = ""; - const name = " tom kandula"; return ( @@ -138,8 +137,8 @@ export const NavigationView = (props: Properties): JSX.Element => { {props.isLoading ? null : } - {name} - {logo} + {RenderImage(GET_ICONS_URL, props.logoImgName, classes.app_full_logo)} + {RenderImage(GET_ICONS_URL, props.menu.image, classes.app_just_logo)} {props.isLoading ? null : } diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/navigation.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/navigation.tsx index df396c245..d24ef2f23 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/navigation.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/navigation.tsx @@ -54,6 +54,7 @@ export const Navigation = (): JSX.Element => { userAliasText={store?.userData?.aliasName} avatarName={store?.userData?.avatarName} avatarSource={avatarSource} + logoImgName={navigation?.content?.logo} languages={language} languageId={language?.id} languageHandler={languageHandler} From 5cf0199bc565889bdee822919884dac86bcbac40 Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Mon, 27 May 2024 13:01:04 +0200 Subject: [PATCH 3/6] feat: nullable --- .../Components/Layout/Navigation/SideMenu/sideMenuView.tsx | 2 +- .../src/Components/Layout/Navigation/View/navigationView.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx index 375458232..20fc4a56c 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/sideMenuView.tsx @@ -18,7 +18,7 @@ export const SideMenuView = (props: Properties): JSX.Element => {
- {RenderImage(GET_ICONS_URL, props.menu.image, classes.logo)} + {RenderImage(GET_ICONS_URL, props?.menu?.image, classes.logo)}
diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx index fa5255e1a..66070a0db 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.tsx @@ -137,8 +137,8 @@ export const NavigationView = (props: Properties): JSX.Element => { {props.isLoading ? null : }
- {RenderImage(GET_ICONS_URL, props.logoImgName, classes.app_full_logo)} - {RenderImage(GET_ICONS_URL, props.menu.image, classes.app_just_logo)} + {RenderImage(GET_ICONS_URL, props?.logoImgName, classes.app_full_logo)} + {RenderImage(GET_ICONS_URL, props?.menu?.image, classes.app_just_logo)} {props.isLoading ? null : } From a83205cb2c20afd30f73f886e5e3ad35bfdb1fb2 Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Mon, 27 May 2024 13:01:14 +0200 Subject: [PATCH 4/6] test: update test --- .../Components/Layout/Navigation/View/navigationView.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.test.tsx b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.test.tsx index f55ce58f1..7250e5883 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.test.tsx +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/View/navigationView.test.tsx @@ -44,6 +44,7 @@ describe("test component: featuresView", () => { avatarSource="" userAliasText="" menu={{ image: "", items: [items] }} + logoImgName="logo.svg" languages={languages} languageId="eng" languageHandler={jest.fn()} From 24877eb11419007df535f3e6490b265184fe883f Mon Sep 17 00:00:00 2001 From: Tomasz 'Tom' Kandula Date: Mon, 27 May 2024 13:01:30 +0200 Subject: [PATCH 5/6] test: update snapshots --- .../__snapshots__/sideMenuView.test.tsx.snap | 8 +------- .../__snapshots__/navigationView.test.tsx.snap | 15 +++++---------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/__snapshots__/sideMenuView.test.tsx.snap b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/__snapshots__/sideMenuView.test.tsx.snap index 72396dbb7..af1dfcbc5 100644 --- a/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/__snapshots__/sideMenuView.test.tsx.snap +++ b/TokanPages.ClientApp/src/Components/Layout/Navigation/SideMenu/__snapshots__/sideMenuView.test.tsx.snap @@ -11,13 +11,7 @@ exports[`test component: menuView should render correctly '' when co > -
- </> -
-
+ /> -

- </> tom kandula -

-

- </> -

+
Date: Mon, 27 May 2024 13:17:55 +0200 Subject: [PATCH 6/6] feat: remove top margin --- .../src/Components/Clients/View/clientsStyle.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/TokanPages.ClientApp/src/Components/Clients/View/clientsStyle.tsx b/TokanPages.ClientApp/src/Components/Clients/View/clientsStyle.tsx index 1da0ea076..8f6f78204 100644 --- a/TokanPages.ClientApp/src/Components/Clients/View/clientsStyle.tsx +++ b/TokanPages.ClientApp/src/Components/Clients/View/clientsStyle.tsx @@ -11,9 +11,6 @@ export const ClientsStyle = makeStyles(theme => ({ backgroundColor: Colours.colours.white, paddingTop: 50, paddingBottom: 50, - [theme.breakpoints.down(900)]: { - marginTop: 50, - }, }, logo: { height: 50,