Skip to content

Commit d717db8

Browse files
authored
feat(ObjectPage): allow fullscreen sections in TabBar mode (#5432)
#5430 needs to be merged first ✅ Closes #4818
1 parent 28a03b3 commit d717db8

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

packages/main/src/components/ObjectPage/ObjectPage.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ With these objectes it's possible to e.g. configure the overflow button displaye
3737

3838
<Canvas of={ComponentStories.SectionWithCustomHeader} />
3939

40+
## TabBar ObjectPage with fullscreen section
41+
42+
To render a single section in fullscreen mode, set its height to `100%`.
43+
44+
**Note:** This is only supported for sections in `TabBar` mode! Using multiple sections with `height: 100%;` on the same page will most probably break your layout.
45+
46+
<Canvas of={ComponentStories.FullScreenSingleSection} />
47+
48+
### Example section
49+
50+
```jsx
51+
<ObjectPageSection titleText="Section with Overflow" id="section3" style={{ height: '100%', overflow: 'auto' }}>
52+
<div style={{ height: '300%', background: 'lightyellow' }} />
53+
</ObjectPageSection>
54+
```
55+
4056
<Markdown>{SubcomponentsSection}</Markdown>
4157

4258
## DynamicPageTitle

packages/main/src/components/ObjectPage/ObjectPage.stories.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,3 +416,26 @@ export const SectionWithCustomHeader: Story = {
416416
);
417417
}
418418
};
419+
420+
export const FullScreenSingleSection: Story = {
421+
args: { selectedSectionId: 'section1' },
422+
name: 'with fullscreen section',
423+
render(args) {
424+
return (
425+
<ObjectPage {...args} mode={ObjectPageMode.IconTabBar}>
426+
<ObjectPageSection titleText="Section 1" id="section1" style={{ height: '100%' }}>
427+
<div style={{ height: '100%', background: 'lightblue' }}>
428+
It is recommended to only use fullscreen sections in TabBar mode, otherwise your layout will most probably
429+
break!
430+
</div>
431+
</ObjectPageSection>
432+
<ObjectPageSection titleText="Section 2" id="section2" style={{ height: '100%' }}>
433+
<div style={{ height: '100%', background: 'lightgreen' }} />
434+
</ObjectPageSection>
435+
<ObjectPageSection titleText="Section with Overflow" id="section3" style={{ height: '100%', overflow: 'auto' }}>
436+
<div style={{ height: '300%', background: 'lightyellow' }} />
437+
</ObjectPageSection>
438+
</ObjectPage>
439+
);
440+
}
441+
};

packages/main/src/components/ObjectPageSection/ObjectPageSection.jss.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ const styles = {
4444
}
4545
},
4646
sectionContent: {
47-
whiteSpace: 'normal'
47+
whiteSpace: 'normal',
48+
height: '100%'
4849
},
4950
sectionContentInner: {
5051
paddingBlock: '0.5rem',
51-
fontFamily: ThemingParameters.sapFontFamily
52+
fontFamily: ThemingParameters.sapFontFamily,
53+
height: '100%',
54+
boxSizing: 'border-box'
5255
}
5356
};
5457

0 commit comments

Comments
 (0)