Skip to content

Commit

Permalink
feat: add hover style in editor page
Browse files Browse the repository at this point in the history
Co-Authored-By: Snowball_233 <[email protected]>
  • Loading branch information
damesck233 and SnowballXueQiu committed Sep 9, 2024
1 parent d6f1d43 commit ca525b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/(root)/backstage/editor/[id]/DndTable.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.item {
background-color: var(--mantine-color-body);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item:hover {
transform: scale(1.01);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dragHandle {
Expand All @@ -15,4 +21,4 @@

.dragHandle:hover {
background-color: #f0f0f0;
}
}
6 changes: 3 additions & 3 deletions app/(root)/backstage/editor/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function SurveyPage({ params }: { params: { id: number } }) {
const [questions, setQuestions] = useState<Page | undefined>(undefined);
const [answers, setAnswers] = useState<Map<string, string>>(new Map());
const questionsProps = useRef(new Map<string, QuestionProps>());
const [done, setDone] = useState(false); // 控制加载状态
const [done, setDone] = useState(false);
const [showNewQuestion, setShowNewQuestion] = useState(false);
const [newQuestionObject, setNewQuestionObject] = useState<QuestionProps>({
all_points: 0,
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function SurveyPage({ params }: { params: { id: number } }) {
};

useEffect(() => {
setDone(false); // 在开始请求数据时将 done 设为 false
setDone(false);
SurveyApi.getSurvey(params.id).then((res) => {
fetchPage(res.page);
});
Expand All @@ -90,7 +90,7 @@ export default function SurveyPage({ params }: { params: { id: number } }) {
function fetchPage(page: string) {
QuestionApi.fetchPage(page).then((response) => {
setQuestions(response);
setDone(true); // 数据加载完成后,将 done 设为 true
setDone(true);
});
}

Expand Down

0 comments on commit ca525b5

Please sign in to comment.