-
Notifications
You must be signed in to change notification settings - Fork 123
feat: upload file Area bs component #2523
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: upload file Area bs component #2523
Conversation
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.
Please do the required changes.
import { base64ToURL, imageDataToURL } from "@sparrow/common/utils"; | ||
import FileTypeIcon from "../../../../../../@sparrow-library/src/icons/FileTypeIcon.svelte"; |
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.
Don't import it like this, import it like @sparrow/library/src/icons.
outline: none; | ||
height: 164px; | ||
min-width: 240px; | ||
max-width: 540px; | ||
border-radius: 4px; | ||
font-size: var(--base-text); |
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.
take color as per new norms for example like this --text-ds-
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.
sure I will update it.
} | ||
.file-type-container-two { | ||
border-right: 1px solid var(--border-ds-surface-100); | ||
} | ||
.sparrow-choose-file-input::file-selector-button { | ||
background-color: transparent; | ||
color: var(--primary-btn-color); |
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.
same take color as per new norm
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 will update it.
@@ -180,12 +252,4 @@ | |||
background-color: var(--bg-tertiary-300); |
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.
same here color
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 will update it.
@@ -16,11 +16,13 @@ | |||
import type { TeamForm } from "../../types"; | |||
import { platform } from "@tauri-apps/plugin-os"; | |||
import { onMount } from "svelte"; | |||
import MessageTextIcon from "../../../../../../@sparrow-library/src/icons/MessageTextIcon.svelte"; |
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.
import correctly
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 will update it.
export let height = 16; | ||
export let width = 16; | ||
export let color = "#82858A"; | ||
export let customSvg = ""; |
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.
what does this customsvg means here? Why we are using this?
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.
@Astitva877 we can pass an SVG through props if we don't want the basic Icon.
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.
No @aakashreddy-p we cannot do like this. We will first convert the .svg into .svelte and then we will pass that inside the component, for reference you can connect with @0mahendra, he is also implementing the same type of functionality.
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.
okay I will update it.
</div> | ||
{:else if teamForm.file.showFileTypeError} | ||
<div class="d-flex col gap-1"> | ||
<MessageTextIcon visible={false} /> |
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.
Instead of using this MessageTextIcon we need pass the whole icon from prop and use that here.
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.
@Astitva877 This messageTextIcon component can take an SVG as a prop and should display it in place of the default icon.
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.
We will take the icon as component as use here.
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.
okay I will update it.
<script lang="ts"> | ||
export let width: number = 12, | ||
height: number = 12, | ||
color: string = "#D8D8D9", | ||
classProp: string = ""; | ||
</script> | ||
|
||
<svg | ||
{width} | ||
{height} | ||
viewBox="0 0 12 12" | ||
class={classProp} | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M0.588591 0.715694L0.646447 0.646447C0.820013 0.47288 1.08944 0.453595 1.28431 0.588591L1.35355 0.646447L6 5.293L10.6464 0.646447C10.8417 0.451185 11.1583 0.451185 11.3536 0.646447C11.5488 0.841709 11.5488 1.15829 11.3536 1.35355L6.707 6L11.3536 10.6464C11.5271 10.82 11.5464 11.0894 11.4114 11.2843L11.3536 11.3536C11.18 11.5271 10.9106 11.5464 10.7157 11.4114L10.6464 11.3536L6 6.707L1.35355 11.3536C1.15829 11.5488 0.841709 11.5488 0.646447 11.3536C0.451185 11.1583 0.451185 10.8417 0.646447 10.6464L5.293 6L0.646447 1.35355C0.47288 1.17999 0.453595 0.910563 0.588591 0.715694L0.646447 0.646447L0.588591 0.715694Z" |
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.
Don't use assets, add directly in icons folder
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.
sure I will update it.
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.
Shift icon uploader at library level.
fileSizeError={teamForm.file.showFileSizeError} | ||
fileSizeErrorMessage={ICON_CONFIG.WRONG_FILE_ERROR_MESSAGE} | ||
fileTypeError={teamForm.file.showFileTypeError} | ||
fileTypeErrorMessage={ICON_CONFIG.WRONG_FILE_ERROR_MESSAGE} | ||
fileTypes={ICON_CONFIG.FILE_TYPES} |
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.
used same value on fileSizeErrorMessage
fileTypeErrorMessage
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 have updated it.
@@ -0,0 +1,18 @@ | |||
<script> |
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.
change this file name
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 have changed it.
d="M0.588591 0.715694L0.646447 0.646447C0.820013 0.47288 1.08944 0.453595 1.28431 0.588591L1.35355 0.646447L6 5.293L10.6464 0.646447C10.8417 0.451185 11.1583 0.451185 11.3536 0.646447C11.5488 0.841709 11.5488 1.15829 11.3536 1.35355L6.707 6L11.3536 10.6464C11.5271 10.82 11.5464 11.0894 11.4114 11.2843L11.3536 11.3536C11.18 11.5271 10.9106 11.5464 10.7157 11.4114L10.6464 11.3536L6 6.707L1.35355 11.3536C1.15829 11.5488 0.841709 11.5488 0.646447 11.3536C0.451185 11.1583 0.451185 10.8417 0.646447 10.6464L5.293 6L0.646447 1.35355C0.47288 1.17999 0.453595 0.910563 0.588591 0.715694L0.646447 0.646447L0.588591 0.715694Z" | ||
fill={color} | ||
/> | ||
</svg> |
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.
same change this file name
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 have changed it.
d="M13.236 0.763861C12.2123 -0.259828 10.5525 -0.259829 9.52885 0.76386L1.65722 8.63549C1.28304 9.00967 1.01623 9.47748 0.88467 9.99003L0.0157097 13.3755C-0.0282329 13.5467 0.0214766 13.7284 0.146457 13.8534C0.271438 13.9783 0.453118 14.028 0.624318 13.9841L4.00978 13.1151C4.52234 12.9836 4.99015 12.7168 5.36433 12.3426L13.236 4.47097C14.2596 3.44728 14.2596 1.78755 13.236 0.763861ZM10.236 1.47097C10.8691 0.837803 11.8957 0.837803 12.5288 1.47097C13.162 2.10413 13.162 3.1307 12.5288 3.76386L11.75 4.54269L9.45713 2.24979L10.236 1.47097ZM8.75002 2.9569L11.0429 5.24979L4.65722 11.6355C4.40969 11.883 4.10023 12.0595 3.76117 12.1465L1.19447 12.8053L1.85327 10.2386C1.9403 9.89958 2.1168 9.59012 2.36433 9.34259L8.75002 2.9569Z" | ||
fill={color} | ||
/> | ||
</svg> |
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.
change this file name
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 have changed it.
Description
Please do not leave this blank
I have updated the upload File Area with new Bs Component Properties[#2502].
What type of PR is this? (check all applicable)
Have you tested locally?