Merge !85: feat: add copy routine button to RoutineEdit view
# Conflicts: # frontend/src/lib/pt-br-locale.test.js
This commit is contained in:
commit
4bca5336d1
17 files changed
+126
No files matched your search
@@ -11,6 +11,7 @@ import { glyphPicker, exercisePicker, exConfigSheet, confirmSheet } from '../she
|
||||
import Icon from '../components/Icon.jsx'
|
||||
import { glyphOf } from '../lib/glyphs.js'
|
||||
import { Button, Row, SelectRow, Switch } from '../components/ui.jsx'
|
||||
import { copyRoutine } from '../lib/routines.js'
|
||||
import { POLICIES_FOR, POLICY_NAME, POLICY_DESC } from '../lib/progression.js'
|
||||
import BodyMap from '../components/BodyMap.jsx'
|
||||
import { loadOfRoutine, rankOf, MUSCLE_NAME } from '../lib/muscles.js'
|
||||
@@ -425,6 +426,12 @@ export default function RoutineEdit() {
|
||||
<div className="small dim row" style={{ margin: '10px 2px', gap: 5 }}><Icon name="link" style={{ fontSize: 13 }} />{t('Tap the link button on an exercise to superset it with the one above — you’ll do them back-to-back.')}</div>
|
||||
<Button variant="primary" onClick={() => exercisePicker(ex => exConfigSheet(ex, null, cfg => edit(x => { x.push({ id: ex.id, ...cfg }) }), null, r))} icon="plus">{t('Add exercise')}</Button>
|
||||
<div style={{ height: 10 }} />
|
||||
<Button onClick={() => {
|
||||
const copy = copyRoutine(r, t('Copy'))
|
||||
update(s => { s.routines.push(copy) })
|
||||
nav('/plan/r/' + copy.id)
|
||||
}}>{t('Copy routine')}</Button>
|
||||
<div style={{ height: 10 }} />
|
||||
<Button variant="danger" onClick={() => confirmSheet({
|
||||
title: t('Delete routine?'), message: t('“{0}” and its exercises will be removed.', r.name), confirmText: t('Delete'), danger: true,
|
||||
onConfirm: () => {
|
||||
|
||||
Reference in new issue
Block a user