moves the apikeymodal mounting one level down to simplify

This commit is contained in:
ajaythapliyal
2023-02-18 08:20:20 +05:30
parent 779253ef15
commit 5341d03749
2 changed files with 18 additions and 16 deletions

View File

@@ -1,31 +1,18 @@
import { Routes, Route } from 'react-router-dom';
import Navigation from './Navigation';
import Conversation from './conversation/Conversation';
import APIKeyModal from './preferences/APIKeyModal';
import About from './About';
import { useState } from 'react';
import { ActiveState } from './models/misc';
import { selectApiKeyStatus } from './preferences/preferenceSlice';
import { useSelector } from 'react-redux';
export default function App() {
const isApiKeySet = useSelector(selectApiKeyStatus);
const [navState, setNavState] = useState<ActiveState>('ACTIVE');
const [apiKeyModalState, setApiKeyModalState] = useState<ActiveState>(
isApiKeySet ? 'INACTIVE' : 'ACTIVE',
);
return (
<div className="min-h-full min-w-full transition-all">
<APIKeyModal
modalState={apiKeyModalState}
setModalState={setApiKeyModalState}
isCancellable={isApiKeySet}
/>
<Navigation
navState={navState}
setNavState={(val: ActiveState) => setNavState(val)}
setApiKeyModalState={setApiKeyModalState}
/>
<div
className={`${