A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at feat/pgpull 91 lines 2.8 kB view raw
1import React from "react"; 2 3import { Header } from "./Header"; 4import "./page.css"; 5 6type User = { 7 name: string; 8}; 9 10export const Page: React.FC = () => { 11 const [user, setUser] = React.useState<User>(); 12 13 return ( 14 <article> 15 <Header 16 user={user} 17 onLogin={() => setUser({ name: "Jane Doe" })} 18 onLogout={() => setUser(undefined)} 19 onCreateAccount={() => setUser({ name: "Jane Doe" })} 20 /> 21 22 <section className="storybook-page"> 23 <h2>Pages in Storybook</h2> 24 <p> 25 We recommend building UIs with a{" "} 26 <a 27 href="https://componentdriven.org" 28 target="_blank" 29 rel="noopener noreferrer" 30 > 31 <strong>component-driven</strong> 32 </a>{" "} 33 process starting with atomic components and ending with pages. 34 </p> 35 <p> 36 Render pages with mock data. This makes it easy to build and review 37 page states without needing to navigate to them in your app. Here are 38 some handy patterns for managing page data in Storybook: 39 </p> 40 <ul> 41 <li> 42 Use a higher-level connected component. Storybook helps you compose 43 such data from the "args" of child component stories 44 </li> 45 <li> 46 Assemble data in the page component from your services. You can mock 47 these services out using Storybook. 48 </li> 49 </ul> 50 <p> 51 Get a guided tutorial on component-driven development at{" "} 52 <a 53 href="https://storybook.js.org/tutorials/" 54 target="_blank" 55 rel="noopener noreferrer" 56 > 57 Storybook tutorials 58 </a> 59 . Read more in the{" "} 60 <a 61 href="https://storybook.js.org/docs" 62 target="_blank" 63 rel="noopener noreferrer" 64 > 65 docs 66 </a> 67 . 68 </p> 69 <div className="tip-wrapper"> 70 <span className="tip">Tip</span> Adjust the width of the canvas with 71 the{" "} 72 <svg 73 width="10" 74 height="10" 75 viewBox="0 0 12 12" 76 xmlns="http://www.w3.org/2000/svg" 77 > 78 <g fill="none" fillRule="evenodd"> 79 <path 80 d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z" 81 id="a" 82 fill="#999" 83 /> 84 </g> 85 </svg> 86 Viewports addon in the toolbar 87 </div> 88 </section> 89 </article> 90 ); 91};