mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-10 02:15:11 +00:00
Fix modal bug
This commit is contained in:
parent
fea5ff1297
commit
fb38fafd16
|
@ -26,6 +26,10 @@ function handleAdultConsent(i: App) {
|
||||||
i.setState({ showAdultConsentModal: false });
|
i.setState({ showAdultConsentModal: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleAdultConsentGoBack(i: App) {
|
||||||
|
i.context.router.history.back();
|
||||||
|
}
|
||||||
|
|
||||||
export class App extends Component<any, AppState> {
|
export class App extends Component<any, AppState> {
|
||||||
private isoData: IsoDataOptionalSite = setIsoData(this.context);
|
private isoData: IsoDataOptionalSite = setIsoData(this.context);
|
||||||
private readonly mainContentRef: RefObject<HTMLElement>;
|
private readonly mainContentRef: RefObject<HTMLElement>;
|
||||||
|
@ -81,6 +85,14 @@ export class App extends Component<any, AppState> {
|
||||||
<Theme defaultTheme={siteView.local_site.default_theme} />
|
<Theme defaultTheme={siteView.local_site.default_theme} />
|
||||||
)}
|
)}
|
||||||
<Navbar siteRes={siteRes} />
|
<Navbar siteRes={siteRes} />
|
||||||
|
{siteRes?.site_view.site.content_warning && (
|
||||||
|
<AdultConsentModal
|
||||||
|
contentWarning={siteRes.site_view.site.content_warning}
|
||||||
|
show={this.state.showAdultConsentModal}
|
||||||
|
onBack={linkEvent(this, handleAdultConsentGoBack)}
|
||||||
|
onContinue={linkEvent(this, handleAdultConsent)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<div className="mt-4 p-0 fl-1">
|
<div className="mt-4 p-0 fl-1">
|
||||||
<Switch>
|
<Switch>
|
||||||
{routes.map(
|
{routes.map(
|
||||||
|
@ -140,14 +152,6 @@ export class App extends Component<any, AppState> {
|
||||||
</div>
|
</div>
|
||||||
<Footer site={siteRes} />
|
<Footer site={siteRes} />
|
||||||
</div>
|
</div>
|
||||||
{siteRes?.site_view.site.content_warning && (
|
|
||||||
<AdultConsentModal
|
|
||||||
contentWarning={siteRes.site_view.site.content_warning}
|
|
||||||
show={this.state.showAdultConsentModal}
|
|
||||||
onBack={history.back}
|
|
||||||
onContinue={linkEvent(this, handleAdultConsent)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Provider>
|
</Provider>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -5,7 +5,7 @@ interface AdultConsentModalProps {
|
||||||
contentWarning: string;
|
contentWarning: string;
|
||||||
show: boolean;
|
show: boolean;
|
||||||
onContinue: LinkedEvent<any, Event> | null;
|
onContinue: LinkedEvent<any, Event> | null;
|
||||||
onBack: () => void;
|
onBack: LinkedEvent<any, Event> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@modalMixin
|
@modalMixin
|
||||||
|
|
|
@ -276,7 +276,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
||||||
<div className="alert small alert-info" role="alert">
|
<div className="alert small alert-info" role="alert">
|
||||||
<Icon icon="info" classes="icon-inline me-2" />
|
<Icon icon="info" classes="icon-inline me-2" />
|
||||||
Setting a content warning will display a prompt with the content
|
Setting a content warning will display a prompt with the content
|
||||||
warning asking for their consent to continue.
|
warning asking the user for their consent to continue.
|
||||||
</div>
|
</div>
|
||||||
<label className="col-12 col-form-label">Content Warning</label>
|
<label className="col-12 col-form-label">Content Warning</label>
|
||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
|
|
Loading…
Reference in a new issue