-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve csv import #5753
Improve csv import #5753
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,35 +3,40 @@ import styled from '@emotion/styled'; | |
import { CircularProgressBar } from '@/ui/feedback/progress-bar/components/CircularProgressBar'; | ||
import { MainButton } from '@/ui/input/button/components/MainButton'; | ||
import { Modal } from '@/ui/layout/modal/components/Modal'; | ||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull'; | ||
|
||
const StyledFooter = styled(Modal.Footer)` | ||
height: 60px; | ||
justify-content: center; | ||
padding: 0px; | ||
padding-left: ${({ theme }) => theme.spacing(30)}; | ||
padding-right: ${({ theme }) => theme.spacing(30)}; | ||
`; | ||
|
||
const StyledButton = styled(MainButton)` | ||
width: 200px; | ||
gap: ${({ theme }) => theme.spacing(2)}; | ||
justify-content: space-between; | ||
`; | ||
|
||
type StepNavigationButtonProps = { | ||
onClick: () => void; | ||
title: string; | ||
isLoading?: boolean; | ||
onBack?: () => void; | ||
}; | ||
|
||
export const StepNavigationButton = ({ | ||
onClick, | ||
title, | ||
isLoading, | ||
onBack, | ||
}: StepNavigationButtonProps) => ( | ||
<StyledFooter> | ||
<StyledButton | ||
{!isUndefinedOrNull(onBack) && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider renaming There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check if |
||
<MainButton | ||
Icon={isLoading ? CircularProgressBar : undefined} | ||
title="Back" | ||
onClick={!isLoading ? onBack : undefined} | ||
variant="secondary" | ||
/> | ||
)} | ||
<MainButton | ||
Icon={isLoading ? CircularProgressBar : undefined} | ||
title={title} | ||
onClick={!isLoading ? onClick : undefined} | ||
variant="primary" | ||
/> | ||
</StyledFooter> | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,8 +240,11 @@ export const ValidationStep = <T extends string>({ | |
/> | ||
</StyledScrollContainer> | ||
</StyledContent> | ||
<StepNavigationButton onClick={onContinue} title="Confirm" /> | ||
<StepNavigationButton onClick={onBack} title="Back" /> | ||
<StepNavigationButton | ||
onClick={onContinue} | ||
onBack={onBack} | ||
Comment on lines
241
to
+245
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the |
||
title="Confirm" | ||
/> | ||
</> | ||
); | ||
}; |
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.
Consider renaming
isUndefinedOrNull
toisDefined
for better readability.