Merge !87: feat: add muscle exercise explorer
# Conflicts: # frontend/src/lib/pt-br-locale.test.js
This commit is contained in:
commit
194aa15f0e
20 files changed
+219
-2
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { useRef, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useStore } from '../store/useStore.js'
|
||||
import { EXDB, BODYPARTS, allExercises, equipmentOf, matchExercise } from '../lib/exercises.js'
|
||||
import { activeProfile, exAvailable } from '../lib/equipment.js'
|
||||
@@ -12,6 +13,7 @@ import { Button } from '../components/ui.jsx'
|
||||
import { tappable, useRevealActiveChip } from '../lib/use-sheet-keyboard.js'
|
||||
|
||||
export default function Library() {
|
||||
const nav = useNavigate()
|
||||
const S = useStore(s => s.S)
|
||||
const [q, setQ] = useState('')
|
||||
const [bp, setBp] = useState('')
|
||||
@@ -30,7 +32,9 @@ export default function Library() {
|
||||
useRevealActiveChip(eqStrip, eqOn)
|
||||
|
||||
return <>
|
||||
<div className="hdr"><div><h1>{t('Exercises')}</h1><div className="sub">{t('{0} exercises with animations', EXDB.length)}</div></div></div>
|
||||
<div className="hdr"><div><h1>{t('Exercises')}</h1><div className="sub">{t('{0} exercises with animations', EXDB.length)}</div></div>
|
||||
<Button size="sm" variant="tinted" icon="target" onClick={() => nav('/muscles')}>{t('By muscle')}</Button>
|
||||
</div>
|
||||
<div className="search" style={{ marginBottom: 10 }}><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" /><path d="m21 21-4.3-4.3" /></svg>
|
||||
<input className="input" placeholder={t('Search…')} value={q} onChange={e => { setQ(e.target.value); setShown(40) }} /></div>
|
||||
{profile && <div className="small dim row" style={{ margin: '-4px 2px 10px', gap: 6, alignItems: 'center' }}>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { t } from '../lib/i18n.js'
|
||||
import MuscleExplorer from '../components/MuscleExplorer.jsx'
|
||||
import { exerciseDetailSheet, addToRoutineSheet } from '../sheets.jsx'
|
||||
import Icon from '../components/Icon.jsx'
|
||||
|
||||
export default function Muscles() {
|
||||
const nav = useNavigate()
|
||||
return <>
|
||||
<div className="hdr">
|
||||
<div><h1>{t('Explore muscles')}</h1><div className="sub">{t('Choose a muscle to see exercises that train it.')}</div></div>
|
||||
<button className="iconbtn" onClick={() => nav('/library')} aria-label={t('Exercises')}><Icon name="chevronLeft" /></button>
|
||||
</div>
|
||||
|
||||
<MuscleExplorer onDetail={exerciseDetailSheet} onPlan={addToRoutineSheet} />
|
||||
</>
|
||||
}
|
||||
Reference in new issue
Block a user