Skip to content
Snippets Groups Projects
Commit 5543979f authored by Camille Villa's avatar Camille Villa
Browse files

Add defaultSidebarPanelWidth to settings

parent ee4b28fb
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ export class CompanionWindow extends Component { ...@@ -51,7 +51,7 @@ export class CompanionWindow extends Component {
render() { render() {
const { const {
ariaLabel, classes, paperClassName, id, onCloseClick, updateCompanionWindow, isDisplayed, ariaLabel, classes, paperClassName, id, onCloseClick, updateCompanionWindow, isDisplayed,
position, t, windowId, title, children, titleControls, size, position, t, windowId, title, children, titleControls, size, defaultSidebarPanelWidth,
} = this.props; } = this.props;
const isBottom = (position === 'bottom' || position === 'far-bottom'); const isBottom = (position === 'bottom' || position === 'far-bottom');
...@@ -72,7 +72,7 @@ export class CompanionWindow extends Component { ...@@ -72,7 +72,7 @@ export class CompanionWindow extends Component {
style={{ display: 'flex', position: 'relative' }} style={{ display: 'flex', position: 'relative' }}
default={{ default={{
height: isBottom ? 201 : '100%', height: isBottom ? 201 : '100%',
width: isBottom ? 'auto' : 235, width: isBottom ? 'auto' : defaultSidebarPanelWidth,
}} }}
disableDragging disableDragging
enableResizing={this.resizeHandles()} enableResizing={this.resizeHandles()}
...@@ -155,6 +155,7 @@ CompanionWindow.propTypes = { ...@@ -155,6 +155,7 @@ CompanionWindow.propTypes = {
ariaLabel: PropTypes.string, ariaLabel: PropTypes.string,
children: PropTypes.node, children: PropTypes.node,
classes: PropTypes.objectOf(PropTypes.string).isRequired, classes: PropTypes.objectOf(PropTypes.string).isRequired,
defaultSidebarPanelWidth: PropTypes.number,
id: PropTypes.string.isRequired, id: PropTypes.string.isRequired,
isDisplayed: PropTypes.bool, isDisplayed: PropTypes.bool,
onCloseClick: PropTypes.func, onCloseClick: PropTypes.func,
...@@ -174,6 +175,7 @@ CompanionWindow.propTypes = { ...@@ -174,6 +175,7 @@ CompanionWindow.propTypes = {
CompanionWindow.defaultProps = { CompanionWindow.defaultProps = {
ariaLabel: undefined, ariaLabel: undefined,
children: undefined, children: undefined,
defaultSidebarPanelWidth: 235,
isDisplayed: false, isDisplayed: false,
onCloseClick: () => {}, onCloseClick: () => {},
paperClassName: '', paperClassName: '',
......
...@@ -223,6 +223,7 @@ export default { ...@@ -223,6 +223,7 @@ export default {
allowWindowSideBar: true, // Configure if side bar menu is visible or not allowWindowSideBar: true, // Configure if side bar menu is visible or not
authNewWindowCenter: 'parent', // Configure how to center a new window created by the authentication flow. Options: parent, screen authNewWindowCenter: 'parent', // Configure how to center a new window created by the authentication flow. Options: parent, screen
defaultSideBarPanel: 'info', // Configure which sidebar is selected by default. Options: info, attribution, canvas, annotations, search defaultSideBarPanel: 'info', // Configure which sidebar is selected by default. Options: info, attribution, canvas, annotations, search
defaultSidebarPanelWidth: 235, // Configure default sidebar width in pixels
defaultView: 'single', // Configure which viewing mode (e.g. single, book, gallery) for windows to be opened in defaultView: 'single', // Configure which viewing mode (e.g. single, book, gallery) for windows to be opened in
hideWindowTitle: false, // Configure if the window title is shown in the window title bar or not hideWindowTitle: false, // Configure if the window title is shown in the window title bar or not
showLocalePicker: false, // Configure locale picker for multi-lingual metadata showLocalePicker: false, // Configure locale picker for multi-lingual metadata
......
...@@ -15,9 +15,11 @@ import { CompanionWindow } from '../components/CompanionWindow'; ...@@ -15,9 +15,11 @@ import { CompanionWindow } from '../components/CompanionWindow';
*/ */
const mapStateToProps = (state, { id, windowId }) => { const mapStateToProps = (state, { id, windowId }) => {
const companionWindow = getCompanionWindow(state, { companionWindowId: id }); const companionWindow = getCompanionWindow(state, { companionWindowId: id });
const { defaultSidebarPanelWidth } = state.config.window;
return { return {
...companionWindow, ...companionWindow,
defaultSidebarPanelWidth,
isDisplayed: (companionWindow isDisplayed: (companionWindow
&& companionWindow.content && companionWindow.content
&& companionWindow.content.length > 0), && companionWindow.content.length > 0),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment