Merged in feature/css_reduced_mobile_buttons (pull request #239)

feature/css_reduced_mobile_buttons
This commit is contained in:
Rene Pfeuffer
2019-04-25 07:16:26 +00:00
5 changed files with 62 additions and 35 deletions

View File

@@ -11,7 +11,7 @@ import {
import injectSheets from "react-jss";
import classNames from "classnames";
import { translate } from "react-i18next";
import {Button} from "../buttons";
import { Button } from "../buttons";
const styles = {
panel: {
@@ -181,11 +181,17 @@ class DiffFile extends React.Component<Props, State> {
);
}
const fileControls = fileControlFactory ? fileControlFactory(file, this.setCollapse) : null;
return <div className={classNames("panel", classes.panel)}>
const fileControls = fileControlFactory
? fileControlFactory(file, this.setCollapse)
: null;
return (
<div className={classNames("panel", classes.panel)}>
<div className="panel-heading">
<div className="level">
<div className={classNames("level-left", classes.titleHeader)} onClick={this.toggleCollapse}>
<div
className={classNames("level-left", classes.titleHeader)}
onClick={this.toggleCollapse}
>
<i className={icon} />
<span className={classes.title}>
{this.renderFileTitle(file)}
@@ -195,11 +201,16 @@ class DiffFile extends React.Component<Props, State> {
</span>
</div>
<div className="level-right">
<Button action={this.toggleSideBySide}>
<Button action={this.toggleSideBySide} className="reduced-mobile">
<span className="icon is-small">
<i className={classNames("fas", sideBySide ? "fa-align-left" : "fa-columns")} />
<i
className={classNames(
"fas",
sideBySide ? "fa-align-left" : "fa-columns"
)}
/>
</span>
<span className="is-hidden-mobile">
<span>
{t(sideBySide ? "diff.combined" : "diff.sideBySide")}
</span>
</Button>
@@ -208,7 +219,8 @@ class DiffFile extends React.Component<Props, State> {
</div>
</div>
{body}
</div>;
</div>
);
}
}

View File

@@ -23,21 +23,17 @@ class ChangesetButtonGroup extends React.Component<Props> {
return (
<ButtonGroup className="is-pulled-right">
<Button link={changesetLink}>
<Button link={changesetLink} className="reduced-mobile">
<span className="icon">
<i className="fas fa-exchange-alt" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("changeset.buttons.details")}
</span>
<span>{t("changeset.buttons.details")}</span>
</Button>
<Button link={sourcesLink}>
<Button link={sourcesLink} className="reduced-mobile">
<span className="icon">
<i className="fas fa-code" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("changeset.buttons.sources")}
</span>
<span>{t("changeset.buttons.sources")}</span>
</Button>
</ButtonGroup>
);

View File

@@ -25,21 +25,17 @@ class BranchButtonGroup extends React.Component<Props> {
return (
<ButtonGroup>
<Button link={changesetLink}>
<Button link={changesetLink} className="reduced-mobile">
<span className="icon">
<i className="fas fa-exchange-alt" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("branch.commits")}
</span>
<span>{t("branch.commits")}</span>
</Button>
<Button link={sourcesLink}>
<Button link={sourcesLink} className="reduced-mobile">
<span className="icon">
<i className="fas fa-code" />
</span>
<span className="is-hidden-mobile is-hidden-tablet-only">
{t("branch.sources")}
</span>
<span>{t("branch.sources")}</span>
</Button>
</ButtonGroup>
);

View File

@@ -27,22 +27,26 @@ class FileButtonGroup extends React.Component<Props> {
return (
<ButtonGroup>
<Button action={this.showSources} color={ this.color(!historyIsSelected) }>
<Button
action={this.showSources}
className="reduced-mobile"
color={this.color(!historyIsSelected)}
>
<span className="icon">
<i className="fas fa-code"/>
</span>
<span className="is-hidden-mobile">
{t("sources.content.sourcesButton")}
<i className="fas fa-code" />
</span>
<span>{t("sources.content.sourcesButton")}</span>
</Button>
<Button action={this.showHistory} color={ this.color(historyIsSelected) }>
<Button
action={this.showHistory}
className="reduced-mobile"
color={this.color(historyIsSelected)}
>
<span className="icon">
<i className="fas fa-history"/>
<i className="fas fa-history" />
</span>
<span className="is-hidden-mobile">
{t("sources.content.historyButton")}
</span>
</Button>
<span>{t("sources.content.historyButton")}</span>
</Button>
</ButtonGroup>
);
}

View File

@@ -122,6 +122,25 @@ $fa-font-path: "webfonts";
&.is-primary[disabled] {
background-color: #40dde7;
}
&.reduced-mobile {
@media screen and (max-width: 1087px) {
> span:nth-child(2) {
display: none;
}
}
@media screen and (max-width: 1087px) and (min-width: 769px) {
// simultaneously with left margin of Bulma
> .icon:first-child:not(:last-child) {
margin: 0;
}
}
@media screen and (max-width: 768px) {
// simultaneously with left margin of Bulma
.icon:first-child:not(:last-child) {
margin-right: calc(-0.375em - 1px);
}
}
}
}
// multiline Columns