PHP 8.2.30
Preview: styled-back-button.tsx Size: 1.25 KB
/home/byroehnu/easepay.easetack.com/node_modules/adminjs/src/frontend/components/app/action-header/styled-back-button.tsx

import React from 'react'
import { Link as RouterLink } from 'react-router-dom'
import { useLocation } from 'react-router'
import {
  ButtonCSS,
  ButtonProps,
  Icon,
} from '@adminjs/design-system'
import { styled } from '@adminjs/design-system/styled-components'

import allowOverride from '../../../hoc/allow-override.js'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledLink = styled(({ rounded, to, ...rest }) => <RouterLink to={to} {...rest} />)<ButtonProps>`${ButtonCSS}`

export type StyledBackButtonProps = {
  showInDrawer: boolean;
}

const StyledBackButton: React.FC<StyledBackButtonProps> = (props) => {
  const location = useLocation()
  const { showInDrawer } = props
  const cssCloseIcon = showInDrawer ? 'ChevronRight' : 'ChevronLeft'

  return (
    <StyledLink
      size="icon"
      to={{
        pathname: '..',
        search: location.search,
      }}
      relative="route"
      rounded
      mr="lg"
      type="button"
    >
      <Icon icon={cssCloseIcon} />
    </StyledLink>
  )
}

const OverridableStyledBackButton = allowOverride(StyledBackButton, 'StyledBackButton')

export {
  OverridableStyledBackButton as default,
  OverridableStyledBackButton as StyledBackButton,
  StyledBackButton as OriginalStyledBackButton,
}

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
127 B lr--r--r-- 2026-03-14 01:49:20
Edit Download
821 B lrw-r--r-- 2026-02-28 00:32:46
Edit Download
4.87 KB lrw-r--r-- 2026-02-28 00:32:46
Edit Download
3.73 KB lrw-r--r-- 2026-02-28 00:31:58
Edit Download
1.96 KB lrw-r--r-- 2026-02-28 00:31:58
Edit Download
76 B lrw-r--r-- 2026-02-28 00:32:28
Edit Download
1.25 KB lrw-r--r-- 2026-02-28 00:32:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).