Delete MainComponent.tsx
This commit is contained in:
parent
31c4ff6a2a
commit
a28eca4da9
1 changed files with 0 additions and 29 deletions
|
|
@ -1,29 +0,0 @@
|
||||||
import Navigation from "../Navigation/Navigation.tsx";
|
|
||||||
import React, {useState} from "react";
|
|
||||||
import styles from './MainComponent.module.css'
|
|
||||||
import Survey from "../Survey/Survey.tsx";
|
|
||||||
import SettingSurvey from "../SettingSurvey/SettingSurvey.tsx";
|
|
||||||
|
|
||||||
const MainComponent: React.FC = () => {
|
|
||||||
const [activePage, setActivePage] = useState(
|
|
||||||
localStorage.getItem("activePage") || "Вопросы"
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleNavigationClick = (title: string) => {
|
|
||||||
setActivePage(title);
|
|
||||||
localStorage.setItem('activePage', title);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<main className={styles.mainPage}>
|
|
||||||
<Navigation
|
|
||||||
activePage={activePage}
|
|
||||||
onNavigationClick={handleNavigationClick}
|
|
||||||
/>
|
|
||||||
{ activePage === 'Вопросы' && <Survey />}
|
|
||||||
{activePage === 'Настройки' && <SettingSurvey />}
|
|
||||||
</main>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default MainComponent;
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue