/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/edit-post/src/components/back-button/index.js
34 строки
843 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { privateApis as editorPrivateApis } from '@wordpress/editor'; import { __unstableMotion as motion } from '@wordpress/components'; import FullscreenModeClose from './fullscreen-mode-close'; import { unlock } from '../../lock-unlock'; const { BackButton: BackButtonFill } = unlock( editorPrivateApis ); const slideX = { hidden: { x: '-100%' }, distractionFreeInactive: { x: 0 }, hover: { x: 0, transition: { type: 'tween', delay: 0.2 } }, }; function BackButton( { initialPost } ) { return ( <BackButtonFill> { ( { length } ) => length <= 1 && ( <motion.div variants={ slideX } transition={ { type: 'tween', delay: 0.8 } } > <FullscreenModeClose showTooltip initialPost={ initialPost } /> </motion.div> ) } </BackButtonFill> ); } export default BackButton;