Skip to content
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

add: recommended image sizes #848

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/Onboarding/Screens/GardenMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ function GardenMetadata() {
file={formData[GARDEN_LOGO_TYPE]}
id="file-uploader-0"
label="HEADER LOGO"
description="Recommended Height: 40px"
onDragAccepted={handleOnDragAccepted}
onDragRejected={handleOnDragRejected}
onFileUpdated={handleOnGardenLogoTypeUpdated}
Expand All @@ -344,6 +345,7 @@ function GardenMetadata() {
file={formData[GARDEN_LOGO]}
id="file-uploader-1"
label="GARDEN LOGO"
description="Recommended Size: 256x256px"
onDragAccepted={handleOnDragAccepted}
onDragRejected={handleOnDragRejected}
onFileUpdated={handleOnGardenLogoUpdated}
Expand All @@ -360,6 +362,7 @@ function GardenMetadata() {
file={formData[TOKEN_LOGO]}
id="file-uploader-2"
label="GARDEN TOKEN ICON"
description="Recommended Size: 256x256px"
onDragAccepted={handleOnDragAccepted}
onDragRejected={handleOnDragRejected}
onFileUpdated={handleOnTokenLogoUpdated}
Expand All @@ -369,20 +372,29 @@ function GardenMetadata() {
<div
css={`
width: 100%;
font-size: 0.8rem;
`}
>
<FileUploaderField
allowedMIMETypes={['image/jpeg', 'image/png']}
file={formData[GARDEN_TOKEN_ICON]}
id="file-uploader-3"
label="EXISTING TOKEN ICON"
description="Recommended Size: 256x256px"
onDragAccepted={handleOnDragAccepted}
onDragRejected={handleOnDragRejected}
onFileUpdated={handleOnWrappableTokenLogoUpdated}
/>
</div>
) : null}
</div>
<Info
css={`
margin-bottom: ${4 * GU}px;
`}
>
The header logo height will be set to 40px. Adjust the width accordingly. Garden logo and token should be sized at a 1:1 ratio. The size can be larger but will be scaled down.
</Info>
</div>
</MetadataField>
<LinksBox
Expand Down
18 changes: 14 additions & 4 deletions src/components/Onboarding/kit/FileUploaderField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const FileUploaderField = ({
required = false,
}) => {
const theme = useTheme()
const iconSize = 7 * GU
const iconSize = 6 * GU
const validExtensions = allowedMIMETypes?.map(f =>
mimeToExtension(f).toUpperCase()
)
Expand Down Expand Up @@ -117,14 +117,13 @@ export const FileUploaderField = ({
margin-top: ${1 * GU}px;
`}
>
{description}
</div>
</Field>
)}
{/* Set dropzone here due to some problems with the field component and the onclick event bubbling. */}
<Card
width="100%"
height="135px"
height="160px"
css={`
border-style: dashed;
background-color: ${backgroundColor};
Expand Down Expand Up @@ -172,6 +171,17 @@ export const FileUploaderField = ({
transition: background-color 0.5s;
`}
>
<div
css={`
margin-top: ${1 * GU}px;
margin-bottom: ${1 * GU}px;
color: ${theme.contentSecondary};
${textStyle('body2')};
`}
>
{description}
</div>

<div
css={`
border-radius: 50%;
Expand All @@ -182,7 +192,7 @@ export const FileUploaderField = ({
display: flex;
justify-content: center;
align-items: center;
margin-bottom: ${1 * GU}px;
margin: ${0.5 * GU}px 0px ${1.5 * GU}px;
`}
onClick={open}
>
Expand Down