-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
目前已知道的缺点有:页面太卡
- Loading branch information
master1lan
committed
Mar 29, 2023
1 parent
d7a2b7a
commit 70aa014
Showing
23 changed files
with
636 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import { useScreenSize } from "@components/proview/screenSize"; | ||
| import { Button } from "@mui/material"; | ||
| import { useGetEuFetchParmas, useSetEuFetchParamas } from "@store/euWhatLook"; | ||
| import { IFetchEUWhatLookIngParmas } from "@utils/fetch/eu6type"; | ||
| import React from "react"; | ||
| import { Link, useMatch } from "react-router-dom"; | ||
| import { RouterList } from "../routernav/index"; | ||
| export default function Index() { | ||
| const isOnline = useMatch("/online"); | ||
| return ( | ||
| <div> | ||
| {isOnline && <OrderSort />} | ||
| {!isOnline && <EULink />} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const EULink = () => { | ||
| const items = RouterList.filter((item) => item.to === "/online"); | ||
| const { lg } = useScreenSize(); | ||
| return ( | ||
| <div> | ||
| {!lg && | ||
| items.map((item) => ( | ||
| <Link to={item.to} key={item.label}> | ||
| <Button | ||
| startIcon={item.startICon} | ||
| title={`前往${item.label}页`} | ||
| className={` text-gray-800 transition-all duration-300 hover:bg-gray-200 rounded-sm bg-white}`} | ||
| > | ||
| {item.label} | ||
| </Button> | ||
| </Link> | ||
| ))} | ||
| </div> | ||
| ); | ||
| }; | ||
| type OrderItem = { | ||
| label: string; | ||
| param: IFetchEUWhatLookIngParmas; | ||
| }; | ||
| const OrderItemLists: OrderItem[] = [ | ||
| { | ||
| label: "在线人数", | ||
| param: "online", | ||
| }, | ||
| { | ||
| label: "投稿时间", | ||
| param: "pubdate", | ||
| }, | ||
| ]; | ||
| const OrderSort = () => { | ||
| const curParmas = useGetEuFetchParmas(); | ||
| const filterItem = OrderItemLists.filter((item) => item.param !== curParmas); | ||
| const curItem = OrderItemLists.filter((item) => item.param === curParmas); | ||
| const updateParamer = useSetEuFetchParamas(), | ||
| handleUpdateParmas = () => updateParamer(filterItem[0].param); | ||
| return ( | ||
| <div> | ||
| {curItem.map((item) => ( | ||
| <button | ||
| className='px-4 py-2 rounded-sm hover:bg-gray-200 transition-all duration-200' | ||
| type='button' | ||
| key={item.label} | ||
| onClick={handleUpdateParmas} | ||
| title={`当前排序规则`} | ||
| > | ||
| {item.label} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| ); | ||
| }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,5 +77,5 @@ | |
| } | ||
|
|
||
| .suggestMaxHeight { | ||
| max-height: calc(100vh - 200px); | ||
| max-height: calc(100vh - 160px); | ||
| } | ||
Oops, something went wrong.