Skip to content

Commit

Permalink
ensure flyout toc has top padding on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Nov 3, 2023
1 parent 8e36680 commit 19df6db
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
4 changes: 3 additions & 1 deletion src/components/TOCList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ const TOCList = ({ items, overrideClickEvt, prependRoute }: ITOCList) => {
}
return (
<React.Fragment>
{renderList()}
<div className="toc-list">
{renderList()}
</div>
</React.Fragment>
);
}
Expand Down
9 changes: 0 additions & 9 deletions src/pages/constitution/ConstitutionTOC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {
IonTitle,
IonContent,
IonList,
IonListHeader,
IonLabel,
IonPage,
IonIcon,
IonButton,
Expand Down Expand Up @@ -55,13 +53,6 @@ const ConstitutionTOC = () => {
actionText={t('read_full_constitution_label','Read the Full Constitution')} />
</div>
<IonList>
<IonListHeader>
<IonLabel className="contents-label ion-no-margin">{t('toc_title',{
defaultValue: 'Table of Contents',
ns: 'global'
})}</IonLabel>
</IonListHeader>
<div className="ion-padding-start"><hr className="header-divider" /></div>
<TOCList
items={constitution.toc.flattened}
prependRoute="/constitution/provision"
Expand Down
10 changes: 5 additions & 5 deletions src/pages/constitution/Constitution_Full.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class Constitution_Full extends React.Component<Props, MyState> {
<IonList className="full-height-mobile">
<IonMenuToggle auto-hide="true">
{this.state.constitution ?
<TOCList
items={this.state.constitution.toc.flattened}
overrideClickEvt={(data: any) => this.scroll(data)}
/>
: null}
<TOCList
items={this.state.constitution.toc.flattened}
overrideClickEvt={(data: any) => this.scroll(data)}
/>
: null}
</IonMenuToggle>
</IonList>
</IonContent>
Expand Down
13 changes: 0 additions & 13 deletions src/pages/rules/RulesTOC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react';
import {
IonContent,
IonList,
IonListHeader,
IonLabel,
IonPage,
IonButton,
IonIcon, IonHeader, IonToolbar, IonButtons, IonTitle
Expand Down Expand Up @@ -54,17 +52,6 @@ const RulesTOC = () => {
/>
</div>
<IonList>
<IonListHeader>
<IonLabel class="contents-label ion-no-margin">
{ t('toc_title', {
ns: 'global',
defaultValue: 'Table of Contents'
}) }
</IonLabel>
</IonListHeader>
<div className="ion-padding-start">
<hr className="header-divider" />
</div>
<TOCList
items={toc.flattened}
prependRoute="/rules/provision"
Expand Down
8 changes: 8 additions & 0 deletions src/theme/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,11 @@ hr.divider,
height: 100%;
}
}

.toc-list {
height: 100%;
}

ion-menu-toggle .toc-list {
padding-top: var(--ion-safe-area-top, 0);
}

0 comments on commit 19df6db

Please sign in to comment.