Skip to content

Commit

Permalink
refactor: add new section and adjust layout
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelginetw committed Oct 22, 2024
1 parent 73ec6c2 commit 4562b25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"application_other_caption": "Example: “cherrypicking” or “serial dilution”",
"application_describe_title": "Describe what you are trying to do",
"application_describe_caption": "Example: “The protocol performs automated liquid handling for Pierce BCA Protein Assay Kit to determine protein concentrations in various sample types, such as cell lysates and eluates of purification process.",
"section_confirm_button": "Confirm"
"section_confirm_button": "Confirm",
"instruments_title": "Instruments"
}
16 changes: 14 additions & 2 deletions opentrons-ai-client/src/pages/CreateProtocol/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function CreateProtocol(): JSX.Element | null {
const [applicationAccordionIsOpen, setApplicationAccordionIsOpen] = useState(

Check failure on line 26 in opentrons-ai-client/src/pages/CreateProtocol/index.tsx

View workflow job for this annotation

GitHub Actions / js checks

'applicationAccordionIsOpen' is assigned a value but never used

Check failure on line 26 in opentrons-ai-client/src/pages/CreateProtocol/index.tsx

View workflow job for this annotation

GitHub Actions / js checks

'applicationAccordionIsOpen' is assigned a value but never used
true
)
const [activeSection, setActiveSection] = useState(0)

const methods = useForm<CreateProtocolFormData>({
defaultValues: {
Expand All @@ -49,13 +50,23 @@ export function CreateProtocol(): JSX.Element | null {
<ProtocolSections>
<Accordion
heading={t('application_title')}
isOpen={applicationAccordionIsOpen}
isOpen={activeSection === 0}
handleClick={function (): void {
throw new Error('Function not implemented.')
setActiveSection(0)
}}
>
<ApplicationSection />
</Accordion>

<Accordion
heading={t('instruments_title')}
isOpen={activeSection === 1}
handleClick={function (): void {
setActiveSection(1)
}}
>
<Flex>Content</Flex>
</Accordion>
</ProtocolSections>
<PromptPreview
handleSubmit={function (): void {
Expand All @@ -71,4 +82,5 @@ export function CreateProtocol(): JSX.Element | null {
const ProtocolSections = styled(Flex)`
flex-direction: ${DIRECTION_COLUMN};
width: 100%;
gap: ${SPACING.spacing16};
`

0 comments on commit 4562b25

Please sign in to comment.