Commit 8812235d authored by Chunchi Che's avatar Chunchi Che

add DeckResults

parent 1e25115b
Pipeline #27608 passed with stages
in 7 minutes and 52 seconds
...@@ -107,7 +107,7 @@ export const CardResults: React.FC<{ ...@@ -107,7 +107,7 @@ export const CardResults: React.FC<{
) : ( ) : (
<div className={styles.empty}> <div className={styles.empty}>
<IconFont type="icon-empty" size={40} /> <IconFont type="icon-empty" size={40} />
<div>无搜索结果</div> <div>找不到相应卡片</div>
</div> </div>
)} )}
</> </>
......
.empty {
gap: 1.25rem;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
import React, { memo } from "react";
import { proxy, useSnapshot } from "valtio";
import { MdproDeck } from "@/api/mdproDeck/schema";
import { IconFont } from "@/ui/Shared";
import styles from "./index.module.scss";
interface Props {
query: string;
page: number;
decks: MdproDeck[];
}
const store = proxy<Props>({ query: "", page: 1, decks: [] });
export const DeckResults: React.FC = memo(() => {
const snap = useSnapshot(store);
return (
<>
{snap.decks.length ? (
<div></div>
) : (
<div className={styles.empty}>
<IconFont type="icon-empty" size={40} />
<div>找不到相应卡组</div>
</div>
)}
</>
);
});
...@@ -21,6 +21,7 @@ import { Filter } from "../Filter"; ...@@ -21,6 +21,7 @@ import { Filter } from "../Filter";
import styles from "../index.module.scss"; import styles from "../index.module.scss";
import { editDeckStore } from "../store"; import { editDeckStore } from "../store";
import { CardResults } from "./CardResults"; import { CardResults } from "./CardResults";
import { DeckResults } from "./DeckResults";
/** 卡片库,选择卡片加入正在编辑的卡组 */ /** 卡片库,选择卡片加入正在编辑的卡组 */
export const DeckDatabase: React.FC = () => { export const DeckDatabase: React.FC = () => {
...@@ -194,7 +195,7 @@ export const DeckDatabase: React.FC = () => { ...@@ -194,7 +195,7 @@ export const DeckDatabase: React.FC = () => {
</div> </div>
<ScrollableArea className={styles["search-cards-container"]} ref={ref}> <ScrollableArea className={styles["search-cards-container"]} ref={ref}>
{showMdproDecks ? ( {showMdproDecks ? (
<></> <DeckResults />
) : ( ) : (
<CardResults results={searchCardResult} scrollToTop={scrollToTop} /> <CardResults results={searchCardResult} scrollToTop={scrollToTop} />
)} )}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment