Web: Client: remove useless code

This commit is contained in:
Aleksandr Lushkin 2023-08-31 16:22:34 +02:00
parent 500807c510
commit 7195afc984

View File

@ -17,7 +17,7 @@ const linkColor = globalColors.black;
const INPUT_LENGTH = "350px";
const TEXT_LENGTH = "700px";
const commonStyles = css`
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 16px;
@ -36,10 +36,7 @@ const commonStyles = css`
.backup_modules-header_wrapper {
display: flex;
svg {
${props => {
console.log(props.theme.interfaceDirection);
}}
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin: 5px 4px 0px 0px;
@ -50,7 +47,7 @@ const commonStyles = css`
}
}
.radio-button_text {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 7px;
@ -100,7 +97,7 @@ const StyledManualBackup = styled.div`
${commonStyles}
.manual-backup_buttons {
margin-top: 16px;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -114,7 +111,7 @@ const StyledManualBackup = styled.div`
button:first-child {
max-width: 124px;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 8px;
@ -146,7 +143,7 @@ const StyledManualBackup = styled.div`
}
}
.manual-backup_storages-module {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -155,7 +152,7 @@ const StyledManualBackup = styled.div`
margin-left: 24px;
`}
.manual-backup_buttons {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 0;
@ -167,7 +164,7 @@ const StyledManualBackup = styled.div`
}
.manual-backup_third-party-module {
margin-top: 16px;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -177,7 +174,7 @@ const StyledManualBackup = styled.div`
`}
}
.manual-backup_folder-input {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -193,7 +190,7 @@ const StyledAutoBackup = styled.div`
${commonStyles}
.auto-backup_third-party-module {
margin-top: 16px;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -215,7 +212,7 @@ const StyledAutoBackup = styled.div`
position: static;
}
.backup_toggle-btn-description {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 37px;
@ -237,7 +234,7 @@ const StyledAutoBackup = styled.div`
max-width: ${INPUT_LENGTH};
}
.save-button {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-left: 8px;
@ -247,7 +244,7 @@ const StyledAutoBackup = styled.div`
`}
}
.backup_modules {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 37px;
@ -257,7 +254,7 @@ const StyledAutoBackup = styled.div`
`}
}
.auto-backup_storages-module {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -266,7 +263,7 @@ const StyledAutoBackup = styled.div`
margin-left: 24px;
`}
.backup_schedule-component {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 0;
@ -277,7 +274,7 @@ const StyledAutoBackup = styled.div`
}
}
.auto-backup_folder-input {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -289,7 +286,7 @@ const StyledAutoBackup = styled.div`
}
.backup_toggle-wrapper {
margin-bottom: 16px;
background-color: ${props =>
background-color: ${(props) =>
props.theme.client.settings.backup.rectangleBackgroundColor};
padding: 12px;
max-width: 724px;
@ -303,7 +300,7 @@ const StyledAutoBackup = styled.div`
.auto-backup_badge {
height: 16px;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 8px;
@ -313,11 +310,11 @@ const StyledAutoBackup = styled.div`
`}
cursor: auto;
}
${props => !props.isEnableAuto && UnavailableStyles}
${(props) => !props.isEnableAuto && UnavailableStyles}
`;
const StyledStoragesModule = styled.div`
.backup_storages-buttons {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: -63px;
@ -347,7 +344,7 @@ const StyledRestoreBackup = styled.div`
margin-top: 24px;
margin-bottom: 8px;
font-size: 16px;
color: ${props => props.theme.client.settings.backup.warningColor};
color: ${(props) => props.theme.client.settings.backup.warningColor};
}
.restore-backup_warning-link {
margin-top: 16px;
@ -369,7 +366,7 @@ const StyledRestoreBackup = styled.div`
.restore-backup_list {
text-decoration: underline dotted;
cursor: ${props => (props.isEnableRestore ? "pointer" : "cursor")};
cursor: ${(props) => (props.isEnableRestore ? "pointer" : "cursor")};
font-weight: 600;
}
.restore-backup_input {
@ -394,13 +391,13 @@ const StyledRestoreBackup = styled.div`
width: 100%;
}
}
${props => !props.isEnableRestore && UnavailableStyles}
${(props) => !props.isEnableRestore && UnavailableStyles}
`;
const StyledModules = styled.div`
margin-bottom: 24px;
.backup-description {
${props => props.isDisabled && `color: #A3A9AE`};
${props =>
${(props) => props.isDisabled && `color: #A3A9AE`};
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 25px;
@ -413,7 +410,7 @@ const StyledModules = styled.div`
`;
const StyledScheduleComponent = styled.div`
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 24px;
@ -424,7 +421,7 @@ const StyledScheduleComponent = styled.div`
.days_option {
grid-area: days;
width: 100%;
${props =>
${(props) =>
(props.weeklySchedule || props.monthlySchedule) &&
css`
max-width: 138px;
@ -433,7 +430,7 @@ const StyledScheduleComponent = styled.div`
.additional_options {
max-width: ${INPUT_LENGTH};
display: grid;
grid-template-columns: ${props =>
grid-template-columns: ${(props) =>
props.weeklySchedule || props.monthlySchedule ? "1fr 1fr" : "1fr"};
grid-gap: 8px;
}
@ -441,7 +438,7 @@ const StyledScheduleComponent = styled.div`
.month_options {
grid-area: weekly-monthly;
width: 100%;
max-width: ${props => (!props.isMobileOnly ? "124px" : INPUT_LENGTH)};
max-width: ${(props) => (!props.isMobileOnly ? "124px" : INPUT_LENGTH)};
}
.schedule-backup_combobox {
display: inline-block;
@ -455,7 +452,7 @@ const StyledScheduleComponent = styled.div`
.main_options {
max-width: ${INPUT_LENGTH};
display: grid;
${props =>
${(props) =>
props.weeklySchedule || props.monthlySchedule
? css`
grid-template-areas: "days weekly-monthly time";
@ -500,7 +497,7 @@ const StyledScheduleComponent = styled.div`
.schedule_help-section {
display: flex;
.schedule_help-button {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin: 3px 4px 0 0;
@ -518,7 +515,7 @@ const StyledBackup = styled.div`
margin-bottom: 12px;
display: grid;
${props =>
${(props) =>
props.isConnectedAccount
? "grid-template-columns:minmax(100px, 310px) 32px"
: "grid-template-columns:minmax(100px, 350px) 32px"};
@ -527,7 +524,7 @@ const StyledBackup = styled.div`
.backup_modules-separation {
margin-bottom: 28px;
border-bottom: ${props =>
border-bottom: ${(props) =>
props.theme.client.settings.backup.separatorBorder};
}
.backup_modules-header {
@ -553,7 +550,7 @@ const StyledBackup = styled.div`
line-height: 22px;
}
.backup-section_arrow-button {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin: auto 7.29px auto 0;
@ -616,7 +613,7 @@ const StyledBackupList = styled.div`
}
.radio-button {
margin: 0 !important;
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
padding-right: 10px;
@ -633,17 +630,17 @@ const StyledBackupList = styled.div`
height: 48px;
grid-template-areas: "trash icon-name full-name radiobutton";
grid-template-columns: 25px 32px auto 32px;
${props =>
${(props) =>
props.isChecked &&
css`
background: ${props =>
background: ${(props) =>
props.theme.client.settings.backup.backupCheckedListItemBackground};
`}
padding-left: 16px;
padding-right: 16px;
}
.backup-restore_dialog-scroll-body {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: -16px;
@ -655,7 +652,7 @@ const StyledBackupList = styled.div`
`}
.nav-thumb-vertical {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: -8px !important;
@ -669,7 +666,7 @@ const StyledBackupList = styled.div`
margin-top: 96px;
margin-left: 16px;
margin-right: 16px;
color: ${props => props.theme.client.settings.backup.textColor};
color: ${(props) => props.theme.client.settings.backup.textColor};
}
.backup-list_content {
@ -681,7 +678,7 @@ const StyledBackupList = styled.div`
const StyledSettingsHeader = styled.div`
display: flex;
position: fixed;
top: ${props => (props.isVisible ? "48px" : "-48px")};
top: ${(props) => (props.isVisible ? "48px" : "-48px")};
transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
-moz-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
-ms-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
@ -692,7 +689,7 @@ const StyledSettingsHeader = styled.div`
width: 100%;
height: 50px;
.backup_header {
${props =>
${(props) =>
props.theme.interfaceDirection === "rtl"
? css`
margin-right: 14.5px;