fix and add chevron for advanced config

pull/4571/head
Joseph Izang 9 months ago committed by Aniket
parent ac310f4a4f
commit b38871608f
  1. 8
      apps/vyper/src/app/app.tsx
  2. 6
      apps/vyper/src/app/components/CustomAccordionToggle.tsx

@ -114,14 +114,14 @@ const App = () => {
</Button> </Button>
</CustomTooltip> </CustomTooltip>
</div> </div>
<Accordion className="border-0 w-100 mb-3 accordion-background"> <Accordion className="border-0 w-100 mb-3 accordion-background">
<div className="border-0"> <div className="border-0">
<div className="pl-3"> <div className="pl-3 d-flex flex-row justify-content-between">
<CustomAccordionToggle eventKey="0"> <CustomAccordionToggle eventKey="0">
<span className="">Advanced Compiler Settings</span> <span className="">Advanced Compiler Settings</span>
</CustomAccordionToggle> </CustomAccordionToggle>
{/* <i className={toggleAccordion ? 'fas fa-angle-right' : 'fas fa-angle-down'}></i> */} {/* <i className={toggleAccordion ? 'far fa-angle-right' : 'far fa-angle-down'}></i> */}
<span className="fas fa-angle-right"></span>
</div> </div>
<Accordion.Collapse eventKey="0"> <Accordion.Collapse eventKey="0">
<div className="pl-3 pt-3 border-top-0"> <div className="pl-3 pt-3 border-top-0">
@ -137,7 +137,7 @@ const App = () => {
</Accordion.Collapse> </Accordion.Collapse>
</div> </div>
</Accordion> </Accordion>
<span className="px-3 mt-1 mb-1 small text-warning">Specify the compiler version & EVM version in the .vy file</span> <span className="px-3 mt-1 mb-1 small text-warning">Specify the <a className="text-warning" target="_blank" href="https://">compiler version</a> & <a className="text-warning" href="http://docs.vyperlang.org/en/stable/compiling-a-contract.html#setting-the-target-evm-version" target="_blank" rel="noopener noreferrer">EVM version</a> in the .vy file.</span>
<LocalUrlInput url={state.localUrl} setUrl={setLocalUrl} environment={state.environment} /> <LocalUrlInput url={state.localUrl} setUrl={setLocalUrl} environment={state.environment} />
<div className="px-3 w-100 mb-3 mt-1" id="compile-btn"> <div className="px-3 w-100 mb-3 mt-1" id="compile-btn">
<CompilerButton compilerUrl={compilerUrl()} contract={contract} setOutput={(name, update) => setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} /> <CompilerButton compilerUrl={compilerUrl()} contract={contract} setOutput={(name, update) => setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} />

@ -1,5 +1,4 @@
import React, { useContext, useState } from 'react' import React, { useState } from 'react'
import { AccordionContext } from 'react-bootstrap'
import { useAccordionToggle } from 'react-bootstrap/AccordionToggle' import { useAccordionToggle } from 'react-bootstrap/AccordionToggle'
export type CustomAccordionToggleProps = { export type CustomAccordionToggleProps = {
@ -10,18 +9,17 @@ export type CustomAccordionToggleProps = {
export default function CustomAccordionToggle({ children, eventKey }: CustomAccordionToggleProps) { export default function CustomAccordionToggle({ children, eventKey }: CustomAccordionToggleProps) {
const [toggleAccordion, setToggleAccordion] = useState(false) const [toggleAccordion, setToggleAccordion] = useState(false)
// <i className={toggleAccordion ? 'fas fa-angle-right' : 'fas fa-angle-down'}></i>
const decoratedOnClick = useAccordionToggle(eventKey, () => const decoratedOnClick = useAccordionToggle(eventKey, () =>
setToggleAccordion(!toggleAccordion) setToggleAccordion(!toggleAccordion)
) )
return ( return (
<div <div
onClick={decoratedOnClick} onClick={decoratedOnClick}
> >
{children} {children}
<i className={toggleAccordion ? 'far fa-angle-right' : 'far fa-angle-down'}></i>
</div> </div>
) )
} }

Loading…
Cancel
Save