Skip to content

Commit

Permalink
Web: files: ManualBackup: Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaLopaeva committed Feb 6, 2022
1 parent 80dafc0 commit 6b89f94
Showing 1 changed file with 21 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,31 @@ class ManualBackup extends React.Component {
const isDisabledThirdParty =
this.commonThirdPartyList && this.commonThirdPartyList.length === 0;

const commonRadioButtonProps = {
fontSize: "13px",
fontWeight: "400",
value: "value",
className: "backup_radio-button",
onClick: this.onClickShowStorage,
};

const commonModulesProps = {
isMaxProgress,
isCopyingLocal: isLoadingData,
onMakeCopy: this.onMakeCopy,
};

return isInitialLoading ? (
<Loader className="pageLoader" type="rombs" size="40px" />
) : (
<StyledManualBackup>
<StyledModules>
<RadioButton
fontSize="13px"
fontWeight="400"
label={t("TemporaryStorage")}
name={"isCheckedTemporaryStorage"}
key={0}
onClick={this.onClickShowStorage}
isChecked={isCheckedTemporaryStorage}
isDisabled={isLoadingData}
value="value"
className="backup_radio-button"
{...commonRadioButtonProps}
/>
<Text className="backup-description">
{t("TemporaryStorageDescription")}
Expand Down Expand Up @@ -366,16 +375,12 @@ class ManualBackup extends React.Component {

<StyledModules>
<RadioButton
fontSize="13px"
fontWeight="400"
label={t("DocumentsModule")}
name={"isCheckedDocuments"}
key={1}
onClick={this.onClickShowStorage}
isChecked={isCheckedDocuments}
isDisabled={isLoadingData}
value="value"
className="backup_radio-button"
{...commonRadioButtonProps}
/>

<Text className="backup-description">
Expand All @@ -384,62 +389,46 @@ class ManualBackup extends React.Component {

{isCheckedDocuments && (
<DocumentsModule
isMaxProgress={isMaxProgress}
{...commonModulesProps}
isCheckedDocuments={isCheckedDocuments}
isCopyingLocal={isLoadingData}
onMakeCopy={this.onMakeCopy}
/>
)}
</StyledModules>

<StyledModules isDisabled={isDisabledThirdParty}>
<RadioButton
fontSize="13px"
fontWeight="400"
label={t("ThirdPartyResource")}
name={"isCheckedThirdParty"}
key={2}
onClick={this.onClickShowStorage}
isChecked={isCheckedThirdParty}
isDisabled={isDisabledThirdParty || isLoadingData}
value="value"
className="backup_radio-button"
{...commonRadioButtonProps}
/>
<Text className="backup-description">
{t("ThirdPartyResourceDescription")}
</Text>
{isCheckedThirdParty && (
<ThirdPartyModule
isMaxProgress={isMaxProgress}
{...commonModulesProps}
commonThirdPartyList={this.commonThirdPartyList}
isCopyingLocal={isLoadingData}
onMakeCopy={this.onMakeCopy}
/>
)}
</StyledModules>

<StyledModules>
<RadioButton
fontSize="13px"
fontWeight="400"
label={t("ThirdPartyStorage")}
name={"isCheckedThirdPartyStorage"}
key={3}
onClick={this.onClickShowStorage}
isChecked={isCheckedThirdPartyStorage}
isDisabled={isLoadingData}
value="value"
className="backup_radio-button"
{...commonRadioButtonProps}
/>
<Text className="backup-description">
{t("ThirdPartyStorageDescription")}
</Text>
{isCheckedThirdPartyStorage && (
<ThirdPartyStorageModule
isMaxProgress={isMaxProgress}
isLoadingData={isLoadingData}
onMakeCopy={this.onMakeCopy}
/>
<ThirdPartyStorageModule {...commonModulesProps} />
)}
</StyledModules>

Expand Down

0 comments on commit 6b89f94

Please sign in to comment.