chore: fix tiny UIs

This commit is contained in:
Tristan Yang
2023-03-06 09:51:10 +08:00
parent 98402eb119
commit 8a1807b3a1
7 changed files with 10 additions and 14 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="16" height="12" viewBox="0 0 16 12" fill="#78787C" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_9046_23916)"> <g clip-path="url(#clip0_9046_23916)">
<path d="M4.93942 9.69781L1.62578 6.38648C1.25336 6.01431 0.651746 6.01431 0.27932 6.38648C-0.0931066 6.75865 -0.0931066 7.35984 0.27932 7.73201L4.27096 11.7209C4.64339 12.093 5.245 12.093 5.61743 11.7209L15.7207 1.62465C16.0931 1.25248 16.0931 0.651292 15.7207 0.279125C15.3483 -0.0930417 14.7466 -0.0930417 14.3742 0.279125L4.93942 9.69781Z" fill="#78787C"/> <path d="M4.93942 9.69781L1.62578 6.38648C1.25336 6.01431 0.651746 6.01431 0.27932 6.38648C-0.0931066 6.75865 -0.0931066 7.35984 0.27932 7.73201L4.27096 11.7209C4.64339 12.093 5.245 12.093 5.61743 11.7209L15.7207 1.62465C16.0931 1.25248 16.0931 0.651292 15.7207 0.279125C15.3483 -0.0930417 14.7466 -0.0930417 14.3742 0.279125L4.93942 9.69781Z"/>
</g> </g>
<defs> <defs>
<clipPath id="clip0_9046_23916"> <clipPath id="clip0_9046_23916">

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 600 B

@@ -96,7 +96,7 @@ const MemberList: FC<Props> = ({ cid }) => {
})} })}
> >
{t("admin")} {t("admin")}
{is_admin && <IconCheck className="icon" />} {is_admin && <IconCheck className="icon dark:fill-white" />}
</li> </li>
<li <li
className="item sb" className="item sb"
@@ -107,7 +107,7 @@ const MemberList: FC<Props> = ({ cid }) => {
})} })}
> >
{t("user")} {t("user")}
{!is_admin && <IconCheck className="icon" />} {!is_admin && <IconCheck className="icon dark:fill-white" />}
</li> </li>
</ul> </ul>
} }
+2 -2
View File
@@ -24,9 +24,9 @@ const UsersModal: FC<Props> = ({ closeModal }) => {
return ( return (
<Modal> <Modal>
<div className="flex flex-col w-80 md:w-[440px] max-h-[402px] bg-white drop-shadow rounded-lg" ref={wrapperRef}> <div className="flex flex-col w-80 md:w-[440px] max-h-[402px] bg-white dark:bg-gray-900 drop-shadow rounded-lg" ref={wrapperRef}>
<div className="shadow-md p-2"> <div className="shadow-md p-2">
<input className=" p-2 text-sm" value={input} onChange={handleSearch} placeholder={t("search_user_placeholder")} /> <input className="p-2 text-sm bg-transparent dark:text-white" value={input} onChange={handleSearch} placeholder={t("search_user_placeholder")} />
</div> </div>
{users && ( {users && (
<ul className="flex flex-col overflow-y-scroll h-[260px] py-4"> <ul className="flex flex-col overflow-y-scroll h-[260px] py-4">
+1 -1
View File
@@ -59,7 +59,7 @@ const Select: FC<Props> = ({ options = [], updateSelect = null, current = null }
} }
> >
<div className="select-none border border-solid border-slate-200 p-2 flex items-center gap-2" onClick={toggleVisible}> <div className="select-none border border-solid border-slate-200 p-2 flex items-center gap-2" onClick={toggleVisible}>
<span className="text-sm text-gray-500 min-w-[76px]">{(current !== null ? current : curr)?.title || t("action.select")}</span> <span className="text-sm text-gray-500 dark:text-gray-200 min-w-[76px]">{(current !== null ? current : curr)?.title || t("action.select")}</span>
<IconArrow className="!w-5 !h-5" /> <IconArrow className="!w-5 !h-5" />
</div> </div>
</Tippy> </Tippy>
+1 -6
View File
@@ -37,7 +37,6 @@ const getQueryString = (params: { [key: string]: string }) => {
}; };
let SSE: EventSource | undefined; let SSE: EventSource | undefined;
// let connectionIsOpen = false;
// let opened = false; //标识SSE打开过 // let opened = false; //标识SSE打开过
let aliveInter: number | ReturnType<typeof setTimeout> = 0; let aliveInter: number | ReturnType<typeof setTimeout> = 0;
export default function useStreaming() { export default function useStreaming() {
@@ -59,7 +58,7 @@ export default function useStreaming() {
console.info("debug SSE: clear prev timeout", aliveInter); console.info("debug SSE: clear prev timeout", aliveInter);
aliveInter = setTimeout(() => { aliveInter = setTimeout(() => {
console.info("debug SSE: start reconnect"); console.info("debug SSE: start reconnect");
// 有网的情况再试 // 判断有网再试
if (navigator.onLine) { if (navigator.onLine) {
console.info("debug SSE: start reconnect onLine"); console.info("debug SSE: start reconnect onLine");
// 重启连接 // 重启连接
@@ -71,10 +70,6 @@ export default function useStreaming() {
console.info("debug SSE: start new timeout", aliveInter); console.info("debug SSE: start new timeout", aliveInter);
}; };
const startStreaming = useCallback(async () => { const startStreaming = useCallback(async () => {
// if (connectionIsOpen) {
// console.log("connection is open, return");
// return;
// };
console.info("debug SSE: clear timeout at startStreaming", aliveInter); console.info("debug SSE: clear timeout at startStreaming", aliveInter);
clearTimeout(aliveInter); clearTimeout(aliveInter);
if (SSE && (SSE.readyState === EventSource.OPEN || SSE.readyState === EventSource.CONNECTING)) { if (SSE && (SSE.readyState === EventSource.OPEN || SSE.readyState === EventSource.CONNECTING)) {
+1
View File
@@ -33,6 +33,7 @@ export default function Register() {
// const navigateTo = useNavigate(); // const navigateTo = useNavigate();
const [input, setInput] = useState<AuthForm>({ const [input, setInput] = useState<AuthForm>({
name: "",
email: "", email: "",
password: "", password: "",
confirmPassword: "" confirmPassword: ""
+1 -1
View File
@@ -29,7 +29,7 @@ export default function Overview() {
const isAdmin = loginUser?.is_admin; const isAdmin = loginUser?.is_admin;
return ( return (
<div className="relative w-full md:w-[512px] h-full flex flex-col gap-6"> <div className="relative w-full md:w-[512px] flex flex-col gap-6">
<Server /> <Server />
{isAdmin && ( {isAdmin && (
<> <>