diff --git a/apps/console/app/components/IconPicker/index.tsx b/apps/console/app/components/IconPicker/index.tsx index deda3cacca..cd6d0b2352 100644 --- a/apps/console/app/components/IconPicker/index.tsx +++ b/apps/console/app/components/IconPicker/index.tsx @@ -19,7 +19,8 @@ function pickIcon( height: number }, minWidth?: number, - minHeight?: number + minHeight?: number, + variant: string = 'public' ) { return (e: any) => new Promise(async (ok) => { @@ -86,12 +87,12 @@ function pickIcon( body: formData, }).then((res) => res.json()) - const publicVariantUrls = cfUploadRes.result.variants.filter((v) => - v.endsWith('public') + const variantUrls = cfUploadRes.result.variants.filter((v) => + v.endsWith(variant) ) - if (publicVariantUrls.length) { - setIconUrl(publicVariantUrls[0]) + if (variantUrls.length) { + setIconUrl(variantUrls[0]) } } @@ -128,6 +129,7 @@ type IconPickerProps = { setIsFormChanged: (val: boolean) => void setIsImgUploading: (val: boolean) => void imageUploadCallback?: (url: string) => void + variant?: string } export default function IconPicker({ @@ -143,6 +145,7 @@ export default function IconPicker({ setIsFormChanged, setIsImgUploading, imageUploadCallback = () => {}, + variant, }: IconPickerProps) { const [icon, setIcon] = useState('') const [iconUrl, setIconUrl] = useState('') @@ -283,7 +286,8 @@ export default function IconPicker({ maxSize, aspectRatio, minWidth, - minHeight + minHeight, + variant )(event) if (Object.keys(errors).length) { setInvalidState(true) diff --git a/apps/console/app/routes/apps/$clientId/designer.tsx b/apps/console/app/routes/apps/$clientId/designer.tsx index 91cb5e77d8..c5371f2b78 100644 --- a/apps/console/app/routes/apps/$clientId/designer.tsx +++ b/apps/console/app/routes/apps/$clientId/designer.tsx @@ -616,6 +616,7 @@ const AuthPanel = ({ errorMessage={ errors && errors['graphicURL'] ? errors['graphicURL'] : '' } + variant="PassportAppCover" /> {graphicURL && (