PagePath.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { FC, useState } from 'react';
  2. import type { IPagePopulatedToShowRevision } from '@growi/core';
  3. import { TextInputForPageTitleAndPath } from './TextInputForPageTitleAndPath';
  4. type Props = {
  5. currentPagePath: string
  6. currentPage: IPagePopulatedToShowRevision
  7. }
  8. export const PagePath: FC<Props> = (props) => {
  9. const { currentPagePath, currentPage } = props;
  10. const [isRenameInputShown, setRenameInputShown] = useState(false);
  11. const [isButtonsShown, setButtonShown] = useState(false);
  12. const stateHandler = { isRenameInputShown, setRenameInputShown };
  13. return (
  14. <>
  15. <div className="container">
  16. <div className="row">
  17. <div
  18. className="col-4"
  19. // onMouseEnter={setButtonShown(true)}
  20. // onMouseLeave={setButtonShown(false)}
  21. >
  22. <TextInputForPageTitleAndPath
  23. currentPagePath={currentPagePath}
  24. currentPage={currentPage}
  25. stateHandler={stateHandler}
  26. inputValue={currentPagePath}
  27. />
  28. </div>
  29. { isButtonsShown
  30. && (
  31. <>
  32. <div className="col-4">
  33. <button type="button">編集ボタン</button>
  34. </div>
  35. <div className="col-4">
  36. <button type="button">ページツリーボタン</button>
  37. </div>
  38. </>
  39. )}
  40. </div>
  41. </div>
  42. </>
  43. );
  44. };