-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): add ability to edit question on questions page and single …
…question page for admin (#502) * feat(app): add ability to edit questions on questions list to admin * feat(app): add ability to edit question on question page to admin * fix(app): refetch questions after edit one of them in user panel * fix(app): fix text align in "CtaHedaerActiveLink" * Remove unused import * chore: add prettier config file to worspace config * fix: update questions list after edit any of them in user dashboard * fix: add loading indicator to questions list in dashboards * fix: disable ssr for QuestionsManagement on questions pages * fix: small improvements in "EditAnswer" and "AnswerForm" * fix: remove unused import * fix: refresh ssr generated page after edit question * fix: remove unused import * fix: fix vercel deployment * fix: rename function name "customOnClose" => "additionalActionOnClose" * feat: change loading indicator component * fix: improve "Loading" component styles * fix: improve loader a11y * fix: improve styles of "Loading" component * fix: improve light theme of loading component * Update apps/app/src/components/Loading.tsx * implement "additionalActionOnClose" function in dashboard modals * improve loading component and implement this changes
- Loading branch information
1 parent
41778f1
commit 7c98b84
Showing
17 changed files
with
221 additions
and
53 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
apps/app/src/app/(main-layout)/questions/[technology]/[page]/loading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Loading } from "../../../../../components/Loading"; | ||
|
||
export default function LoadingQuestions() { | ||
return <Loading label="ładowanie pytań" />; | ||
return <Loading label="ładowanie pytań" type="article" withTechnology={false} withFilters />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apps/app/src/components/QuestionsList/QuestionsManagment.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useRouter } from "next/navigation"; | ||
import { useCallback } from "react"; | ||
import { Button } from "../Button/Button"; | ||
import { PrivateElement } from "../PrivateElement"; | ||
import PencilIcon from "../../../public/icons/pencil.svg"; | ||
import { AdminQuestion } from "../../types"; | ||
import { useUIContext } from "../../providers/UIProvider"; | ||
|
||
export const QuestionsManagement = ({ question }: { question: AdminQuestion }) => { | ||
const { openModal } = useUIContext(); | ||
|
||
const router = useRouter(); | ||
const onQuestionUpdate = useCallback(() => { | ||
router.refresh(); | ||
}, [router]); | ||
|
||
return ( | ||
<PrivateElement role="admin"> | ||
<div className="mr-3 flex flex-col justify-start gap-1.5"> | ||
<Button | ||
variant="branding" | ||
className="m-px flex w-24 min-w-0 items-center justify-center gap-2 p-0" | ||
onClick={() => | ||
openModal("AddQuestionModal", { | ||
...question, | ||
additionalActionOnClose: onQuestionUpdate, | ||
}) | ||
} | ||
> | ||
<PencilIcon className="fill-violet-700 dark:fill-neutral-200" /> | ||
Edytuj | ||
</Button> | ||
</div> | ||
</PrivateElement> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.