Skip to content

Commit 5328f53

Browse files
authored
UI Adjustments in share file modal (#1231)
UI Adjustments in share file modal (elements alignment & snackbars position fixes) Signed-off-by: Benjamin Perez <[email protected]>
1 parent 70a4d76 commit 5328f53

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ShareFile.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const styles = (theme: Theme) =>
4343
createStyles({
4444
copyButtonContainer: {
4545
paddingLeft: 16,
46+
paddingTop: 18,
4647
},
4748
modalContent: {
4849
paddingBottom: 53,
@@ -140,7 +141,7 @@ const ShareFile = ({
140141
const slDate = new Date(`${selectedDate}`);
141142
const currDate = new Date();
142143

143-
const diffDate = slDate.getTime() - currDate.getTime();
144+
const diffDate = Math.ceil((slDate.getTime() - currDate.getTime()) / 1000);
144145

145146
if (diffDate > 0) {
146147
api
@@ -149,7 +150,7 @@ const ShareFile = ({
149150
`/api/v1/buckets/${bucketName}/objects/share?prefix=${encodeFileName(
150151
dataObject.name
151152
)}&version_id=${versionID}${
152-
selectedDate !== "" ? `&expires=${diffDate}ms` : ""
153+
selectedDate !== "" ? `&expires=${diffDate}s` : ""
153154
}`
154155
)
155156
.then((res: string) => {

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,14 @@ export const snackBarCommon = {
667667
color: "#fff",
668668
},
669669
snackBarExternal: {
670-
top: "-17px",
671-
position: "absolute" as const,
672-
minWidth: "348px",
670+
top: -1,
671+
height: 33,
672+
position: "fixed" as const,
673+
minWidth: 348,
673674
whiteSpace: "nowrap" as const,
674-
height: "33px",
675+
left: 0,
676+
width: "100%",
677+
justifyContent: "center" as const,
675678
},
676679
snackDiv: {
677680
top: "17px",
@@ -684,7 +687,9 @@ export const snackBarCommon = {
684687
minWidth: "348px",
685688
whiteSpace: "nowrap" as const,
686689
height: "33px",
687-
maxWidth: "calc(100% - 140px)",
690+
width: "100%",
691+
justifyContent: "center",
692+
left: 0,
688693
},
689694
};
690695

0 commit comments

Comments
 (0)