feat: Implement orgs/teams logoUrls (#13699)

* feat: Implement orgs/teams logoUrls

* Use getAvatarUrl in team/[slug]

* Extract uploadLogo to standalone file for reuse

* Allow removing the team/organisation logo

* fix: API build fail due to server-only, removed
This commit is contained in:
Alex van Andel authored and GitHub committed 2024-02-16 10:35:53 -03:00
1 parent 477e102388
commit c08365f09c
14 files changed
+81 -37

No files matched your search

@@ -325,7 +325,7 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => {
<Controller
control={form.control}
name="logo"
render={({ field: { value } }) => {
render={({ field: { value, onChange } }) => {
const showRemoveLogoButton = !!value;
return (
@@ -340,9 +340,7 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => {
target="avatar"
id="avatar-upload"
buttonMsg={t("upload_logo")}
handleAvatarChange={(newLogo) => {
form.setValue("logo", newLogo, { shouldDirty: true });
}}
handleAvatarChange={onChange}
triggerButtonColor={showRemoveLogoButton ? "secondary" : "primary"}
imageSrc={value ?? undefined}
/>
@@ -350,7 +348,7 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => {
<Button
color="secondary"
onClick={() => {
form.setValue("logo", null, { shouldDirty: true });
onChange(null);
}}>
{t("remove")}
</Button>