# Container/TopBar ## Examples ### Base ```tsx { args: { notification_count: 9 }, render: (args: ArgsType) => { const logout = () => alert('logout'); return }>email@.example.com 로그아웃 {args.notification_count > 99 ? '99+' : args.notification_count} ; } } ``` ### Mobile 조건에 따라 원하는 조합으로 작성할 수 있습니다. ```tsx { args: { notification_count: 9 }, parameters: { docs: { description: { story: '조건에 따라 원하는 조합으로 작성할 수 있습니다.' } } }, render: (args: ArgsType) => { const logout = () => alert('logout'); return 로그아웃 {args.notification_count > 99 ? '99+' : args.notification_count} ; } } ``` ### Sidebar Toggle ```tsx { render: () => { const [isSidebarOpen, setIsSidebarOpen] = React.useState(true); return setIsSidebarOpen(isOpen => !isOpen)} /> ; }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const toggle = canvas.getByRole('button', { name: '사이드바 닫기' }); const expandedIcon = toggle.querySelector('svg')!.innerHTML; expect(getComputedStyle(toggle.parentElement!.parentElement!).height).toBe('44px'); expect(toggle).toHaveAttribute('aria-expanded', 'true'); expect(getComputedStyle(toggle).width).toBe('24px'); expect(getComputedStyle(toggle).padding).toBe('2px'); expect(toggle.querySelector('svg')).toHaveAttribute('width', '20'); await userEvent.click(toggle); expect(toggle).toHaveAttribute('aria-expanded', 'false'); expect(toggle).toHaveAccessibleName('사이드바 열기'); expect(toggle.querySelector('svg')!.innerHTML).not.toBe(expandedIcon); } } ``` ### 알림 100개이상 케이스 PC ```tsx { args: { notification_count: 9 }, render: (args: ArgsType) => { const logout = () => alert('logout'); return }>email@.example.com 로그아웃 {args.notification_count > 99 ? '99+' : args.notification_count} ; }, name: '알림 100개이상 케이스 PC', args: { notification_count: 999 } } ``` ### 알림 100개이상 케이스 모바일 조건에 따라 원하는 조합으로 작성할 수 있습니다. ```tsx { args: { notification_count: 9 }, parameters: { docs: { description: { story: '조건에 따라 원하는 조합으로 작성할 수 있습니다.' } } }, render: (args: ArgsType) => { const logout = () => alert('logout'); return 로그아웃 {args.notification_count > 99 ? '99+' : args.notification_count} ; }, name: '알림 100개이상 케이스 모바일', args: { notification_count: 999 } } ```