interface: addressed store feedback; cleaning up

This commit is contained in:
Tyler Brown Cifu Shuster 2021-03-08 17:48:24 -08:00
parent e7e03b0956
commit 1b17bcd286
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Switch, Route } from 'react-router-dom'; import { Switch, Route, useHistory } from 'react-router-dom';
import { Center, Text } from "@tlon/indigo-react"; import { Center, Text } from "@tlon/indigo-react";
import { deSig } from '~/logic/lib/util'; import { deSig } from '~/logic/lib/util';
import useGraphState from '~/logic/state/graph'; import useGraphState from '~/logic/state/graph';
@ -8,13 +8,14 @@ import useMetadataState from '~/logic/state/metadata';
const GraphApp = (props) => { const GraphApp = (props) => {
const associations= useMetadataState(state => state.associations); const associations= useMetadataState(state => state.associations);
const graphKeys = useGraphState(state => state.graphKeys); const graphKeys = useGraphState(state => state.graphKeys);
const history = useHistory();
const { api } = this.props; const { api } = props;
return ( return (
<Switch> <Switch>
<Route exact path="/~graph/join/ship/:ship/:name/:module?" <Route exact path="/~graph/join/ship/:ship/:name/:module?"
render={ (props) => { render={(props) => {
const resource = const resource =
`${deSig(props.match.params.ship)}/${props.match.params.name}`; `${deSig(props.match.params.ship)}/${props.match.params.name}`;
const { ship, name } = props.match.params; const { ship, name } = props.match.params;
@ -38,7 +39,7 @@ const GraphApp = (props) => {
if(!graphKeys.has(resource)) { if(!graphKeys.has(resource)) {
autoJoin(); autoJoin();
} else if(!!association) { } else if(!!association) {
props.history.push(`/~landscape/home/resource/${association.metadata.module}${path}`); history.push(`/~landscape/home/resource/${association.metadata.module}${path}`);
} }
return ( return (
<Center width="100%" height="100%"> <Center width="100%" height="100%">

View File

@ -116,10 +116,10 @@ export default function SettingsScreen(props: any) {
/> />
)} )}
{hash === "display" && ( {hash === "display" && (
<DisplayForm storage={props.storage} api={props.api} /> <DisplayForm api={props.api} />
)} )}
{hash === "s3" && ( {hash === "s3" && (
<S3Form storage={props.storage} api={props.api} /> <S3Form api={props.api} />
)} )}
{hash === "leap" && ( {hash === "leap" && (
<LeapSettings api={props.api} /> <LeapSettings api={props.api} />