Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #779 fixed bottom dashboard edition bar #783

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;