fluidPanel.stories.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import styled from '@emotion/styled';
  2. import {Panel as BasePanel, PanelFooter, PanelHeader} from 'sentry/components/panels';
  3. import FluidPanel from 'sentry/views/replays/detail/layout/fluidPanel';
  4. export default {
  5. title: 'Views/Replays/Fluid Panel',
  6. };
  7. const ManualResize = styled('div')`
  8. resize: both;
  9. overflow: auto;
  10. border: 1px solid ${p => p.theme.gray100};
  11. `;
  12. export const Basic = () => {
  13. return (
  14. <FluidPanel title={<h1>Hello World</h1>} bottom={<p>And that's all folks</p>}>
  15. <ol>
  16. {[1, 2, 3, 4, 5, 6, 7, 8].map(i => (
  17. <p key={i}>
  18. I would walk {i} miles, and I would walk {i} more.
  19. </p>
  20. ))}
  21. </ol>
  22. </FluidPanel>
  23. );
  24. };
  25. const Panel = styled(BasePanel)`
  26. overflow: hidden;
  27. margin-bottom: 0;
  28. `;
  29. export const PanelStyle = () => {
  30. return (
  31. <ManualResize>
  32. <Panel>
  33. <FluidPanel
  34. title={<PanelHeader>Hello World</PanelHeader>}
  35. bottom={<PanelFooter>And that's all folks</PanelFooter>}
  36. >
  37. <ol>
  38. {[1, 2, 3, 4, 5, 6, 7, 8].map(i => (
  39. <p key={i}>
  40. I would walk {i} miles, and I would walk {i} more.
  41. </p>
  42. ))}
  43. </ol>
  44. </FluidPanel>
  45. </Panel>
  46. </ManualResize>
  47. );
  48. };
  49. export const Resizeable = () => {
  50. return (
  51. <ManualResize>
  52. <FluidPanel title={<h1>Hello World</h1>} bottom={<p>And that's all folks</p>}>
  53. <ol>
  54. {[1, 2, 3, 4, 5, 6, 7, 8].map(i => (
  55. <p key={i}>
  56. I would walk {i} miles, and I would walk {i} more.
  57. </p>
  58. ))}
  59. </ol>
  60. </FluidPanel>
  61. </ManualResize>
  62. );
  63. };