-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from AElfProject/feature/left-side-section
fix: Removed unused resizable component
- Loading branch information
Showing
1 changed file
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
import { useSearchParams } from "next/navigation"; | ||
|
||
import { BuildDeployPanel } from "./build-deploy-panel"; | ||
import ContractViewer from "./contract-viewer"; | ||
import FileExplorer from "./file-explorer"; | ||
import TopBottom from "./top-bottom"; | ||
import { ResizablePanel } from "./ui/resizable"; | ||
|
||
const LeftSide = ({ name }: { name: string }) => ( | ||
<ResizablePanel defaultSize={25}> | ||
<TopBottom | ||
top={ | ||
<> | ||
<BuildDeployPanel /> | ||
<FileExplorer /> | ||
</> | ||
} | ||
bottom={<ContractViewer name={name} />} | ||
topDefaultSize={30} | ||
bottomDefaultSize={70} | ||
/> | ||
</ResizablePanel> | ||
const TopSections = () => ( | ||
<> | ||
<BuildDeployPanel /> | ||
<FileExplorer /> | ||
</> | ||
); | ||
const LeftSide = ({ name }: { name: string }) => { | ||
const searchParams = useSearchParams(); | ||
const contractViewerAddress = searchParams.get("contract-viewer-address"); | ||
|
||
return ( | ||
<ResizablePanel defaultSize={25}> | ||
{contractViewerAddress ? ( | ||
<TopBottom | ||
top={<TopSections />} | ||
bottom={<ContractViewer name={name} />} | ||
topDefaultSize={30} | ||
bottomDefaultSize={70} | ||
/> | ||
) : ( | ||
<TopSections /> | ||
)} | ||
</ResizablePanel> | ||
); | ||
}; | ||
|
||
export default LeftSide; |