Skip to content

Commit afb87be

Browse files
committed
Refactor theme management and update dependencies; add ESLint configuration and Prettier settings
1 parent ba8551d commit afb87be

20 files changed

Lines changed: 329 additions & 75 deletions

cs-queue-calendar/package-lock.json

Lines changed: 110 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cs-queue-calendar/package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"private": true,
66
"dependencies": {
77
"antd": "^5.23.0",
8+
"caniuse-lite": "^1.0.30001741",
89
"cra-template": "1.2.0",
910
"crypto-js": "^4.2.0",
1011
"date-fns": "^4.1.0",
@@ -27,7 +28,9 @@
2728
"deploy": "gh-pages -d build",
2829
"build": "react-scripts build",
2930
"test": "react-scripts test",
30-
"eject": "react-scripts eject"
31+
"eject": "react-scripts eject",
32+
"lint": "eslint src --ext .js,.jsx --format stylish --max-warnings=0",
33+
"lint:fix": "eslint src --ext .js,.jsx --format stylish --max-warnings=0 --fix"
3134
},
3235
"eslintConfig": {
3336
"extends": [
@@ -48,6 +51,12 @@
4851
]
4952
},
5053
"devDependencies": {
51-
"cross-env": "^7.0.3"
54+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
55+
"@eslint/js": "^9.35.0",
56+
"cross-env": "^7.0.3",
57+
"eslint": "^8.57.1",
58+
"eslint-plugin-react-hooks": "^5.2.0",
59+
"eslint-plugin-react-refresh": "^0.4.20",
60+
"globals": "^16.4.0"
5261
}
5362
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dependencies
2+
node_modules
3+
package.json
4+
package-lock.json
5+
yarn.lock
6+
pnpm-lock.yaml
7+
8+
# Build / output folders
9+
build
10+
dist
11+
.next
12+
out
13+
coverage
14+
15+
# Logs and system files
16+
*.log
17+
.DS_Store
18+
19+
# IDE / editor settings
20+
.vscode
21+
.idea
22+
23+
# Auto-generated / compiled files
24+
*.min.js
25+
*.min.css
26+
*.bundle.js
27+
*.map
28+
29+
# Test snapshots
30+
*.snap
31+
32+
# Static assets
33+
public/*
34+
!public/index.html

cs-queue-calendar/src/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"semi": true,
5+
"singleQuote": false,
6+
"endOfLine": "lf"
7+
}

cs-queue-calendar/src/App.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import React, { useContext, useEffect, useState } from "react";
1+
import React, { useContext, useState } from "react";
22
import { ConfigProvider, theme } from "antd";
33
import Header from "./components/Header";
44
import Footer from "./components/Footer";
55
import CSCalendar from "./components/CSCalendar";
6-
import { ThemeContext } from "./store/ThemeContext";
76
import FloatButtonSection from "./components/FloatButtonSection";
87
import AnnouncementModule from "./components/AnnouncementModule";
98
import Toastify from "./components/Toastify";
9+
import { ThemeContext } from "./store/Theme/ThemeContext";
1010

1111
const App = () => {
1212
const [isModalOpen, setIsModalOpen] = useState(false);
1313
const [toastifyObj, setToastifyObj] = useState("");
14-
14+
1515
const [addToCurrentWeek, setAddToCurrentWeek] = useState(0);
1616
const [announcementData, setAnnouncementData] = useState({
1717
startWeekDate: "",
@@ -34,12 +34,16 @@ const App = () => {
3434
}}
3535
>
3636
<Toastify toastifyObj={toastifyObj} />
37+
3738
<Header />
39+
3840
<CSCalendar
3941
setAnnouncementData={setAnnouncementData}
4042
addToCurrentWeek={addToCurrentWeek}
4143
/>
44+
4245
<Footer />
46+
4347
<FloatButtonSection setIsModalOpen={setIsModalOpen} />
4448
<ConfigProvider direction={"rtl"}>
4549
<AnnouncementModule
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@import "theme";
2-
@import "media";
3-
@import "header";
4-
@import "footer";
5-
@import "toastify";
6-
@import "cs-calendar";
7-
@import "announcement-module";
8-
@import "float-button-section";
1+
@use "theme";
2+
@use "media";
3+
@use "header";
4+
@use "footer";
5+
@use "toastify";
6+
@use "cs-calendar";
7+
@use "announcement-module";
8+
@use "float-button-section";

cs-queue-calendar/src/assets/scss/components/_cs-calendar.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
.calendar-section{
2+
height: calc(100vh - 128px);
3+
}
4+
15
.ant-badge.ant-badge-status {
26
direction: rtl;
7+
width: 100%;
38
}
49

510
.ant-picker-calendar-date-content::-webkit-scrollbar {
@@ -32,6 +37,10 @@ thead {
3237
border-bottom: 1px solid var(--calendar-border-color) !important;
3338
height: 50px;
3439
padding: 0 9px;
40+
41+
.month-select {
42+
width: 100px !important;
43+
}
3544
}
3645

3746
.ant-picker-calendar {

cs-queue-calendar/src/assets/scss/components/_media.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
min-width: 400px !important;
55
}
66

7+
.calendar-section {
8+
height: unset !important;
9+
}
10+
711
.ant-picker-calendar {
812
margin: 0 10px !important;
913
}
@@ -67,7 +71,7 @@
6771
}
6872
}
6973

70-
@media (max-width: 440px) {
74+
@media (max-width: 458px) {
7175
.calendar-header {
7276
display: flex;
7377
flex-flow: column-reverse;

0 commit comments

Comments
 (0)