fix: Show button when fetching columns (#6891)

Improve UX when entering `Table Header Index` value

BEFORE: Generate Template Button was hidden when the new column header is getting fetched. There was no loader for a user to understand that data is being fetched.

NOW: Generate Template Button is always visible and goes in a loading state when user data is being fetched.
This commit is contained in:
Rishabh Rathod 2021-08-26 13:22:57 +05:30 committed by GitHub
parent dc86c9b82b
commit 0fa7f33bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -293,6 +293,7 @@ const btnFontStyles = (props: ThemeProp & ButtonProps): BtnFontType => {
}; };
const ButtonStyles = css<ThemeProp & ButtonProps>` const ButtonStyles = css<ThemeProp & ButtonProps>`
user-select: none;
width: ${(props) => width: ${(props) =>
props.width ? props.width : props.fill ? "100%" : "auto"}; props.width ? props.width : props.fill ? "100%" : "auto"};
height: ${(props) => btnFontStyles(props).height}px; height: ${(props) => btnFontStyles(props).height}px;

View File

@ -128,8 +128,6 @@ const GENERATE_PAGE_MODE = {
REPLACE_EMPTY: "REPLACE_EMPTY", // current page's content (DSL) is updated to template DSL. (same pageId) REPLACE_EMPTY: "REPLACE_EMPTY", // current page's content (DSL) is updated to template DSL. (same pageId)
}; };
//
function GeneratePageSubmitBtn({ function GeneratePageSubmitBtn({
disabled, disabled,
isLoading, isLoading,

View File

@ -361,7 +361,7 @@ function GoogleSheetForm(props: Props) {
</> </>
) : null} ) : null}
{selectedSheet.value && columnHeaderList.length {selectedSheet.value
? renderSubmitButton({ ? renderSubmitButton({
onSubmit, onSubmit,
disabled: !columnHeaderList.length || isFetchingColumnHeaderList, disabled: !columnHeaderList.length || isFetchingColumnHeaderList,