Skip to content

Commit d0972a5

Browse files
Merge pull request #216 from Saifullah-dev/214-feat/className-style-props
feat: add className and style props to FileManager component for cust…
2 parents 1a034f0 + ac870b2 commit d0972a5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

frontend/src/FileManager/FileManager.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const FileManager = ({
5353
permissions: userPermissions = {},
5454
collapsibleNav = false,
5555
defaultNavExpanded = true,
56+
className = "",
57+
style = {},
5658
}) => {
5759
const [isNavigationPaneOpen, setNavigationPaneOpen] = useState(defaultNavExpanded);
5860
const triggerAction = useTriggerAction();
@@ -71,7 +73,11 @@ const FileManager = ({
7173
);
7274

7375
return (
74-
<main className="file-explorer" onContextMenu={(e) => e.preventDefault()} style={customStyles}>
76+
<main
77+
className={`file-explorer ${className}`}
78+
onContextMenu={(e) => e.preventDefault()}
79+
style={{ ...customStyles, ...style }}
80+
>
7581
<Loader loading={isLoading} />
7682
<TranslationProvider language={language}>
7783
<FilesProvider filesData={files} onError={onError}>
@@ -209,6 +215,8 @@ FileManager.propTypes = {
209215
}),
210216
collapsibleNav: PropTypes.bool,
211217
defaultNavExpanded: PropTypes.bool,
218+
className: PropTypes.string,
219+
style: PropTypes.object,
212220
};
213221

214222
export default FileManager;

frontend/src/FileManager/FileManager.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ svg {
3434
height: 100%;
3535
width: 100%;
3636
font-family: var(--file-manager-font-family);
37+
border: 1px solid $border-color;
38+
border-radius: 8px;
3739

3840
button {
3941
font-family: var(--file-manager-font-family);
4042
}
4143

42-
border-radius: 8px;
4344
position: relative;
4445
background-color: white;
4546
cursor: default;

0 commit comments

Comments
 (0)