diff --git a/src/App.tsx b/src/App.tsx index 2efecea..5e89800 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -96,6 +96,8 @@ export const routeResolver = new RouteResolver({ }, settings: { }, + debug: { + }, }); const AppBarWitHistory = withRouter( diff --git a/src/Debug.tsx b/src/Debug.tsx new file mode 100644 index 0000000..ab599a9 --- /dev/null +++ b/src/Debug.tsx @@ -0,0 +1,89 @@ +import * as React from 'react'; +import * as EteSync from 'etesync'; +import Button from '@material-ui/core/Button'; +import TextField from '@material-ui/core/TextField'; + +import Container from './widgets/Container'; +import { useSelector } from 'react-redux'; +import { StoreState, CredentialsData, UserInfoData } from './store'; + +interface PropsType { + etesync: CredentialsData; + userInfo: UserInfoData; +} + +export default function Debug(props: PropsType) { + const [stateJournalUid, setJournalUid] = React.useState(''); + const [entriesUids, setEntriesUids] = React.useState(''); + const [result, setResult] = React.useState(''); + const journals = useSelector((state: StoreState) => state.cache.journals.value)!; + const journalEntries = useSelector((state: StoreState) => state.cache.entries); + + function handleInputChange(func: (value: string) => void) { + return (event: React.ChangeEvent) => { + func(event.target.value); + }; + } + + return ( + +
+ +
+
+ +
+ +
+

Result:

+
{result}
+
+
+ ); +} diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index bec8375..a9d323f 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -17,6 +17,7 @@ import PrettyError from './widgets/PrettyError'; import Journals from './Journals'; import Settings from './Settings'; +import Debug from './Debug'; import Pim from './Pim'; import * as EteSync from 'etesync'; @@ -233,6 +234,16 @@ class SyncGate extends React.PureComponent { /> )} /> + ( + + )} + /> ); }