Skip to content

Commit

Permalink
Merge pull request #22 from BQXBQX/dev-bqx
Browse files Browse the repository at this point in the history
Dev bqx
  • Loading branch information
BQXBQX authored Feb 25, 2024
2 parents 4ec1930 + ec7b349 commit f551118
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 9 deletions.
20 changes: 19 additions & 1 deletion packages/competition/src/pages/login/page.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions packages/competition/src/utils/router/loader.ts
Original file line number Diff line number Diff line change
@@ -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;
};
Expand Down
2 changes: 2 additions & 0 deletions packages/competition/src/utils/web/interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ instance.interceptors.request.use((config) => {
console.log("hello");
return config;
});

// instance.interceptors.response.use(())
2 changes: 1 addition & 1 deletion packages/competition/src/utils/web/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const BASE_URL = "/test";
const TIMEOUT_MILLISECONDS = 60000; // 超时链接

const instance = axios.create({
//生产环境中禁止跨域
// 生产环境中禁止跨域
// withCredentials: false,
baseURL: BASE_URL,
timeout: TIMEOUT_MILLISECONDS,
Expand Down
1 change: 1 addition & 0 deletions packages/ui/lib/CodeEditor/CodeEditor.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/lib/Pagination/Pagination.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
@use '../variables' as *;
.base {
display: flex;
flex-direction: row;
gap: 5px;
&.disabled {
@include disabled;
}
.pagination-item {
width: 32px;
height: 32px;
Expand Down
16 changes: 12 additions & 4 deletions packages/ui/lib/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
type="select"
key={i}
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -94,6 +95,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
<PaginationItem
type="select"
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -109,6 +111,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
<PaginationItem
type="select"
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -122,6 +125,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
<PaginationItem
type="select"
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -137,6 +141,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
<PaginationItem
type="select"
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -148,7 +153,8 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
newItems.push(
<PaginationItem
type="select"
index={1}
index={0}
disabled={disabled}
>
{1}
</PaginationItem>,
Expand All @@ -163,6 +169,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
<PaginationItem
type="select"
index={i}
disabled={disabled}
>
{i + 1}
</PaginationItem>,
Expand All @@ -176,7 +183,8 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
newItems.push(
<PaginationItem
type="select"
index={pageNumber}
index={pageNumber - 1}
disabled={disabled}
>
{pageNumber}
</PaginationItem>,
Expand All @@ -197,7 +205,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
>
<PaginationItem
type="delete"
disabled={currentPage === 1}
disabled={currentPage === 1 || disabled}
>
<svg
width="16"
Expand All @@ -212,7 +220,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(
{itemList}
<PaginationItem
type="add"
disabled={currentPage === pageNumber}
disabled={currentPage === pageNumber || disabled}
>
<svg
width="16"
Expand Down
1 change: 1 addition & 0 deletions packages/ui/lib/Select/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const defaultProps: SelectProps = {
onchange: test,
disabled: false,
isBorder: true,
defaultSelectKey: 1,
placeHolder: '',
};

Expand Down
5 changes: 4 additions & 1 deletion packages/ui/lib/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export const Select = React.forwardRef<HTMLDivElement, SelectProps>(

useEffect(() => {
onchange && selectItem && onchange(selectItem);
selectItem?.label && setInputValue('');
console.log(selectItem?.label);

selectItem?.label && setSelectPlaceHolder(selectItem.label);
}, [selectItem, onchange]);

const handleOptions = (value: string) => {
Expand Down Expand Up @@ -138,6 +140,7 @@ export const Select = React.forwardRef<HTMLDivElement, SelectProps>(
label={title}
isBorder={isBorder}
placeholder={selectPlaceHolder}
disabled={disabled}
></Input>
<div className={`${styles['options']} ${visible ? styles['show'] : ''}`}>
{!options.length ? (
Expand Down

0 comments on commit f551118

Please sign in to comment.