-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(form-v2/design-2): logo radio buttons and form color theme selection #4271
feat(form-v2/design-2): logo radio buttons and form color theme selection #4271
Conversation
…me and form instructions
…om public header for computation of design constants
…to reuse the same FormHeader and FormBannerLogo components.
…into form-v2/feat/builder-startpage
…at/builder-startpage
… so they can be easily reused.
…at/builder-startpage-2
…' into form-v2/feat/builder-startpage-2-new
export type UploadedImage = { | ||
file?: File | ||
srcUrl?: string | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this type is descriptive enough 🤔? The definition allows a completely empty object, but is that really valid? Or is UploadedImage
a union of 2 types, where at least one of the field is present in each?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we can fix this in a separate PR? The type was originally Partial<{ file: File srcUrl: ImageFieldBase['url'] }>
which this is equivalent to. But I agree that this type should be more restrictive. This fix would require edits to the startpage and editimage.
frontend/src/features/admin-form/create/builder-and-design/useDesignStore.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Problem
This PR implements the form logo uploader tool and color theme selection in the design drawer.
Makes progress towards #3362 and provides parity with angular.
Solution
Breaking Changes
Features:
FileHandlerService.ts
,EditImage.tsx
,UploadImageInput.tsx
UploadedFileData.size
inFileHandlerService.ts
fromstring
tonumber
. As a result, moved stringification of size intoEditImage.tsx
itself. (Necessary due toform.startPage.logo.fileSizeInBytes
being of typenumber
.)attachment
type into its ownUploadedImage
type for reusability with design store.useFormHeader.tsx
getTitleBg
for reusability with design store.StartPageView.tsx
,DesignDrawer.tsx
,useDesignStore.tsx
customLogoMeta
.Before & After Screenshots
Notes