Skip to content

Commit

Permalink
Merge branch 'master' into mashal-m/react-upgrade-to-v17
Browse files Browse the repository at this point in the history
  • Loading branch information
Mashal-m authored Jul 5, 2023
2 parents 7b542fc + e7d9255 commit 42213a0
Show file tree
Hide file tree
Showing 47 changed files with 1,204 additions and 249 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ ACCOUNT_SETTINGS_URL=''
ACCOUNT_PROFILE_URL=''
ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY=''
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ ACCOUNT_SETTINGS_URL='http://localhost:1997'
ACCOUNT_PROFILE_URL='http://localhost:1995'
ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY=''
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ ACCOUNT_SETTINGS_URL='http://account-settings-url.test'
ACCOUNT_PROFILE_URL='http://account-profile-url.test'
ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY='SDK Key'
151 changes: 151 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.15",
"@optimizely/react-sdk": "^2.9.2",
"@redux-beacon/segment": "^1.1.0",
"@reduxjs/toolkit": "^1.6.1",
"@testing-library/user-event": "^13.5.0",
Expand Down
28 changes: 21 additions & 7 deletions src/containers/Dashboard/DashboardLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,41 @@ import hooks from './hooks';

export const columnConfig = {
courseList: {
lg: { span: 12, offset: 0 },
xl: { span: 8, offset: 0 },
withSidebar: {
lg: { span: 12, offset: 0 },
xl: { span: 8, offset: 0 },
},
noSidebar: {
lg: { span: 12, offset: 0 },
xl: { span: 12, offset: 0 },
},
},
sidebar: {
lg: { span: 12, offset: 0 },
xl: { span: 4, offset: 0 },
},
};

export const DashboardLayout = ({ children, sidebar }) => {
const isCollapsed = hooks.useIsDashboardCollapsed();
export const DashboardLayout = ({ children, sidebar: Sidebar }) => {
const {
isCollapsed,
sidebarShowing,
setSidebarShowing,
} = hooks.useDashboardLayoutData();

const courseListColumnProps = sidebarShowing
? columnConfig.courseList.withSidebar
: columnConfig.courseList.noSidebar;

return (
<Container fluid size="xl">
<Row>
<Col {...columnConfig.courseList} className="course-list-column">
<Col {...courseListColumnProps} className="course-list-column">
{children}
</Col>
<Col {...columnConfig.sidebar} className="sidebar-column">
{!isCollapsed && (<h2 className="course-list-title">&nbsp;</h2>)}
{sidebar}
<Sidebar setSidebarShowing={setSidebarShowing} />
</Col>
</Row>
<Row>
Expand All @@ -41,7 +55,7 @@ export const DashboardLayout = ({ children, sidebar }) => {
};
DashboardLayout.propTypes = {
children: PropTypes.node.isRequired,
sidebar: PropTypes.node.isRequired,
sidebar: PropTypes.func.isRequired,
};

export default DashboardLayout;
Loading

0 comments on commit 42213a0

Please sign in to comment.