ReviewDB: Show edit instead of create review where applicable (#466)
Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
parent
e14ec96e21
commit
77c691651e
@ -32,6 +32,7 @@ export default function ReviewsView({ userId }: { userId: string; }) {
|
|||||||
fallbackValue: [],
|
fallbackValue: [],
|
||||||
deps: [refetchCount],
|
deps: [refetchCount],
|
||||||
});
|
});
|
||||||
|
const username = UserStore.getUser(userId)?.username ?? "";
|
||||||
|
|
||||||
const dirtyRefetch = () => setRefetchCount(refetchCount + 1);
|
const dirtyRefetch = () => setRefetchCount(refetchCount + 1);
|
||||||
|
|
||||||
@ -79,7 +80,7 @@ export default function ReviewsView({ userId }: { userId: string; }) {
|
|||||||
<textarea
|
<textarea
|
||||||
className={classes(Classes.textarea.replace("textarea", ""), "enter-comment")}
|
className={classes(Classes.textarea.replace("textarea", ""), "enter-comment")}
|
||||||
// this produces something like '-_59yqs ...' but since no class exists with that name its fine
|
// this produces something like '-_59yqs ...' but since no class exists with that name its fine
|
||||||
placeholder={"Review @" + UserStore.getUser(userId)?.username ?? ""}
|
placeholder={reviews?.some(r => r.senderdiscordid === UserStore.getCurrentUser().id) ? `Update review for @${username}` : `Review @${username}`}
|
||||||
onKeyDown={onKeyPress}
|
onKeyDown={onKeyPress}
|
||||||
style={{
|
style={{
|
||||||
marginTop: "6px",
|
marginTop: "6px",
|
||||||
|
Loading…
Reference in New Issue
Block a user