From 8608431490c28410226dd6b7c406c6fac5e5ca56 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 14 Dec 2023 15:58:40 +0000 Subject: [PATCH] feat: add conditional mation logo by default --- .../web/src/components/DefaultLogo/index.tsx | 22 +++++++++++++++++++ packages/web/src/components/Logo/index.tsx | 9 ++------ .../MationLogo/assets/mation-logo.svg | 3 +++ .../web/src/components/MationLogo/index.tsx | 8 +++++++ 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 packages/web/src/components/DefaultLogo/index.tsx create mode 100644 packages/web/src/components/MationLogo/assets/mation-logo.svg create mode 100644 packages/web/src/components/MationLogo/index.tsx diff --git a/packages/web/src/components/DefaultLogo/index.tsx b/packages/web/src/components/DefaultLogo/index.tsx new file mode 100644 index 00000000..8c989fc3 --- /dev/null +++ b/packages/web/src/components/DefaultLogo/index.tsx @@ -0,0 +1,22 @@ +import Typography from '@mui/material/Typography'; +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; + +import MationLogo from 'components/MationLogo'; +import useAutomatischInfo from 'hooks/useAutomatischInfo'; + +const DefaultLogo = () => { + const { isMation, loading } = useAutomatischInfo(); + + if (loading) return ; + + if (isMation) return ; + + return ( + + + + ); +}; + +export default DefaultLogo; diff --git a/packages/web/src/components/Logo/index.tsx b/packages/web/src/components/Logo/index.tsx index a6c36259..441fb5ee 100644 --- a/packages/web/src/components/Logo/index.tsx +++ b/packages/web/src/components/Logo/index.tsx @@ -1,8 +1,7 @@ -import Typography from '@mui/material/Typography'; import * as React from 'react'; -import { FormattedMessage } from 'react-intl'; import CustomLogo from 'components/CustomLogo/index.ee'; +import DefaultLogo from 'components/DefaultLogo'; import useConfig from 'hooks/useConfig'; const Logo = () => { @@ -13,11 +12,7 @@ const Logo = () => { if (logoSvgData) return ; - return ( - - - - ); + return ; }; export default Logo; diff --git a/packages/web/src/components/MationLogo/assets/mation-logo.svg b/packages/web/src/components/MationLogo/assets/mation-logo.svg new file mode 100644 index 00000000..37b70a51 --- /dev/null +++ b/packages/web/src/components/MationLogo/assets/mation-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/web/src/components/MationLogo/index.tsx b/packages/web/src/components/MationLogo/index.tsx new file mode 100644 index 00000000..c83b91a6 --- /dev/null +++ b/packages/web/src/components/MationLogo/index.tsx @@ -0,0 +1,8 @@ +import * as React from 'react'; +import { ReactComponent as MationLogoSvg } from './assets/mation-logo.svg'; + +const MationLogo = () => { + return ; +}; + +export default MationLogo;