Skip to content

Commit 685cfda

Browse files
authored
Update Box Button Style and move Icons to the Right (#1199)
* Update Box Button Style and move Icons to the Right Signed-off-by: Daniel Valdivia <[email protected]> * Add AButton component to replace <a> tags Signed-off-by: Daniel Valdivia <[email protected]>
1 parent 5c40bda commit 685cfda

File tree

26 files changed

+149
-96
lines changed

26 files changed

+149
-96
lines changed

portal-ui/src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const GlobalCss = withStyles({
4545
".MuiButton-root": {
4646
height: 38,
4747
},
48+
".MuiButtonBase-root": {
49+
textTransform: "capitalize",
50+
},
4851
".MuiButton-contained": {
4952
fontSize: "14px",
5053
textTransform: "capitalize",

portal-ui/src/screens/Console/Account/Account.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ const Account = ({
257257
<Button
258258
variant="contained"
259259
color="primary"
260-
startIcon={<AddIcon />}
260+
endIcon={<AddIcon />}
261261
onClick={() => {
262262
setAddScreenOpen(true);
263263
setSelectedServiceAccount(null);

portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ const AccessRule = ({
246246
<Button
247247
variant="contained"
248248
color="primary"
249-
startIcon={<AddIcon />}
249+
endIcon={<AddIcon />}
250250
component="label"
251251
onClick={() => {
252252
setAddAccessRuleOpen(true);

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketDetails.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ import {
6464
S3_GET_BUCKET_POLICY,
6565
S3_GET_LIFECYCLE_CONFIGURATION,
6666
S3_GET_REPLICATION_CONFIGURATION,
67-
S3_LISTEN_BUCKET_NOTIFICATIONS,
6867
S3_PUT_BUCKET_NOTIFICATIONS,
6968
S3_PUT_LIFECYCLE_CONFIGURATION,
7069
S3_PUT_REPLICATION_CONFIGURATION,
7170
} from "../../../../types";
7271
import { displayComponent } from "../../../../utils/permissions";
73-
import { ISessionResponse } from "../../types";
7472

7573
const styles = (theme: Theme) =>
7674
createStyles({
@@ -383,6 +381,7 @@ const BucketDetails = ({
383381
setBucketDetailsLoad(true);
384382
}}
385383
size="large"
384+
variant={"contained"}
386385
>
387386
<RefreshIcon />
388387
</BoxIconButton>

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const BucketEventsPanel = ({
163163
<Button
164164
variant="contained"
165165
color="primary"
166-
startIcon={<AddIcon />}
166+
endIcon={<AddIcon />}
167167
size="medium"
168168
onClick={() => {
169169
setAddEventScreenOpen(true);

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const BucketLifecyclePanel = ({
211211
<Button
212212
variant="contained"
213213
color="primary"
214-
startIcon={<AddIcon />}
214+
endIcon={<AddIcon />}
215215
size="medium"
216216
onClick={() => {
217217
setAddLifecycleOpen(true);

portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const BucketReplicationPanel = ({
181181
<Button
182182
variant="contained"
183183
color="primary"
184-
startIcon={<AddIcon />}
184+
endIcon={<AddIcon />}
185185
size="medium"
186186
onClick={() => {
187187
setOpenReplicationOpen(true);

portal-ui/src/screens/Console/Buckets/ListBuckets/ListBuckets.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { addBucketOpen, addBucketReset } from "../actions";
2929
import { setErrorSnackMessage } from "../../../../actions";
3030
import {
3131
containerForHeader,
32-
linkStyles,
3332
searchField,
3433
} from "../../Common/FormComponents/common/styleLibrary";
3534
import { ErrorResponseHandler } from "../../../../common/types";
@@ -46,6 +45,7 @@ import InputAdornment from "@mui/material/InputAdornment";
4645
import SearchIcon from "../../../../icons/SearchIcon";
4746
import BoxIconButton from "../../Common/BoxIconButton";
4847
import RefreshIcon from "../../../../icons/RefreshIcon";
48+
import AButton from "../../Common/AButton";
4949

5050
const styles = (theme: Theme) =>
5151
createStyles({
@@ -131,7 +131,6 @@ const styles = (theme: Theme) =>
131131
constrainedContainer: {
132132
maxWidth: 1180,
133133
},
134-
...linkStyles(theme.palette.info.main),
135134
});
136135

137136
interface IListBucketsProps {
@@ -438,14 +437,14 @@ const ListBuckets = ({
438437
<br />
439438
<br />
440439
To get started,&nbsp;
441-
<button
442-
className={classes.link}
440+
<AButton
443441
onClick={() => {
444442
addBucketOpen(true);
445443
}}
446444
>
447445
Create a Bucket.
448-
</button>
446+
</AButton>
447+
refresh
449448
</Fragment>
450449
}
451450
/>

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

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,14 @@ import {
4545
objectBrowserCommon,
4646
searchField,
4747
} from "../../../../Common/FormComponents/common/styleLibrary";
48-
import { Badge, Button, IconButton, Tooltip, Typography } from "@mui/material";
48+
import { Badge, Button, Tooltip, Typography } from "@mui/material";
4949
import * as reactMoment from "react-moment";
5050
import BrowserBreadcrumbs from "../../../../ObjectBrowser/BrowserBreadcrumbs";
5151
import {
5252
resetRewind,
5353
setFileModeEnabled,
5454
} from "../../../../ObjectBrowser/actions";
55-
import {
56-
ObjectBrowserReducer,
57-
Route,
58-
} from "../../../../ObjectBrowser/reducers";
55+
import { Route } from "../../../../ObjectBrowser/reducers";
5956
import CreateFolderModal from "./CreateFolderModal";
6057
import { download, extensionPreview, sortListObjects } from "../utils";
6158
import {
@@ -99,15 +96,14 @@ import {
9996
import ShareFile from "../ObjectDetails/ShareFile";
10097
import { displayComponent } from "../../../../../../utils/permissions";
10198
import {
102-
S3_DELETE_BUCKET,
10399
S3_DELETE_OBJECT,
104-
S3_FORCE_DELETE_BUCKET,
105100
S3_GET_OBJECT,
106101
S3_LIST_BUCKET,
107102
S3_PUT_OBJECT,
108103
} from "../../../../../../types";
109104
import { setBucketDetailsLoad, setBucketInfo } from "../../../actions";
110105
import { AppState } from "../../../../../../store";
106+
import BoxIconButton from "../../../../Common/BoxIconButton";
111107

112108
const commonIcon = {
113109
backgroundRepeat: "no-repeat",
@@ -1088,25 +1084,23 @@ const ListObjects = ({
10881084
{displayPutObject && (
10891085
<Fragment>
10901086
<Tooltip title={"Choose or create a new path"}>
1091-
<IconButton
1087+
<BoxIconButton
10921088
color="primary"
10931089
aria-label="Add a new folder"
1094-
component="span"
10951090
onClick={() => {
10961091
setCreateFolderOpen(true);
10971092
}}
10981093
disabled={rewindEnabled}
10991094
size="large"
11001095
>
11011096
<AddFolderIcon />
1102-
</IconButton>
1097+
</BoxIconButton>
11031098
</Tooltip>
11041099

11051100
<Tooltip title={"Upload file"}>
1106-
<IconButton
1101+
<BoxIconButton
11071102
color="primary"
11081103
aria-label="Refresh List"
1109-
component="span"
11101104
onClick={() => {
11111105
if (fileUpload && fileUpload.current) {
11121106
fileUpload.current.click();
@@ -1116,7 +1110,7 @@ const ListObjects = ({
11161110
size="large"
11171111
>
11181112
<UploadIcon />
1119-
</IconButton>
1113+
</BoxIconButton>
11201114
</Tooltip>
11211115
<input
11221116
type="file"
@@ -1137,33 +1131,32 @@ const ListObjects = ({
11371131
invisible={!rewindEnabled}
11381132
className={classes.badgeOverlap}
11391133
>
1140-
<IconButton
1134+
<BoxIconButton
11411135
color="primary"
11421136
aria-label="Rewind"
1143-
component="span"
11441137
onClick={() => {
11451138
setRewindSelect(true);
11461139
}}
11471140
disabled={!isVersioned}
11481141
size="large"
11491142
>
11501143
<HistoryIcon />
1151-
</IconButton>
1144+
</BoxIconButton>
11521145
</Badge>
11531146
</Tooltip>
11541147
<Tooltip title={"Refresh list"}>
1155-
<IconButton
1148+
<BoxIconButton
11561149
color="primary"
11571150
aria-label="Refresh List"
1158-
component="span"
11591151
onClick={() => {
11601152
setLoading(true);
11611153
}}
11621154
disabled={rewindEnabled}
11631155
size="large"
1156+
variant={"contained"}
11641157
>
11651158
<RefreshIcon />
1166-
</IconButton>
1159+
</BoxIconButton>
11671160
</Tooltip>
11681161
</Fragment>
11691162
}
@@ -1195,7 +1188,7 @@ const ListObjects = ({
11951188
<Button
11961189
variant="contained"
11971190
color="primary"
1198-
startIcon={<DeleteIcon />}
1191+
endIcon={<DeleteIcon />}
11991192
onClick={() => {
12001193
setDeleteMultipleOpen(true);
12011194
}}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import {
7777
S3_GET_OBJECT_LEGAL_HOLD,
7878
S3_GET_OBJECT_RETENTION,
7979
S3_GET_OBJECT_TAGGING,
80-
S3_GET_REPLICATION_CONFIGURATION,
8180
S3_PUT_OBJECT_LEGAL_HOLD,
8281
S3_PUT_OBJECT_RETENTION,
8382
S3_PUT_OBJECT_TAGGING,
@@ -94,6 +93,7 @@ import SearchIcon from "../../../../../../icons/SearchIcon";
9493
import ObjectBrowserIcon from "../../../../../../icons/ObjectBrowserIcon";
9594
import PreviewFileContent from "../Preview/PreviewFileContent";
9695
import RestoreFileVersion from "./RestoreFileVersion";
96+
import BoxIconButton from "../../../../Common/BoxIconButton";
9797

9898
const styles = (theme: Theme) =>
9999
createStyles({
@@ -643,7 +643,7 @@ const ObjectDetails = ({
643643
actions={
644644
<Fragment>
645645
<Tooltip title="Share">
646-
<IconButton
646+
<BoxIconButton
647647
color="primary"
648648
aria-label="share"
649649
onClick={() => {
@@ -653,7 +653,7 @@ const ObjectDetails = ({
653653
size="large"
654654
>
655655
<ShareIcon />
656-
</IconButton>
656+
</BoxIconButton>
657657
</Tooltip>
658658

659659
{downloadingFiles.includes(
@@ -668,7 +668,7 @@ const ObjectDetails = ({
668668
</div>
669669
) : (
670670
<Tooltip title="Download">
671-
<IconButton
671+
<BoxIconButton
672672
color="primary"
673673
aria-label="download"
674674
onClick={() => {
@@ -678,13 +678,13 @@ const ObjectDetails = ({
678678
size="large"
679679
>
680680
<DownloadIcon />
681-
</IconButton>
681+
</BoxIconButton>
682682
</Tooltip>
683683
)}
684684

685685
{displayDeleteObject && (
686686
<Tooltip title="Delete Object">
687-
<IconButton
687+
<BoxIconButton
688688
color="primary"
689689
aria-label="delete"
690690
onClick={() => {
@@ -694,7 +694,7 @@ const ObjectDetails = ({
694694
size="large"
695695
>
696696
<DeleteIcon />
697-
</IconButton>
697+
</BoxIconButton>
698698
</Tooltip>
699699
)}
700700
</Fragment>

0 commit comments

Comments
 (0)