Skip to content

Commit

Permalink
refactor(#1137): change react.createElement syntax to JSX syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
d1mon1k committed Sep 12, 2022
1 parent 5e6f2f1 commit b794d90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const MainRoutes: MainRoutesObject = {
props: {
element: withPageGuard([REGISTERED_USER])(ChatPage),
children: [
React.createElement(Route, { key: '1', index: true, element: React.createElement(Welcome) }),
React.createElement(Route, { key: '2', path: ':id', element: React.createElement(MessageList) }),
React.createElement(Route, { key: '3', path: '*', element: React.createElement(Welcome) }),
<Route key="1" index element={<Welcome />} />,
<Route key="2" path=":id" element={<MessageList />} />,
<Route key="3" path="*" element={<Welcome />} />,
],
},
},
Expand All @@ -47,15 +47,15 @@ const MainRoutes: MainRoutesObject = {
pageName: 'Calls',
props: {
element: withPageGuard([REGISTERED_USER])(CallsPage),
children: React.createElement(Route, { path: '*', element: React.createElement(CallsPage) }),
children: <Route path="*" element={<CallsPage />} />,
},
},
[MainRoutesEnum.CONTACTS]: {
path: CONTACTS_PATH,
pageName: 'Contacts',
props: {
element: ContactsPage,
children: React.createElement(Route, { path: '*', element: React.createElement(ContactsPage) }),
children: <Route path="*" element={<ContactsPage />} />,
},
},
[MainRoutesEnum.SETTINGS]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,55 +35,55 @@ const SettingsRoutes: SettingsRoutesObject = {
pageName: 'Profile settings',
props: {
element: withPageGuard([REGISTERED_USER])(ProfileSettings),
children: React.createElement(Route, { path: '*', element: React.createElement(ProfileSettings) }),
children: <Route path="*" element={<ProfileSettings />} />,
},
},
[SettingsRoutesEnum.APPEARANCE_SETTINGS]: {
path: deleteLineFromPath(APPEARANCE_SETTINGS_PATH, '/settings/'),
pageName: 'Appearance settings',
props: {
element: withPageGuard([REGISTERED_USER])(AppearanceSettings),
children: React.createElement(Route, { path: '*', element: React.createElement(AppearanceSettings) }),
children: <Route path="*" element={<AppearanceSettings />} />,
},
},
[SettingsRoutesEnum.AUDIO_VIDEO_SETTINGS]: {
path: deleteLineFromPath(AUDIO_VIDEO_SETTINGS_PATH, '/settings/'),
pageName: 'Audio video settings',
props: {
element: withPageGuard([REGISTERED_USER])(AudioVideoSettings),
children: React.createElement(Route, { path: '*', element: React.createElement(AudioVideoSettings) }),
children: <Route path="*" element={<AudioVideoSettings />} />,
},
},
[SettingsRoutesEnum.LANGUAGE_SETTINGS]: {
path: deleteLineFromPath(LANGUAGE_SETTINGS_PATH, '/settings/'),
pageName: 'Language settings',
props: {
element: withPageGuard([REGISTERED_USER])(LanguageSettings),
children: React.createElement(Route, { path: '*', element: React.createElement(LanguageSettings) }),
children: <Route path="*" element={<LanguageSettings />} />,
},
},
[SettingsRoutesEnum.NOTIFICATIONS_SETTINGS]: {
path: deleteLineFromPath(NOTIFICATIONS_SETTINGS_PATH, '/settings/'),
pageName: 'Notifications settings',
props: {
element: withPageGuard([REGISTERED_USER])(NotificationsSettings),
children: React.createElement(Route, { path: '*', element: React.createElement(NotificationsSettings) }),
children: <Route path="*" element={<NotificationsSettings />} />,
},
},
[SettingsRoutesEnum.PRIVACY_SECURITY_SETTINGS]: {
path: deleteLineFromPath(PRIVACY_SECURITY_SETTINGS_PATH, '/settings/'),
pageName: 'Privacy and security settings',
props: {
element: withPageGuard([REGISTERED_USER])(PrivacySecuritySettings),
children: React.createElement(Route, { path: '*', element: React.createElement(PrivacySecuritySettings) }),
children: <Route path="*" element={<PrivacySecuritySettings />} />,
},
},
[SettingsRoutesEnum.TYPING_SETTINGS]: {
path: deleteLineFromPath(TYPING_SETTINGS_PATH, '/settings/'),
pageName: 'Typing settings',
props: {
element: withPageGuard([REGISTERED_USER])(KeyBindings),
children: React.createElement(Route, { path: '*', element: React.createElement(KeyBindings) }),
children: <Route path="*" element={<KeyBindings />} />,
},
},
};
Expand Down

0 comments on commit b794d90

Please sign in to comment.