From 01d29bcf111597e1fd8af59c5a3a13f8bcef1d4d Mon Sep 17 00:00:00 2001 From: grafixeyehero <32230989+grafixeyehero@users.noreply.github.com> Date: Wed, 5 Jan 2022 21:53:15 +0300 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFmove=20SectionTitleContainer=20into=20?= =?UTF-8?q?its=20own=20Components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/users/SectionTitleContainer.tsx | 25 +++++++++++++++++++ src/components/pages/NewUserPage.tsx | 16 ++---------- src/components/pages/UserEditPage.tsx | 15 ++--------- .../pages/UserLibraryAccessPage.tsx | 17 +++---------- src/components/pages/UserParentalControl.tsx | 15 ++--------- src/components/pages/UserPasswordPage.tsx | 15 ++--------- 6 files changed, 36 insertions(+), 67 deletions(-) create mode 100644 src/components/dashboard/users/SectionTitleContainer.tsx diff --git a/src/components/dashboard/users/SectionTitleContainer.tsx b/src/components/dashboard/users/SectionTitleContainer.tsx new file mode 100644 index 0000000000..2347fac8f7 --- /dev/null +++ b/src/components/dashboard/users/SectionTitleContainer.tsx @@ -0,0 +1,25 @@ +import React, { FunctionComponent } from 'react'; +import SectionTitleLinkElement from './SectionTitleLinkElement'; + +type IProps = { + title: string; +} + +const SectionTitleContainer: FunctionComponent = ({title}: IProps) => { + return ( +
+
+

+ {title} +

+ +
+
+ ); +}; + +export default SectionTitleContainer; diff --git a/src/components/pages/NewUserPage.tsx b/src/components/pages/NewUserPage.tsx index 9c8110310c..f35e80a286 100644 --- a/src/components/pages/NewUserPage.tsx +++ b/src/components/pages/NewUserPage.tsx @@ -4,8 +4,7 @@ import Dashboard from '../../utils/dashboard'; import globalize from '../../scripts/globalize'; import loading from '../loading/loading'; import toast from '../toast/toast'; - -import SectionTitleLinkElement from '../dashboard/users/SectionTitleLinkElement'; +import SectionTitleContainer from '../dashboard/users/SectionTitleContainer'; import InputElement from '../dashboard/users/InputElement'; import CheckBoxElement from '../dashboard/users/CheckBoxElement'; import CheckBoxListItem from '../dashboard/users/CheckBoxListItem'; @@ -178,18 +177,7 @@ const NewUserPage: FunctionComponent = () => { return (
-
-
-

- {globalize.translate('ButtonAddUser')} -

- -
-
+
{ return (
-
-
-

- {userName} -

- -
-
+
{ itemsArr.push({ Id: device.Id, Name: device.Name, - AppName : device.AppName, + AppName: device.AppName, checkedAttribute: checkedAttribute }); } @@ -228,18 +228,7 @@ const UserLibraryAccessPage: FunctionComponent = () => { return (
-
-
-

- {userName} -

- -
-
+
diff --git a/src/components/pages/UserParentalControl.tsx b/src/components/pages/UserParentalControl.tsx index 8c9c6b66b8..8774ccee1d 100644 --- a/src/components/pages/UserParentalControl.tsx +++ b/src/components/pages/UserParentalControl.tsx @@ -7,7 +7,7 @@ import BlockedTagList from '../dashboard/users/BlockedTagList'; import ButtonElement from '../dashboard/users/ButtonElement'; import CheckBoxListItem from '../dashboard/users/CheckBoxListItem'; import SectionTitleButtonElement from '../dashboard/users/SectionTitleButtonElement'; -import SectionTitleLinkElement from '../dashboard/users/SectionTitleLinkElement'; +import SectionTitleContainer from '../dashboard/users/SectionTitleContainer'; import SelectMaxParentalRating from '../dashboard/users/SelectMaxParentalRating'; import SectionTabs from '../dashboard/users/SectionTabs'; import loading from '../loading/loading'; @@ -319,18 +319,7 @@ const UserParentalControl: FunctionComponent = () => { return (
-
-
-

- {userName} -

- -
-
+
diff --git a/src/components/pages/UserPasswordPage.tsx b/src/components/pages/UserPasswordPage.tsx index 2eba530ae2..ef8bd3ca33 100644 --- a/src/components/pages/UserPasswordPage.tsx +++ b/src/components/pages/UserPasswordPage.tsx @@ -1,8 +1,8 @@ import React, { FunctionComponent, useCallback, useEffect, useState } from 'react'; -import SectionTitleLinkElement from '../dashboard/users/SectionTitleLinkElement'; import SectionTabs from '../dashboard/users/SectionTabs'; import UserPasswordForm from '../dashboard/users/UserPasswordForm'; import { getParameterByName } from '../../utils/url'; +import SectionTitleContainer from '../dashboard/users/SectionTitleContainer'; const UserPasswordPage: FunctionComponent = () => { const userId = getParameterByName('userId'); @@ -23,18 +23,7 @@ const UserPasswordPage: FunctionComponent = () => { return (
-
-
-

- {userName} -

- -
-
+