feature(accordion): Added accordion components to the project
3 unresolved threads
3 unresolved threads
Description
Added accordion components to the project. Decided to use library because of bigger flexibility and time-save. I had two options
- Custom component Pros: Small bundle size, highly customizable Cons: Time consuming: would have to implement reusable and composable component + analise all cases that occurs in the app. There is danger that all cases are not included in designs so it would require to spend even more time
- Library Pros:
- huge time save, customizable Cons: 100kb unpacked size, 10kb gziped -> It would highly increase bundle size. But it's ok for me cuz it's CSR where it doesn't matter that much comparing to SSR or Static website
Implementation reasoning
Imported each of library module and exported it as custom component to add custom styling to it.
Additionally
- Moved global styles import to pages wrapper (_app.tsx)
- Removed redux-page example - its no longer needed
- Created usage example
http://localhost:3000/accordion-test
Merge request reports
Activity
Filter activity
4 uuid?: string | number; 5 activeClassName?: string; 6 dangerouslySetExpanded?: boolean; 7 children: React.ReactNode; 8 } 9 10 export const AccordionItem = ({ 11 uuid: customUuid, 12 dangerouslySetExpanded, 13 children, 14 ...rest 15 }: AccordionItemProps): JSX.Element => ( 16 <AccItem 17 uuid={customUuid} 18 dangerouslySetExpanded={dangerouslySetExpanded} 19 {...rest} - src/shared/Accordion/Accordion.component.tsx 0 → 100644
1 import { Accordion as Ac } from 'react-accessible-accordion'; 2 import { DivAttributes } from 'react-accessible-accordion/dist/types/helpers/types'; 3 4 type ID = string | number; - pages/accordion-test.tsx 0 → 100644
1 import { I think introducing storybook at this stage would be a waste of time. I wanted to let you quickly see usage of the components introduced in PR. I'm going to remove it after finishing https://minerva-appunite.atlassian.net/browse/MIN-65. Is it ok?
changed this line in version 2 of the diff
added 1 commit
- 4e3f22d1 - refactor(removed accordion test page): removed page used for displaying test cases
enabled an automatic merge when the pipeline for 4e3f22d1 succeeds
mentioned in commit 2d8c3ea6
Please register or sign in to reply