From 6022a030fd27cc6fd404dd79413aa4c1e77b045a Mon Sep 17 00:00:00 2001 From: BQX Date: Sat, 24 Feb 2024 19:29:18 +0800 Subject: [PATCH 1/3] fix(ui): select bug --- packages/ui/lib/CodeEditor/CodeEditor.module.scss | 1 + packages/ui/lib/Select/Select.stories.tsx | 1 + packages/ui/lib/Select/Select.tsx | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/lib/CodeEditor/CodeEditor.module.scss b/packages/ui/lib/CodeEditor/CodeEditor.module.scss index 7c3fbb6..1cdfe3e 100644 --- a/packages/ui/lib/CodeEditor/CodeEditor.module.scss +++ b/packages/ui/lib/CodeEditor/CodeEditor.module.scss @@ -9,6 +9,7 @@ $padding: 10px; padding: $padding; padding-bottom: 7px; color: var(--black-color); + overflow: hidden; border-radius: $radius-5 $radius-5 0 0; font-weight: 700; box-sizing: border-box; diff --git a/packages/ui/lib/Select/Select.stories.tsx b/packages/ui/lib/Select/Select.stories.tsx index e0ca50f..89aab47 100644 --- a/packages/ui/lib/Select/Select.stories.tsx +++ b/packages/ui/lib/Select/Select.stories.tsx @@ -31,6 +31,7 @@ const defaultProps: SelectProps = { onchange: test, disabled: false, isBorder: true, + defaultSelectKey: 1, placeHolder: '', }; diff --git a/packages/ui/lib/Select/Select.tsx b/packages/ui/lib/Select/Select.tsx index 9bfe880..94af913 100644 --- a/packages/ui/lib/Select/Select.tsx +++ b/packages/ui/lib/Select/Select.tsx @@ -96,7 +96,9 @@ export const Select = React.forwardRef( useEffect(() => { onchange && selectItem && onchange(selectItem); - selectItem?.label && setInputValue(''); + console.log(selectItem?.label); + + selectItem?.label && setSelectPlaceHolder(selectItem.label); }, [selectItem, onchange]); const handleOptions = (value: string) => { @@ -138,6 +140,7 @@ export const Select = React.forwardRef( label={title} isBorder={isBorder} placeholder={selectPlaceHolder} + disabled={disabled} >
{!options.length ? ( From 0681442014ca370b2611083c227e20075a0cdbba Mon Sep 17 00:00:00 2001 From: BQX Date: Sun, 25 Feb 2024 11:25:45 +0800 Subject: [PATCH 2/3] feat(competition): login page animation --- .../src/pages/login/page.module.scss | 20 ++++++++++++++++++- .../competition/src/utils/router/loader.ts | 4 ++-- .../competition/src/utils/web/interceptors.ts | 2 ++ packages/competition/src/utils/web/request.ts | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/competition/src/pages/login/page.module.scss b/packages/competition/src/pages/login/page.module.scss index 9c7dabc..64dd49d 100644 --- a/packages/competition/src/pages/login/page.module.scss +++ b/packages/competition/src/pages/login/page.module.scss @@ -4,8 +4,26 @@ radial-gradient(circle at 65% 35%, #ffce20, transparent), radial-gradient(circle at 25% 85%, #ff8b20, transparent), radial-gradient(circle at 65% 100%, #20ffd7, transparent); - background-blend-mode: screen; position: relative; + background-blend-mode: screen; + position: relative; height: 100vh; width: 100vw; @include flex-center(); + .login-card-container { + animation-name: login-card-show; + animation-duration: 1s; + animation-timing-function: $cubic-bezier; + animation-fill-mode: forwards; + } +} + +@keyframes login-card-show { + from { + opacity: 0.8; + scale: 0.9; + } + to { + opacity: 1; + scale: 1; + } } diff --git a/packages/competition/src/utils/router/loader.ts b/packages/competition/src/utils/router/loader.ts index 594415c..fdd872d 100644 --- a/packages/competition/src/utils/router/loader.ts +++ b/packages/competition/src/utils/router/loader.ts @@ -1,11 +1,11 @@ -import { redirect } from "react-router-dom"; +// import { redirect } from "react-router-dom"; const loader = () => { // const user = await getUser(); const user = false; console.log("is loading"); if (!user) { - return redirect("/login"); + // return redirect("/login"); } return null; }; diff --git a/packages/competition/src/utils/web/interceptors.ts b/packages/competition/src/utils/web/interceptors.ts index 1cfbc91..05efb98 100644 --- a/packages/competition/src/utils/web/interceptors.ts +++ b/packages/competition/src/utils/web/interceptors.ts @@ -4,3 +4,5 @@ instance.interceptors.request.use((config) => { console.log("hello"); return config; }); + +// instance.interceptors.response.use(()) \ No newline at end of file diff --git a/packages/competition/src/utils/web/request.ts b/packages/competition/src/utils/web/request.ts index 35636a2..9b1db22 100644 --- a/packages/competition/src/utils/web/request.ts +++ b/packages/competition/src/utils/web/request.ts @@ -4,7 +4,7 @@ const BASE_URL = "/test"; const TIMEOUT_MILLISECONDS = 60000; // 超时链接 const instance = axios.create({ - //生产环境中禁止跨域 + // 生产环境中禁止跨域 // withCredentials: false, baseURL: BASE_URL, timeout: TIMEOUT_MILLISECONDS, From ec7b349d3d26d49f20dc66b023f819c98f6eb988 Mon Sep 17 00:00:00 2001 From: BQX Date: Sun, 25 Feb 2024 11:43:30 +0800 Subject: [PATCH 3/3] fix(ui): pagination bug --- .../ui/lib/Pagination/Pagination.module.scss | 4 ++++ packages/ui/lib/Pagination/Pagination.tsx | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/ui/lib/Pagination/Pagination.module.scss b/packages/ui/lib/Pagination/Pagination.module.scss index d080091..cf97c05 100644 --- a/packages/ui/lib/Pagination/Pagination.module.scss +++ b/packages/ui/lib/Pagination/Pagination.module.scss @@ -1,7 +1,11 @@ +@use '../variables' as *; .base { display: flex; flex-direction: row; gap: 5px; + &.disabled { + @include disabled; + } .pagination-item { width: 32px; height: 32px; diff --git a/packages/ui/lib/Pagination/Pagination.tsx b/packages/ui/lib/Pagination/Pagination.tsx index cf8f480..4021dd4 100644 --- a/packages/ui/lib/Pagination/Pagination.tsx +++ b/packages/ui/lib/Pagination/Pagination.tsx @@ -81,6 +81,7 @@ export const Pagination = React.forwardRef( type="select" key={i} index={i} + disabled={disabled} > {i + 1} , @@ -94,6 +95,7 @@ export const Pagination = React.forwardRef( {i + 1} , @@ -109,6 +111,7 @@ export const Pagination = React.forwardRef( {i + 1} , @@ -122,6 +125,7 @@ export const Pagination = React.forwardRef( {i + 1} , @@ -137,6 +141,7 @@ export const Pagination = React.forwardRef( {i + 1} , @@ -148,7 +153,8 @@ export const Pagination = React.forwardRef( newItems.push( {1} , @@ -163,6 +169,7 @@ export const Pagination = React.forwardRef( {i + 1} , @@ -176,7 +183,8 @@ export const Pagination = React.forwardRef( newItems.push( {pageNumber} , @@ -197,7 +205,7 @@ export const Pagination = React.forwardRef( > ( {itemList}