-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from ONLYOFFICE/feature/translations-loaders
Feature/translations loaders
- Loading branch information
Showing
74 changed files
with
717 additions
and
438 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
packages/asc-web-common/components/Loaders/DialogAsideLoader/DialogAsideLoader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from "react"; | ||
import Loaders from "../../Loaders"; | ||
import StyledDialogAsideLoader from "./StyledDialogAsideLoader"; | ||
import Aside from "@appserver/components/aside"; | ||
import Backdrop from "@appserver/components/backdrop"; | ||
|
||
const DialogAsideLoader = ({ isPanel, withoutAside }) => { | ||
const zIndex = 310; | ||
|
||
const renderClearDialogAsideLoader = () => { | ||
return ( | ||
<StyledDialogAsideLoader visible isPanel={isPanel}> | ||
<div className="dialog-loader-header"> | ||
<Loaders.Rectangle /> | ||
</div> | ||
<div className="dialog-loader-body"> | ||
<Loaders.Rectangle height="200px" /> | ||
</div> | ||
|
||
<div className="dialog-loader-footer"> | ||
<Loaders.Rectangle /> | ||
</div> | ||
</StyledDialogAsideLoader> | ||
); | ||
}; | ||
|
||
return withoutAside ? ( | ||
renderClearDialogAsideLoader() | ||
) : ( | ||
<> | ||
<Backdrop visible isAside /> | ||
<StyledDialogAsideLoader visible isPanel={isPanel}> | ||
<Aside className="dialog-aside-loader" visible zIndex={zIndex}> | ||
{renderClearDialogAsideLoader()} | ||
</Aside> | ||
</StyledDialogAsideLoader> | ||
</> | ||
); | ||
}; | ||
|
||
export default DialogAsideLoader; |
59 changes: 59 additions & 0 deletions
59
packages/asc-web-common/components/Loaders/DialogAsideLoader/StyledDialogAsideLoader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import styled, { css } from "styled-components"; | ||
|
||
const StyledDialogAsideLoader = styled.div` | ||
${(props) => | ||
props.isPanel && | ||
css` | ||
.dialog-aside-loader { | ||
padding: 0; | ||
transform: translateX(${(props) => (props.visible ? "0" : "500px")}); | ||
width: 500px; | ||
@media (max-width: 550px) { | ||
width: 320px; | ||
transform: translateX(${(props) => (props.visible ? "0" : "320px")}); | ||
} | ||
} | ||
`} | ||
${(props) => | ||
props.isPanel | ||
? css` | ||
.dialog-loader-header { | ||
padding: 12px 16px; | ||
} | ||
.dialog-loader-body { | ||
padding: 16px; | ||
} | ||
.dialog-loader-footer { | ||
padding: 12px 16px; | ||
position: fixed; | ||
bottom: 0; | ||
width: 468px; | ||
@media (max-width: 550px) { | ||
width: 288px; | ||
} | ||
} | ||
` | ||
: css` | ||
.dialog-loader-header { | ||
border-bottom: 1px solid rgb(222, 226, 230); | ||
padding: 12px 0; | ||
} | ||
.dialog-loader-body { | ||
padding: 16px 0; | ||
} | ||
.dialog-loader-footer { | ||
position: fixed; | ||
bottom: 16px; | ||
width: 293px; | ||
} | ||
`} | ||
`; | ||
|
||
export default StyledDialogAsideLoader; |
1 change: 1 addition & 0 deletions
1
packages/asc-web-common/components/Loaders/DialogAsideLoader/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from "./DialogAsideLoader"; |
32 changes: 32 additions & 0 deletions
32
packages/asc-web-common/components/Loaders/DialogLoader/DialogLoader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import Loaders from "../../Loaders"; | ||
import StyledDialogLoader from "./StyledDialogLoader"; | ||
|
||
const DialogLoader = () => { | ||
return ( | ||
<StyledDialogLoader> | ||
<div className="dialog-loader-header"> | ||
<Loaders.Rectangle height="28px" width="470px" /> | ||
<Loaders.Rectangle | ||
className="dialog-loader-icon" | ||
height="28px" | ||
width="28px" | ||
/> | ||
</div> | ||
<div className="dialog-loader-body"> | ||
<Loaders.Rectangle height="150px" /> | ||
</div> | ||
|
||
<div className="dialog-loader-footer"> | ||
<Loaders.Rectangle height="30px" width="120px" /> | ||
<Loaders.Rectangle | ||
className="dialog-loader-icon" | ||
height="30px" | ||
width="100px" | ||
/> | ||
</div> | ||
</StyledDialogLoader> | ||
); | ||
}; | ||
|
||
export default DialogLoader; |
27 changes: 27 additions & 0 deletions
27
packages/asc-web-common/components/Loaders/DialogLoader/StyledDialogLoader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import styled from "styled-components"; | ||
|
||
const StyledDialogLoader = styled.div` | ||
.dialog-loader-header { | ||
border-bottom: 1px solid rgb(222, 226, 230); | ||
display: flex; | ||
padding: 12px 0; | ||
} | ||
.dialog-loader-body { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding-top: 12px; | ||
} | ||
.dialog-loader-footer { | ||
display: flex; | ||
padding-top: 12px; | ||
} | ||
.dialog-loader-icon { | ||
margin-left: auto; | ||
} | ||
`; | ||
|
||
export default StyledDialogLoader; |
1 change: 1 addition & 0 deletions
1
packages/asc-web-common/components/Loaders/DialogLoader/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default from "./DialogLoader"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.