From 6efbe51c368d923f40db9f8518c6be38cbecc6b0 Mon Sep 17 00:00:00 2001 From: WCY-dt <834421194@qq.com> Date: Wed, 1 May 2024 23:45:43 +0800 Subject: [PATCH] Refractor --- src/components/clusters.tsx | 8 +++-- src/components/content.tsx | 9 ++++-- src/components/footer.tsx | 5 ++-- src/components/header.tsx | 13 ++++---- src/components/linkCard.tsx | 8 +++-- src/popups/confirm.tsx | 13 ++++---- src/popups/login.tsx | 8 +++-- src/popups/notification.tsx | 5 ++-- src/popups/overlay.tsx | 22 ++++++++++++++ src/routers/router.tsx | 17 +++++++---- src/styles/{ => components}/clusters.css | 4 +-- src/styles/{ => components}/content.css | 0 src/styles/{ => components}/footer.css | 0 src/styles/{ => components}/header.css | 0 src/styles/{ => components}/linkCard.css | 0 src/styles/confirm.css | 0 src/styles/popups/confirm.css | 38 ++++++++++++++++++++++++ src/styles/{ => popups}/loading.css | 0 src/styles/{ => popups}/login.css | 0 src/styles/{ => popups}/notification.css | 0 src/styles/popups/overlay.css | 14 +++++++++ src/styles/{ => popups}/popup.css | 0 22 files changed, 129 insertions(+), 35 deletions(-) create mode 100644 src/popups/overlay.tsx rename src/styles/{ => components}/clusters.css (96%) rename src/styles/{ => components}/content.css (100%) rename src/styles/{ => components}/footer.css (100%) rename src/styles/{ => components}/header.css (100%) rename src/styles/{ => components}/linkCard.css (100%) delete mode 100644 src/styles/confirm.css create mode 100644 src/styles/popups/confirm.css rename src/styles/{ => popups}/loading.css (100%) rename src/styles/{ => popups}/login.css (100%) rename src/styles/{ => popups}/notification.css (100%) create mode 100644 src/styles/popups/overlay.css rename src/styles/{ => popups}/popup.css (100%) diff --git a/src/components/clusters.tsx b/src/components/clusters.tsx index 5eb2f7e..1685327 100644 --- a/src/components/clusters.tsx +++ b/src/components/clusters.tsx @@ -1,9 +1,11 @@ import React, { useEffect, useState } from 'react'; + import LinkCard from '../components/linkCard'; import ClearFilter from '../utils/clearFilter'; import { fetchAndFilterData } from '../services/dataFetcher'; -import '../styles/clusters.css'; -import '../styles/loading.css'; + +import '../styles/components/clusters.css'; +import '../styles/popups/loading.css'; interface ClustersProps { dataKey: string; @@ -57,4 +59,4 @@ function Clusters({ dataKey, searchTerm, setSearchTerm, isLogedIn, token, messag ); } -export default Clusters; \ No newline at end of file +export default Clusters; diff --git a/src/components/content.tsx b/src/components/content.tsx index bdb7bb0..fa76eab 100644 --- a/src/components/content.tsx +++ b/src/components/content.tsx @@ -1,7 +1,9 @@ import React from 'react'; import { Route, Routes } from 'react-router-dom'; + import Cluster from '../components/clusters'; -import '../styles/content.css'; + +import '../styles/components/content.css'; interface ContentProps { routes: { [key: string]: string }; @@ -12,9 +14,10 @@ interface ContentProps { setToken: (value: string) => void; message: string | null; setMessage: (value: string | null) => void; + setShowOverlay: (value: boolean) => void; } -function Content({ routes, searchTerm, setSearchTerm, isLogedIn, token, setToken, message, setMessage }: ContentProps) { +function Content({ routes, searchTerm, setSearchTerm, isLogedIn, token, setToken, message, setMessage, setShowOverlay }: ContentProps) { return (