Skip to content
Draft
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
6 changes: 5 additions & 1 deletion src/components/ImportSpreadsheetColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ type ImportSpreadsheetColumnsProps = {
shouldShowDropdownMenu?: boolean;

customHeaderText?: string;

// An optional boolean indicating whether the import button should be disabled while offline. Defaults to true.
shouldDisableButtonWhenOffline?: boolean;
};

function ImportSpreadsheetColumns({
Expand All @@ -64,6 +67,7 @@ function ImportSpreadsheetColumns({
shouldShowColumnHeader = true,
shouldShowDropdownMenu = true,
customHeaderText,
shouldDisableButtonWhenOffline = true,
}: ImportSpreadsheetColumnsProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
Expand Down Expand Up @@ -124,7 +128,7 @@ function ImportSpreadsheetColumns({
text={translate('common.import')}
onPress={importFunction}
isLoading={isButtonLoading}
isDisabled={isOffline}
isDisabled={shouldDisableButtonWhenOffline && isOffline}
pressOnEnter
success
large
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ function ImportedMerchantRulesPage({route}: ImportedMerchantRulesPageProps) {
columnRoles={columnRoles}
isButtonLoading={isImportingRules}
customHeaderText={translate('workspace.rules.merchantRules.importRulesSupportingText')}
shouldDisableButtonWhenOffline={false}
/>
</ScreenWrapper>
</AccessOrNotFoundWrapper>
Expand Down
Loading