Template for starting apps, powered by Next.js
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

99 lines
2.0 KiB

  1. import * as React from 'react'
  2. import styled from 'styled-components'
  3. import * as T from '@tesseract-design/react-common'
  4. import {RightSidebarStatic} from '@theoryofnekomata/viewfinder'
  5. import DummyContent from '../../molecules/DummyContent'
  6. import Link from '../../molecules/Link'
  7. import Brand from '../../molecules/Brand'
  8. const TopBarComponent = styled('div')({
  9. backgroundColor: 'var(--color-bg, white)',
  10. '::before': {
  11. content: "''",
  12. width: '100%',
  13. height: '100%',
  14. position: 'absolute',
  15. top: 0,
  16. left: 0,
  17. pointerEvents: 'none',
  18. },
  19. '::after': {
  20. backgroundColor: 'black',
  21. opacity: 0.5,
  22. content: "''",
  23. width: '100%',
  24. height: '100%',
  25. position: 'absolute',
  26. top: 0,
  27. left: 0,
  28. pointerEvents: 'none',
  29. },
  30. })
  31. const SidebarMainComponent = styled('div')({
  32. backgroundColor: 'var(--color-bg, white)',
  33. zIndex: 2,
  34. })
  35. type Props = {
  36. query: string
  37. userLinkLabel: string
  38. searchQueryKey: string
  39. searchLabel: string
  40. searchHint: string
  41. popupQueryKey: string
  42. userPopupQueryValue: string
  43. }
  44. const RightSidebarLayoutTemplate: React.FC<Props> = ({
  45. query,
  46. userLinkLabel,
  47. searchQueryKey,
  48. searchLabel,
  49. searchHint,
  50. popupQueryKey,
  51. userPopupQueryValue,
  52. }) => {
  53. return (
  54. <RightSidebarStatic.Layout
  55. brand={<Brand />}
  56. topBarComponent={TopBarComponent}
  57. sidebarMainComponent={SidebarMainComponent}
  58. topBarCenter={
  59. <form>
  60. <T.TextInput
  61. name={searchQueryKey}
  62. label={searchLabel}
  63. hint={searchHint}
  64. defaultValue={query}
  65. border
  66. alternate
  67. />
  68. </form>
  69. }
  70. userLink={
  71. <Link
  72. href={{
  73. query: {
  74. [popupQueryKey]: userPopupQueryValue,
  75. },
  76. }}
  77. >
  78. <T.Icon name="user" label={userLinkLabel} />
  79. </Link>
  80. }
  81. sidebarMain={
  82. <RightSidebarStatic.SidebarMainContainer>
  83. <DummyContent />
  84. </RightSidebarStatic.SidebarMainContainer>
  85. }
  86. >
  87. <RightSidebarStatic.ContentContainer>
  88. <DummyContent />
  89. </RightSidebarStatic.ContentContainer>
  90. </RightSidebarStatic.Layout>
  91. )
  92. }
  93. export default RightSidebarLayoutTemplate