<commit_before>﻿import * as React from 'react'
import { classes } from '../Globals'
import * as Navigator from '../Navigator'
import { ResultTable, FindOptions, FilterOption, QueryDescription } from '../FindOptions'
import { Entity, Lite, is, toLite, LiteMessage, getToString, EntityPack, ModelState, ModifiableEntity } from '../Signum.Entities'
import { TypeContext, StyleOptions, EntityFrame } from '../TypeContext'
import { getTypeInfo, TypeInfo, PropertyRoute, ReadonlyBinding, getTypeInfos } from '../Reflection'
import { ErrorBoundary } from "../Components/ErrorBoundary";

export default class ContainerToggleComponent extends React.Component<React.Props<ContainerToggleComponent>, { fluid: boolean }>{

    state = { fluid: false };
    
    constructor(props: React.Props<ContainerToggleComponent>) {
        super(props);
        Navigator.Expander.onGetExpanded = () => this.state.fluid;
        Navigator.Expander.onSetExpanded = (isExpanded: boolean) => this.setState({ fluid: isExpanded });
    }

    handleExpandToggle = (e: React.MouseEvent<any>) => {
        e.preventDefault();
        this.setState({ fluid: !this.state.fluid });
    }

    render() {
        return (
            <div className={classes(this.state.fluid ? "container-fluid" : "container", "mt-3")}>
                <a className="expand-window" onClick={this.handleExpandToggle} href="#">
                    <span className={classes("fa", this.state.fluid ? "fa-compress" : "fa-expand")} />
                </a> 
                <ErrorBoundary>
                    {this.props.children}
                </ErrorBoundary>
            </div>
        );
    }
}
<commit_msg>hide expand toggle on extra small and small screen sizes, since the content usually uses the full width anyway.<commit_after>﻿import * as React from 'react'
import { classes } from '../Globals'
import * as Navigator from '../Navigator'
import { ResultTable, FindOptions, FilterOption, QueryDescription } from '../FindOptions'
import { Entity, Lite, is, toLite, LiteMessage, getToString, EntityPack, ModelState, ModifiableEntity } from '../Signum.Entities'
import { TypeContext, StyleOptions, EntityFrame } from '../TypeContext'
import { getTypeInfo, TypeInfo, PropertyRoute, ReadonlyBinding, getTypeInfos } from '../Reflection'
import { ErrorBoundary } from "../Components/ErrorBoundary";

export default class ContainerToggleComponent extends React.Component<{}, { fluid: boolean }>{

    state = { fluid: false };
    
    constructor(props: React.Props<ContainerToggleComponent>) {
        super(props);
        Navigator.Expander.onGetExpanded = () => this.state.fluid;
        Navigator.Expander.onSetExpanded = (isExpanded: boolean) => this.setState({ fluid: isExpanded });
    }

    handleExpandToggle = (e: React.MouseEvent<any>) => {
        e.preventDefault();
        this.setState({ fluid: !this.state.fluid });
    }

    render() {
        return (
            <div className={classes(this.state.fluid ? "container-fluid" : "container", "mt-3")}>
                <a className="expand-window d-none d-md-block" onClick={this.handleExpandToggle} href="#" >
                    <span className={classes("fa", this.state.fluid ? "fa-compress" : "fa-expand")} />
                </a> 
                <ErrorBoundary>
                    {this.props.children}
                </ErrorBoundary>
            </div>
        );
    }
}

{'fraction_non_alphanumeric': 0.13655091230135374, 'fraction_numerical': 0.0005885815185403178, 'mean_word_length': 2.9385863267670915, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6337390', 'n_tokens_mistral': 934, 'n_tokens_neox': 911, 'n_words': 222}