Skip to content

Commit

Permalink
Fix #779 fixed bottom dashboard edition bar
Browse files Browse the repository at this point in the history
  • Loading branch information
atrovato committed May 21, 2020
1 parent bec7bb5 commit cc803ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
16 changes: 2 additions & 14 deletions front/src/routes/dashboard/DashboardPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Text } from 'preact-i18n';
import BoxColumns from './BoxColumns';
import EditBoxColumns from './EditBoxColumns';
import EmptyState from './EmptyState';
import EditActions from './EditActions';

const DashboardPage = ({ children, ...props }) => (
<div class="page">
Expand All @@ -20,20 +21,6 @@ const DashboardPage = ({ children, ...props }) => (
</span>
</button>
)}
{props.dashboardEditMode && (
<button onClick={props.cancelDashboardEdit} class="btn btn-outline-danger btn-sm ml-2">
<span>
<Text id="dashboard.editDashboardCancelButton" /> <i class="fe fe-slash" />
</span>
</button>
)}
{props.dashboardEditMode && (
<button onClick={props.saveDashboard} class="btn btn-outline-primary btn-sm ml-2">
<span>
<Text id="dashboard.editDashboardSaveButton" /> <i class="fe fe-check" />
</span>
</button>
)}
</div>
</div>
{props.gatewayInstanceNotFound && (
Expand All @@ -57,6 +44,7 @@ const DashboardPage = ({ children, ...props }) => (
removeBox={props.removeBox}
/>
)}
{props.dashboardEditMode && <EditActions {...props} />}
</div>
</div>
</div>
Expand Down
20 changes: 20 additions & 0 deletions front/src/routes/dashboard/EditActions.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Text } from 'preact-i18n';

const EditActions = props => (
<div class="fixed-bottom footer">
<div class="container">
<div class="row align-items-center flex-row-reverse">
<div class="col-auto">
<button onClick={props.cancelDashboardEdit} class="btn btn-outline-danger btn-sm ml-2">
<Text id="dashboard.editDashboardCancelButton" /> <i class="fe fe-slash" />
</button>
<button onClick={props.saveDashboard} class="btn btn-outline-primary btn-sm ml-2">
<Text id="dashboard.editDashboardSaveButton" /> <i class="fe fe-check" />
</button>
</div>
</div>
</div>
</div>
);

export default EditActions;

0 comments on commit cc803ec

Please sign in to comment.