mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(organization): add logo support for organizations
This commit is contained in:
@@ -35,14 +35,16 @@ export function AddOrganization({ organizationId }: Props) {
|
||||
: api.organization.create.useMutation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [name, setName] = useState("");
|
||||
const [logo, setLogo] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
if (organization) {
|
||||
setName(organization.name);
|
||||
setLogo(organization.logo || "");
|
||||
}
|
||||
}, [organization]);
|
||||
const handleSubmit = async () => {
|
||||
await mutateAsync({ name, organizationId: organizationId ?? "" })
|
||||
await mutateAsync({ name, logo, organizationId: organizationId ?? "" })
|
||||
.then(() => {
|
||||
setOpen(false);
|
||||
toast.success(
|
||||
@@ -91,7 +93,7 @@ export function AddOrganization({ organizationId }: Props) {
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
{organizationId
|
||||
? "Update the organization name"
|
||||
? "Update the organization name and logo"
|
||||
: "Create a new organization to manage your projects."}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
@@ -107,6 +109,18 @@ export function AddOrganization({ organizationId }: Props) {
|
||||
className="col-span-3"
|
||||
/>
|
||||
</div>
|
||||
<div className="grid grid-cols-4 items-center gap-4">
|
||||
<Label htmlFor="logo" className="text-right">
|
||||
Logo URL
|
||||
</Label>
|
||||
<Input
|
||||
id="logo"
|
||||
value={logo}
|
||||
onChange={(e) => setLogo(e.target.value)}
|
||||
placeholder="https://example.com/logo.png"
|
||||
className="col-span-3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button type="submit" onClick={handleSubmit} isLoading={isLoading}>
|
||||
|
||||
Reference in New Issue
Block a user