Remove global CSS import

This commit is contained in:
Paulo Gustavo Veiga 2021-02-14 16:33:36 -08:00
parent 3dec2cdd77
commit 77e3d24eb1
6 changed files with 1355 additions and 58 deletions

View File

@ -5,6 +5,9 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="<%=PUBLIC_URL%>/favicon.ico" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;600&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="WiseMappping" />

View File

@ -1,20 +1,19 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { IntlProvider } from 'react-intl';
import { Route, Switch, Redirect, BrowserRouter as Router } from 'react-router-dom';
import { GlobalStyle } from './theme';
import RegistrationSuccessPage from './components/registration-success-page';
import ForgotPasswordSuccessPage from './components/forgot-password-success-page';
import RegistationPage from './components/registration-page';
import LoginPage from './components/login-page';
import MapsPage from './components/maps-page';
import store from "./redux/store";
import { ForgotPasswordPage } from './components/forgot-password-page';
import { Provider } from 'react-redux';
import { QueryClient, QueryClientProvider } from 'react-query';
import { CssBaseline, ThemeProvider } from '@material-ui/core';
import { theme } from './theme'
import AppI18n, { Locale, Locales } from './classes/app-i18n';
import AppI18n, { Locales } from './classes/app-i18n';
import MapsPage from './components/maps-page';
const queryClient = new QueryClient({
defaultOptions: {
@ -26,44 +25,15 @@ const queryClient = new QueryClient({
});
const App = () => {
const [messages, setMessages] = useState(undefined);
const [appi18n, setAppi18n] = useState<AppI18n>(new AppI18n('es'));
const loadResourceBundle = async (locale: Locale) => {
let result;
switch (locale.code) {
case 'en':
result = require('./compiled-lang/en.json');
break;
case 'es':
result = require('./compiled-lang/es.json');
break;
case 'de':
// result = require('./compiled-lang/de.json');
break;
case 'fr':
// result = require('./compiled-lang/fr.json');
break;
}
return result;
}
useEffect(() => {
const fetchData = async () => {
const locale = appi18n.getLocale();
const msg = await loadResourceBundle(locale);
setMessages(msg);
}
fetchData();
}, [window.location.pathname]);
return messages ? (
return locale.message ? (
<Provider store={store}>
<GlobalStyle />
<QueryClientProvider client={queryClient}>
<IntlProvider locale={appi18n.getLocale().code} defaultLocale={Locales.EN.code} messages={messages}>
<ThemeProvider theme={theme}>
<IntlProvider locale={locale.code} defaultLocale={Locales.EN.code} messages={locale.message}>
<CssBaseline />
<ThemeProvider theme={theme}>
<Router>
<Switch>
<Route exact path="/">
@ -88,7 +58,7 @@ const App = () => {
</QueryClientProvider>
</Provider>
) : <div>Loading ... </div>
) : (<div>Loading ... </div>)
}
export default App;

View File

@ -1,10 +1,12 @@
export class Locale {
code: LocaleCode;
label: string;
message: any;
constructor(code: LocaleCode, label: string) {
constructor(code: LocaleCode, label: string, message: any) {
this.code = code;
this.label = label;
this.message = message;
}
}
@ -23,10 +25,6 @@ export default class AppI18n {
return this.locale;
}
resourceBundle(): string {
return `./compiled-lang/${this.locale.code}.json`;
}
private browserLocale(): Locale {
let localeCode = (navigator.languages && navigator.languages[0])
|| navigator.language;
@ -49,10 +47,10 @@ export type LocaleCode = 'en' | 'es' | 'fr' | 'de';
export const Locales =
{
EN: new Locale('en', 'English'),
ES: new Locale('es', 'Español'),
DE: new Locale('de', 'Français'),
FR: new Locale('fr', 'Deutsch'),
EN: new Locale('en', 'English', require('./../../compiled-lang/en.json')),
ES: new Locale('es', 'Español', require('./../../compiled-lang/es.json')),
DE: new Locale('de', 'Français', require('./../../compiled-lang/de.json')),
FR: new Locale('fr', 'Deutsch', require('./../../compiled-lang/fr.json')),
}
export const localeFromStr = (code: string): Locale => {

View File

@ -0,0 +1,668 @@
{
"action.cancel-button": [
{
"type": 0,
"value": "Cancel"
}
],
"action.close-button": [
{
"type": 0,
"value": "Close"
}
],
"action.delete": [
{
"type": 0,
"value": "Delete"
}
],
"action.delete-description": [
{
"type": 0,
"value": "Deleted mindmap can not be recovered. Do you want to continue ?."
}
],
"action.delete-title": [
{
"type": 0,
"value": "Delete"
}
],
"action.duplicate": [
{
"type": 0,
"value": "Duplicate"
}
],
"action.export": [
{
"type": 0,
"value": "Export"
}
],
"action.history": [
{
"type": 0,
"value": "History"
}
],
"action.history-description": [
{
"type": 0,
"value": "List of changes introduced in the last 90 days."
}
],
"action.history-title": [
{
"type": 0,
"value": "Version history"
}
],
"action.import": [
{
"type": 0,
"value": "Import"
}
],
"action.info": [
{
"type": 0,
"value": "Info"
}
],
"action.label": [
{
"type": 0,
"value": "Add Label"
}
],
"action.new": [
{
"type": 0,
"value": "New Map"
}
],
"action.open": [
{
"type": 0,
"value": "Open"
}
],
"action.print": [
{
"type": 0,
"value": "Print"
}
],
"action.publish": [
{
"type": 0,
"value": "Publish"
}
],
"action.rename": [
{
"type": 0,
"value": "Rename"
}
],
"action.rename-description-placeholder": [
{
"type": 0,
"value": "Description"
}
],
"action.rename-name-placeholder": [
{
"type": 0,
"value": "Name"
}
],
"action.share": [
{
"type": 0,
"value": "Share"
}
],
"common.wait": [
{
"type": 0,
"value": "Please wait ..."
}
],
"create.button": [
{
"type": 0,
"value": "Create"
}
],
"create.description": [
{
"type": 0,
"value": "Please, fill the new map name and description."
}
],
"create.title": [
{
"type": 0,
"value": "Create a new mindmap"
}
],
"deletem.title": [
{
"type": 0,
"value": "All selected maps will be deleted"
}
],
"duplicate.title": [
{
"type": 0,
"value": "Duplicate"
}
],
"expired.description": [
{
"type": 0,
"value": "Your current session has expired. Please, sign in and try again."
}
],
"expired.title": [
{
"type": 0,
"value": "Your session has expired"
}
],
"export.document": [
{
"type": 0,
"value": "Mindmap Tools: Export your mindmap in thirdparty mindmap tool formats"
}
],
"export.image": [
{
"type": 0,
"value": "Image: Get a graphic representation of your map including all colors and shapes."
}
],
"export.title": [
{
"type": 0,
"value": "Export"
}
],
"export.warning": [
{
"type": 0,
"value": "Exporting to Image (SVG,PNG,JPEG )is available only in the editor toolbar."
}
],
"footer.aboutus": [
{
"type": 0,
"value": "About Us"
}
],
"footer.contactus": [
{
"type": 0,
"value": "Contact Us"
}
],
"footer.faq": [
{
"type": 0,
"value": "F.A.Q."
}
],
"footer.faqandhelp": [
{
"type": 0,
"value": "Help & FAQ"
}
],
"footer.feedback": [
{
"type": 0,
"value": "Feedback"
}
],
"footer.opensource": [
{
"type": 0,
"value": "Open Source"
}
],
"footer.others": [
{
"type": 0,
"value": "Others"
}
],
"footer.termsandconditions": [
{
"type": 0,
"value": "Term And Conditions"
}
],
"forgot.desc": [
{
"type": 0,
"value": "We will send you an email to reset your password"
}
],
"forgot.email": [
{
"type": 0,
"value": "Email"
}
],
"forgot.register": [
{
"type": 0,
"value": "Send recovery link"
}
],
"forgot.success.desc": [
{
"type": 0,
"value": "We've sent you an email that will allow you to reset your password. Please check your email now."
}
],
"forgot.success.title": [
{
"type": 0,
"value": "Your temporal password has been sent"
}
],
"forgot.title": [
{
"type": 0,
"value": "Reset your password"
}
],
"header.donthaveaccount": [
{
"type": 0,
"value": "Don't have an account ?"
}
],
"header.haveaccount": [
{
"type": 0,
"value": "Already have an account?"
}
],
"history.no-changes": [
{
"type": 0,
"value": "There is no changes available"
}
],
"import.button": [
{
"type": 0,
"value": "Create"
}
],
"import.description": [
{
"type": 0,
"value": "You can import FreeMind 1.0.1 and WiseMapping maps to your list of maps. Select the file you want to import."
}
],
"import.title": [
{
"type": 0,
"value": "Import existing mindmap"
}
],
"info.basic-info": [
{
"type": 0,
"value": "Basic Info"
}
],
"info.button": [
{
"type": 0,
"value": "Accept"
}
],
"info.creation-time": [
{
"type": 0,
"value": "Creation Date"
}
],
"info.creator": [
{
"type": 0,
"value": "Creator"
}
],
"info.description": [
{
"type": 0,
"value": "Description"
}
],
"info.description-msg": [
{
"type": 0,
"value": "By publishing the map you make it visible to everyone on the Internet."
}
],
"info.modified-time": [
{
"type": 0,
"value": "Last Modified Date"
}
],
"info.modified-tny": [
{
"type": 0,
"value": "Last Modified By"
}
],
"info.name": [
{
"type": 0,
"value": "Name"
}
],
"info.public-visibility": [
{
"type": 0,
"value": "Publicly Visible"
}
],
"info.sharing": [
{
"type": 0,
"value": "Sharing"
}
],
"info.starred": [
{
"type": 0,
"value": "Starred"
}
],
"info.title": [
{
"type": 0,
"value": "Info"
}
],
"login.desc": [
{
"type": 0,
"value": "Log into your account"
}
],
"login.email": [
{
"type": 0,
"value": "Email"
}
],
"login.error": [
{
"type": 0,
"value": "The email address or password you entered is not valid."
}
],
"login.forgotpwd": [
{
"type": 0,
"value": "Forgot Password ?"
}
],
"login.hsqldbcofig": [
{
"type": 0,
"value": "Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL"
}
],
"login.password": [
{
"type": 0,
"value": "Password"
}
],
"login.remberme": [
{
"type": 0,
"value": "Remember me"
}
],
"login.signin": [
{
"type": 0,
"value": "Sign In"
}
],
"login.signup": [
{
"type": 0,
"value": "Sign Up"
}
],
"login.title": [
{
"type": 0,
"value": "Welcome"
}
],
"login.userinactive": [
{
"type": 0,
"value": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!."
}
],
"map.creator": [
{
"type": 0,
"value": "Creator"
}
],
"map.last-update": [
{
"type": 0,
"value": "Last Update"
}
],
"map.more-actions": [
{
"type": 0,
"value": "More Actions"
}
],
"map.name": [
{
"type": 0,
"value": "Name"
}
],
"maps.choose-file": [
{
"type": 0,
"value": "Choose a file"
}
],
"maps.create-tooltip": [
{
"type": 0,
"value": "Create a New Map"
}
],
"maps.empty-result": [
{
"type": 0,
"value": "No matching record found with the current filter criteria."
}
],
"maps.import-desc": [
{
"type": 0,
"value": "Import from other tools"
}
],
"maps.modified": [
{
"type": 0,
"value": "Modified"
}
],
"maps.modified-by": [
{
"type": 0,
"value": "Modified By"
}
],
"maps.revert": [
{
"type": 0,
"value": "Revert"
}
],
"maps.view": [
{
"type": 0,
"value": "View"
}
],
"menu.account": [
{
"type": 0,
"value": "Account"
}
],
"menu.signout": [
{
"type": 0,
"value": "Sign Out"
}
],
"publish.button": [
{
"type": 0,
"value": "Accept"
}
],
"publish.checkbox": [
{
"type": 0,
"value": "Enable public sharing"
}
],
"publish.description": [
{
"type": 0,
"value": "By publishing the map you make it visible to everyone on the Internet."
}
],
"publish.embedded": [
{
"type": 0,
"value": "Embedded"
}
],
"publish.embedded-msg": [
{
"type": 0,
"value": "Copy this snippet of code to embed in your blog or page:"
}
],
"publish.public-url": [
{
"type": 0,
"value": "Public URL"
}
],
"publish.public-url-msg": [
{
"type": 0,
"value": "Copy and paste the link below to share your map with colleagues:"
}
],
"publish.title": [
{
"type": 0,
"value": "Publish"
}
],
"registration.desc": [
{
"type": 0,
"value": "Signing up is free and just take a moment"
}
],
"registration.email": [
{
"type": 0,
"value": "Email"
}
],
"registration.firstname": [
{
"type": 0,
"value": "First Name"
}
],
"registration.lastname": [
{
"type": 0,
"value": "Last Name"
}
],
"registration.password": [
{
"type": 0,
"value": "Password"
}
],
"registration.register": [
{
"type": 0,
"value": "Register"
}
],
"registration.success.desc": [
{
"type": 0,
"value": "Click 'Sign In' button below and start creating mind maps."
}
],
"registration.termandconditions": [
{
"type": 0,
"value": "Terms of Client: Please check the WiseMapping Account information you've entered above, and review the Terms of Client here. By clicking on 'Register' below you are agreeing to the Terms of Client above and the Privacy Policy"
}
],
"registration.title": [
{
"type": 0,
"value": "Become a member"
}
],
"rename.description": [
{
"type": 0,
"value": "Please, fill the new map name and description."
}
],
"rename.title": [
{
"type": 0,
"value": "Rename"
}
],
"resetpassword.success.title": [
{
"type": 0,
"value": "Your account has been created successfully"
}
]
}

View File

@ -0,0 +1,668 @@
{
"action.cancel-button": [
{
"type": 0,
"value": "Cancel"
}
],
"action.close-button": [
{
"type": 0,
"value": "Close"
}
],
"action.delete": [
{
"type": 0,
"value": "Delete"
}
],
"action.delete-description": [
{
"type": 0,
"value": "Deleted mindmap can not be recovered. Do you want to continue ?."
}
],
"action.delete-title": [
{
"type": 0,
"value": "Delete"
}
],
"action.duplicate": [
{
"type": 0,
"value": "Duplicate"
}
],
"action.export": [
{
"type": 0,
"value": "Export"
}
],
"action.history": [
{
"type": 0,
"value": "History"
}
],
"action.history-description": [
{
"type": 0,
"value": "List of changes introduced in the last 90 days."
}
],
"action.history-title": [
{
"type": 0,
"value": "Version history"
}
],
"action.import": [
{
"type": 0,
"value": "Import"
}
],
"action.info": [
{
"type": 0,
"value": "Info"
}
],
"action.label": [
{
"type": 0,
"value": "Add Label"
}
],
"action.new": [
{
"type": 0,
"value": "New Map"
}
],
"action.open": [
{
"type": 0,
"value": "Open"
}
],
"action.print": [
{
"type": 0,
"value": "Print"
}
],
"action.publish": [
{
"type": 0,
"value": "Publish"
}
],
"action.rename": [
{
"type": 0,
"value": "Rename"
}
],
"action.rename-description-placeholder": [
{
"type": 0,
"value": "Description"
}
],
"action.rename-name-placeholder": [
{
"type": 0,
"value": "Name"
}
],
"action.share": [
{
"type": 0,
"value": "Share"
}
],
"common.wait": [
{
"type": 0,
"value": "Please wait ..."
}
],
"create.button": [
{
"type": 0,
"value": "Create"
}
],
"create.description": [
{
"type": 0,
"value": "Please, fill the new map name and description."
}
],
"create.title": [
{
"type": 0,
"value": "Create a new mindmap"
}
],
"deletem.title": [
{
"type": 0,
"value": "All selected maps will be deleted"
}
],
"duplicate.title": [
{
"type": 0,
"value": "Duplicate"
}
],
"expired.description": [
{
"type": 0,
"value": "Your current session has expired. Please, sign in and try again."
}
],
"expired.title": [
{
"type": 0,
"value": "Your session has expired"
}
],
"export.document": [
{
"type": 0,
"value": "Mindmap Tools: Export your mindmap in thirdparty mindmap tool formats"
}
],
"export.image": [
{
"type": 0,
"value": "Image: Get a graphic representation of your map including all colors and shapes."
}
],
"export.title": [
{
"type": 0,
"value": "Export"
}
],
"export.warning": [
{
"type": 0,
"value": "Exporting to Image (SVG,PNG,JPEG )is available only in the editor toolbar."
}
],
"footer.aboutus": [
{
"type": 0,
"value": "About Us"
}
],
"footer.contactus": [
{
"type": 0,
"value": "Contact Us"
}
],
"footer.faq": [
{
"type": 0,
"value": "F.A.Q."
}
],
"footer.faqandhelp": [
{
"type": 0,
"value": "Help & FAQ"
}
],
"footer.feedback": [
{
"type": 0,
"value": "Feedback"
}
],
"footer.opensource": [
{
"type": 0,
"value": "Open Source"
}
],
"footer.others": [
{
"type": 0,
"value": "Others"
}
],
"footer.termsandconditions": [
{
"type": 0,
"value": "Term And Conditions"
}
],
"forgot.desc": [
{
"type": 0,
"value": "We will send you an email to reset your password"
}
],
"forgot.email": [
{
"type": 0,
"value": "Email"
}
],
"forgot.register": [
{
"type": 0,
"value": "Send recovery link"
}
],
"forgot.success.desc": [
{
"type": 0,
"value": "We've sent you an email that will allow you to reset your password. Please check your email now."
}
],
"forgot.success.title": [
{
"type": 0,
"value": "Your temporal password has been sent"
}
],
"forgot.title": [
{
"type": 0,
"value": "Reset your password"
}
],
"header.donthaveaccount": [
{
"type": 0,
"value": "Don't have an account ?"
}
],
"header.haveaccount": [
{
"type": 0,
"value": "Already have an account?"
}
],
"history.no-changes": [
{
"type": 0,
"value": "There is no changes available"
}
],
"import.button": [
{
"type": 0,
"value": "Create"
}
],
"import.description": [
{
"type": 0,
"value": "You can import FreeMind 1.0.1 and WiseMapping maps to your list of maps. Select the file you want to import."
}
],
"import.title": [
{
"type": 0,
"value": "Import existing mindmap"
}
],
"info.basic-info": [
{
"type": 0,
"value": "Basic Info"
}
],
"info.button": [
{
"type": 0,
"value": "Accept"
}
],
"info.creation-time": [
{
"type": 0,
"value": "Creation Date"
}
],
"info.creator": [
{
"type": 0,
"value": "Creator"
}
],
"info.description": [
{
"type": 0,
"value": "Description"
}
],
"info.description-msg": [
{
"type": 0,
"value": "By publishing the map you make it visible to everyone on the Internet."
}
],
"info.modified-time": [
{
"type": 0,
"value": "Last Modified Date"
}
],
"info.modified-tny": [
{
"type": 0,
"value": "Last Modified By"
}
],
"info.name": [
{
"type": 0,
"value": "Name"
}
],
"info.public-visibility": [
{
"type": 0,
"value": "Publicly Visible"
}
],
"info.sharing": [
{
"type": 0,
"value": "Sharing"
}
],
"info.starred": [
{
"type": 0,
"value": "Starred"
}
],
"info.title": [
{
"type": 0,
"value": "Info"
}
],
"login.desc": [
{
"type": 0,
"value": "Log into your account"
}
],
"login.email": [
{
"type": 0,
"value": "Email"
}
],
"login.error": [
{
"type": 0,
"value": "The email address or password you entered is not valid."
}
],
"login.forgotpwd": [
{
"type": 0,
"value": "Forgot Password ?"
}
],
"login.hsqldbcofig": [
{
"type": 0,
"value": "Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.7 instead. You can find more information how to configure MySQL"
}
],
"login.password": [
{
"type": 0,
"value": "Password"
}
],
"login.remberme": [
{
"type": 0,
"value": "Remember me"
}
],
"login.signin": [
{
"type": 0,
"value": "Sign In"
}
],
"login.signup": [
{
"type": 0,
"value": "Sign Up"
}
],
"login.title": [
{
"type": 0,
"value": "Welcome"
}
],
"login.userinactive": [
{
"type": 0,
"value": "Sorry, your account has not been activated yet. You'll receive a notification email when it becomes active. Stay tuned!."
}
],
"map.creator": [
{
"type": 0,
"value": "Creator"
}
],
"map.last-update": [
{
"type": 0,
"value": "Last Update"
}
],
"map.more-actions": [
{
"type": 0,
"value": "More Actions"
}
],
"map.name": [
{
"type": 0,
"value": "Name"
}
],
"maps.choose-file": [
{
"type": 0,
"value": "Choose a file"
}
],
"maps.create-tooltip": [
{
"type": 0,
"value": "Create a New Map"
}
],
"maps.empty-result": [
{
"type": 0,
"value": "No matching record found with the current filter criteria."
}
],
"maps.import-desc": [
{
"type": 0,
"value": "Import from other tools"
}
],
"maps.modified": [
{
"type": 0,
"value": "Modified"
}
],
"maps.modified-by": [
{
"type": 0,
"value": "Modified By"
}
],
"maps.revert": [
{
"type": 0,
"value": "Revert"
}
],
"maps.view": [
{
"type": 0,
"value": "View"
}
],
"menu.account": [
{
"type": 0,
"value": "Account"
}
],
"menu.signout": [
{
"type": 0,
"value": "Sign Out"
}
],
"publish.button": [
{
"type": 0,
"value": "Accept"
}
],
"publish.checkbox": [
{
"type": 0,
"value": "Enable public sharing"
}
],
"publish.description": [
{
"type": 0,
"value": "By publishing the map you make it visible to everyone on the Internet."
}
],
"publish.embedded": [
{
"type": 0,
"value": "Embedded"
}
],
"publish.embedded-msg": [
{
"type": 0,
"value": "Copy this snippet of code to embed in your blog or page:"
}
],
"publish.public-url": [
{
"type": 0,
"value": "Public URL"
}
],
"publish.public-url-msg": [
{
"type": 0,
"value": "Copy and paste the link below to share your map with colleagues:"
}
],
"publish.title": [
{
"type": 0,
"value": "Publish"
}
],
"registration.desc": [
{
"type": 0,
"value": "Signing up is free and just take a moment"
}
],
"registration.email": [
{
"type": 0,
"value": "Email"
}
],
"registration.firstname": [
{
"type": 0,
"value": "First Name"
}
],
"registration.lastname": [
{
"type": 0,
"value": "Last Name"
}
],
"registration.password": [
{
"type": 0,
"value": "Password"
}
],
"registration.register": [
{
"type": 0,
"value": "Register"
}
],
"registration.success.desc": [
{
"type": 0,
"value": "Click 'Sign In' button below and start creating mind maps."
}
],
"registration.termandconditions": [
{
"type": 0,
"value": "Terms of Client: Please check the WiseMapping Account information you've entered above, and review the Terms of Client here. By clicking on 'Register' below you are agreeing to the Terms of Client above and the Privacy Policy"
}
],
"registration.title": [
{
"type": 0,
"value": "Become a member"
}
],
"rename.description": [
{
"type": 0,
"value": "Please, fill the new map name and description."
}
],
"rename.title": [
{
"type": 0,
"value": "Rename"
}
],
"resetpassword.success.title": [
{
"type": 0,
"value": "Your account has been created successfully"
}
]
}

View File

@ -1,14 +1,4 @@
import { createMuiTheme } from '@material-ui/core';
import { createGlobalStyle } from 'styled-components';
const GlobalStyle = createGlobalStyle`
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;600&display=swap');
* {
box-sizing: border-box;
}
`;
const theme = createMuiTheme({
overrides: {
@ -87,5 +77,5 @@ const theme = createMuiTheme({
}
});
export { GlobalStyle, theme };
export {theme };