splitPanel.stories.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import styled from '@emotion/styled';
  2. import SplitPanel from 'sentry/views/replays/detail/layout/splitPanel';
  3. import {Basic as FliudPanelDemo} from './fluidPanel.stories';
  4. export default {
  5. title: 'Views/Replays/Split Panel',
  6. };
  7. const ManualResize = styled('div')`
  8. resize: both;
  9. overflow: auto;
  10. border: 1px solid ${p => p.theme.gray100};
  11. `;
  12. function List() {
  13. return (
  14. <ol>
  15. {[1, 2, 3, 4, 5, 6, 7, 8].map(i => (
  16. <p key={i}>
  17. I would walk {i} miles, and I would walk {i} more.
  18. </p>
  19. ))}
  20. </ol>
  21. );
  22. }
  23. export const LeftRightSplit = () => {
  24. return (
  25. <ManualResize>
  26. <SplitPanel left={<List />} right={<List />} />
  27. </ManualResize>
  28. );
  29. };
  30. export const TopBottomSplit = () => {
  31. return (
  32. <ManualResize>
  33. <SplitPanel top={<List />} bottom={<List />} />
  34. </ManualResize>
  35. );
  36. };
  37. export const LeftRightFluidContents = props => {
  38. return (
  39. <ManualResize>
  40. <SplitPanel left={<FliudPanelDemo />} right={<FliudPanelDemo panel />} {...props} />
  41. </ManualResize>
  42. );
  43. };
  44. LeftRightFluidContents.args = {
  45. minPx: 0,
  46. maxPx: Number.MAX_SAFE_INTEGER,
  47. minPct: 0,
  48. maxPct: 100,
  49. };
  50. export const TopBottomFluidContents = () => {
  51. return (
  52. <ManualResize>
  53. <SplitPanel top={<FliudPanelDemo />} bottom={<FliudPanelDemo panel />} />
  54. </ManualResize>
  55. );
  56. };