-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(moderation): hide exchanges by default
- Loading branch information
1 parent
797f070
commit 8338070
Showing
12 changed files
with
80 additions
and
38 deletions.
There are no files selected for viewing
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
53 changes: 32 additions & 21 deletions
53
packages/~/moderations/api/src/:id/Moderation_Exchanges.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,41 +1,52 @@ | ||
// | ||
|
||
import { hyper_ref } from "@~/app.core/html"; | ||
import { hx_trigger_from_body } from "@~/app.core/htmx"; | ||
import { Loader } from "@~/app.ui/loader/Loader"; | ||
import { urls } from "@~/app.urls"; | ||
import { hx_urls } from "@~/app.urls"; | ||
import { MODERATION_EVENTS } from "@~/moderations.lib/event"; | ||
import { usePageRequestContext } from "./context"; | ||
|
||
// | ||
|
||
export function Moderation_Exchanges() { | ||
export async function Moderation_Exchanges() { | ||
const $describedby = hyper_ref(); | ||
const { | ||
var: { moderation }, | ||
} = usePageRequestContext(); | ||
|
||
const hx_query_moderation_emails = await hx_urls.moderations[ | ||
":id" | ||
].email.$get({ | ||
param: { id: moderation.id.toString() }, | ||
query: { describedby: $describedby }, | ||
}); | ||
|
||
return ( | ||
<section> | ||
<h2>Échanges entre {moderation.user.given_name} et nous : </h2> | ||
<details> | ||
<summary> | ||
<h2 class="inline-block" id={$describedby}> | ||
📥️ Échanges entre {moderation.user.given_name} et nous :{" "} | ||
</h2> | ||
</summary> | ||
|
||
<div | ||
hx-get={ | ||
urls.moderations[":id"].email.$url({ | ||
param: { id: moderation.id.toString() }, | ||
}).pathname | ||
} | ||
hx-trigger={[ | ||
"load", | ||
hx_trigger_from_body([ | ||
MODERATION_EVENTS.Enum.MODERATION_EMAIL_UPDATED, | ||
]), | ||
].join(", ")} | ||
> | ||
<div class="my-24 flex flex-col items-center justify-center"> | ||
Chargement des échanges avec {moderation.user.given_name} | ||
<br /> | ||
<Loader /> | ||
<div | ||
{...hx_query_moderation_emails} | ||
hx-trigger={[ | ||
"load", | ||
hx_trigger_from_body([ | ||
MODERATION_EVENTS.Enum.MODERATION_EMAIL_UPDATED, | ||
]), | ||
].join(", ")} | ||
> | ||
<div class="my-24 flex flex-col items-center justify-center"> | ||
Chargement des échanges avec {moderation.user.given_name} | ||
<br /> | ||
<Loader /> | ||
</div> | ||
</div> | ||
</div> | ||
</details> | ||
</section> | ||
); | ||
} |
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