Skip to content

Commit

Permalink
chore(core-comp…): fp-1939 drop sidebar concept from section (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Jan 24, 2023
1 parent ec190d4 commit 507085d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
20 changes: 0 additions & 20 deletions libs/core-components/src/lib/Section/Section.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ function Section({
headerClassName,
manualContent,
manualHeader,
// manualSidebar,
// sidebar,
// sidebarClassName,
messages,
}) {
const shouldBuildHeader = header || headerClassName || headerActions;
Expand All @@ -112,11 +109,6 @@ function Section({
'When passing `manualHeader`, the following props are ineffectual: `header`, `headerClassName`, `headerActions`'
);
}
// if (manualSidebar && (sidebar || sidebarClassName)) {
// throw new Error(
// 'When passing `manualSidebar`, the following props are ineffectual: `sidebar`, `sidebarClassName`'
// );
// }

useEffect(() => {
if (bodyClassName) document.body.classList.add(bodyClassName);
Expand All @@ -129,13 +121,6 @@ function Section({
return (
<section className={`${styles['root']} ${className}`}>
{messages}
{/* {manualSidebar ? (
<>{manualSidebar}</>
) : (
<Sidebar styleName="sidebar" className={sidebarClassName}>
{sidebar}
</Sidebar>
)} */}
{manualHeader ??
(shouldBuildHeader && (
<SectionHeader
Expand Down Expand Up @@ -191,10 +176,6 @@ Section.propTypes = {
manualContent: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
/** The section header (built by user) element */
manualHeader: PropTypes.element,
// /** The page-specific sidebar */
// sidebar: PropTypes.node,
// /** Additional className for the sidebar element */
// sidebarClassName: PropTypes.string,
/** Any message(s) (e.g. <Message>) (but NOT a intro message) */
messages: PropTypes.node,
};
Expand All @@ -213,7 +194,6 @@ Section.defaultProps = {
manualHeader: undefined,
messages: '',
introMessageName: '',
// sidebarClassName: '',
introMessageText: '',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ import layoutStyles from './SectionContent.layouts.module.css';
* @enum {number}
*/
export const LAYOUT_CLASS_MAP = {
/**
* Each child element is a full-height column with a flexible width
*
* CAVEAT: No sidebar styles provided (until a <SectionSidebar> exists)
*/
hasSidebar: layoutStyles['has-sidebar'],
/**
* Each child element is a flexible block inside one full-height column
*/
Expand All @@ -34,7 +28,7 @@ export const LAYOUT_CLASS_MAP = {
*/
multiColumn: layoutStyles['multi-column'],
};
export const DEFAULT_LAYOUT = 'hasSidebar';
export const DEFAULT_LAYOUT = 'one-column';
export const LAYOUTS = [...Object.keys(LAYOUT_CLASS_MAP)];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
.root::after { background-color: lavender; }
*/

/* Has Sidebar */

/* CAVEAT: No sidebar styles provided (until a <SectionSidebar> exists) */
.has-sidebar {
display: flex;
flex-flow: row nowrap;
}

/* 1 Column */

.one-column {
Expand Down

0 comments on commit 507085d

Please sign in to comment.