Skip to content

Commit

Permalink
fix(console): Screen side image gets downscaled (#2528)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmin-Parvulescu authored Jul 21, 2023
1 parent a05b13c commit b18d69d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions apps/console/app/components/IconPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function pickIcon(
height: number
},
minWidth?: number,
minHeight?: number
minHeight?: number,
variant: string = 'public'
) {
return (e: any) =>
new Promise<any>(async (ok) => {
Expand Down Expand Up @@ -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])
}
}

Expand Down Expand Up @@ -128,6 +129,7 @@ type IconPickerProps = {
setIsFormChanged: (val: boolean) => void
setIsImgUploading: (val: boolean) => void
imageUploadCallback?: (url: string) => void
variant?: string
}

export default function IconPicker({
Expand All @@ -143,6 +145,7 @@ export default function IconPicker({
setIsFormChanged,
setIsImgUploading,
imageUploadCallback = () => {},
variant,
}: IconPickerProps) {
const [icon, setIcon] = useState<string>('')
const [iconUrl, setIconUrl] = useState<string>('')
Expand Down Expand Up @@ -283,7 +286,8 @@ export default function IconPicker({
maxSize,
aspectRatio,
minWidth,
minHeight
minHeight,
variant
)(event)
if (Object.keys(errors).length) {
setInvalidState(true)
Expand Down
1 change: 1 addition & 0 deletions apps/console/app/routes/apps/$clientId/designer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ const AuthPanel = ({
errorMessage={
errors && errors['graphicURL'] ? errors['graphicURL'] : ''
}
variant="PassportAppCover"
/>

{graphicURL && (
Expand Down

0 comments on commit b18d69d

Please sign in to comment.