Skip to content

Commit

Permalink
feat: add drag feat in editor page
Browse files Browse the repository at this point in the history
Co-Authored-By: Snowball_233 <[email protected]>
  • Loading branch information
zrll12 and SnowballXueQiu committed Sep 8, 2024
1 parent 35b4edc commit 734d640
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 283 deletions.
4 changes: 2 additions & 2 deletions api/QuestionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class QuestionApi {
return result;
};

public static updatePage = async (input: Page): Promise<Page> => {
public static updatePage = async (input: Page): Promise<String> => {
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('token', Cookie.getCookie('token'));
Expand All @@ -162,7 +162,7 @@ export default class QuestionApi {
throw new Error('Failed to update question');
}

return res.json();
return res.text();
};

public static updateQuestion = async (input: StringifyQuestionProps) => {
Expand Down
18 changes: 18 additions & 0 deletions app/(root)/backstage/editor/[id]/DndTable.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.item {
background-color: var(--mantine-color-body);
}

.dragHandle {
width: rem(40px);
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-1));
background-color: var(--mantine-color-body);
border-radius: 4px;
}

.dragHandle:hover {
background-color: #f0f0f0;
}
Loading

0 comments on commit 734d640

Please sign in to comment.