merchant-backoffice

ZZZ: Inactive/Deprecated
Log | Files | Refs | Submodules | README

commit f688008107b76d7809d56d1598aeb3355c1d13ac
parent b923b0d6a489b13fd1d5d405a2febb8a7150bc12
Author: Sebastian <sebasjm@gmail.com>
Date:   Thu, 18 Feb 2021 09:46:01 -0300

refactoring route

Diffstat:
MTODO | 2+-
Msrc/declaration.d.ts | 2--
Dsrc/index.ts | 29-----------------------------
Asrc/index.tsx | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/routes/index.tsx | 54------------------------------------------------------
5 files changed, 58 insertions(+), 86 deletions(-)

diff --git a/TODO b/TODO @@ -23,7 +23,7 @@ Already done: Next to do: * implement proper error handling - * PATCH payto uri not working as expeced + * PATCH payto uri not working as expeced: re-enable, creating with multiple uris Queue: * replace Yup and type definition with a taler-library for the purpose (first wait Florian to refactor wallet core) diff --git a/src/declaration.d.ts b/src/declaration.d.ts @@ -19,8 +19,6 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { number } from "yup/lib/locale"; - declare module "*.css" { const mapping: Record<string, string>; export default mapping; diff --git a/src/index.ts b/src/index.ts @@ -1,29 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - - /** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import "./scss/main.scss" - -// Automatic code splitting only supports default exports, not named exports: -// https://github.com/preactjs/preact-cli#route-based-code-splitting - -import PageRouter from './routes/index'; - -export default PageRouter; diff --git a/src/index.tsx b/src/index.tsx @@ -0,0 +1,56 @@ +/* + This file is part of GNU Taler + (C) 2021 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + + /** + * + * @author Sebastian Javier Marchano (sebasjm) + */ + +import "./scss/main.scss" + +import { h, VNode } from 'preact'; +import { Route, Router } from 'preact-router'; +import { IntlProvider } from 'preact-i18n'; + +import { Footer } from './components/footer'; +import { Sidebar } from './components/sidebar'; +import { NavigationBar } from './components/navbar'; +import { Notifications } from './components/notifications'; +import { useNotifications } from './hooks/notifications'; +import { translations } from './i18n'; +import { useLang } from './components/hooks'; + +import NotFoundPage from './routes/notfound'; +import Instances from './routes/instances'; + +export default function App(): VNode { + const { notifications, pushNotification } = useNotifications() + const [lang, setLang] = useLang() + return ( + <IntlProvider definition={(translations as any)[lang] || translations.en}> + <div id="app"> + <NavigationBar lang={lang} setLang={setLang} /> + <Sidebar /> + <Notifications notifications={notifications} /> + <Router> + <Route path="/" component={Instances} pushNotification={pushNotification} /> + <Route default component={NotFoundPage} /> + </Router> + <Footer /> + </div> + </IntlProvider > + ); +} +\ No newline at end of file diff --git a/src/routes/index.tsx b/src/routes/index.tsx @@ -1,53 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -/** -* -* @author Sebastian Javier Marchano (sebasjm) -*/ - -import { h, VNode } from 'preact'; -import { Route, Router } from 'preact-router'; -import { IntlProvider } from 'preact-i18n'; -import { Footer } from '../components/footer'; -import { Sidebar } from '../components/sidebar'; -import NotFoundPage from './notfound'; -import Instances from './instances'; -import { NavigationBar } from '../components/navbar'; -import { Notifications } from '../components/notifications'; -import { useNotifications } from '../hooks/notifications'; -import { translations } from '../i18n'; -import { useLang } from '../components/hooks'; - - -export default function PageRouter(): VNode { - const { notifications, pushNotification } = useNotifications() - const [lang, setLang] = useLang() - return ( - <IntlProvider definition={(translations as any)[lang] || translations.en}> - <div id="app"> - <NavigationBar lang={lang} setLang={setLang} /> - <Sidebar /> - <Notifications notifications={notifications} /> - <Router> - <Route path="/" component={Instances} pushNotification={pushNotification} /> - <NotFoundPage /> - </Router> - <Footer /> - </div> - </IntlProvider > - ); -} -\ No newline at end of file