Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
UI revamp changes (#153)
Browse files Browse the repository at this point in the history
* Add Tab structure

* Plugin info tab changes

* Fix tab padding issue

* Fix button colors and text scheme

* Transaction card  changes

* Plugin footer changes

* Settings tab changes

* Compiler version changes

* Indentation formatting changes

* Move solidity allowed version fetch to compiler version component

* Rename compiler version to header

* Fix margin padding issue for compiler accordian

* Fix Dropdown item width issue

* Change TxId to TxnHash

* Accordian shadow and button margin css changes

* Add gap in Environment text
  • Loading branch information
satyambnsal authored Jul 29, 2024
1 parent 82ce4a7 commit c9928d7
Show file tree
Hide file tree
Showing 29 changed files with 909 additions and 748 deletions.
28 changes: 28 additions & 0 deletions plugin/public/dark-nethermind-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions plugin/public/light-nethermind-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions plugin/src/App.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
body {
font: 1rem;
}
.shell {
display: flex;
flex-direction: column;
height: 100vh;
display: flex;
flex-direction: column;
height: 100vh;
}

.solidity-version-legend {
margin: 0 24px;
margin: 0 24px;
}
11 changes: 3 additions & 8 deletions plugin/src/components/BackgroundNotices/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import React from 'react'
import './backgroundNotices.css'
import { PLUGIN_INFO_CONTENT_ARRAY } from '@/utils/constants'

const Notices = [
'The zkSync Remix Plugin is in Alpha',
'Solidity contracts are compiled on a server hosted by Nethermind'
]

const BackgroundNotices: React.FC = () => {
const BackgroundNotices = () => {
return (
<div className={'bg-transparent'}>
<p className="text-center text-md bg-notices-text">Notices</p>
{
<ul className="list-group">
{Notices.map((notice, index) => {
{PLUGIN_INFO_CONTENT_ARRAY.map((notice, index) => {
return (
<li
className="list-group-item d-flex justify-content-left align-items-center bg-notices-text bg-primary"
Expand Down
71 changes: 16 additions & 55 deletions plugin/src/components/NM/index.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
import React from 'react'
import { useIcon } from '@/hooks/useIcons'

import './styles.css'

const sizeToDimenstions = (size: 'lg' | 'sm' | 'xs' | 'md' | 'xl'): { w: number; h: number } => {
const baseW = 126
const baseH = 63
const sizeToDimenstions = (
size: 'lg' | 'sm' | 'xs' | 'md' | 'xl'
): {
h: number
w: number
} => {
const baseW = 130 * 4.5
const baseH = 19 * 4.5
switch (size) {
case 'lg':
return {
h: baseH,
w: baseW
}
return { h: baseH * 1, w: baseW * 1 }
case 'xs':
return {
h: baseH * 0.2,
w: baseW * 0.2
}
return { h: baseH * 0.2, w: baseW * 0.2 }
case 'sm':
return {
h: baseH * 0.5,
w: baseW * 0.5
}
return { h: baseH * 0.5, w: baseW * 0.5 }
case 'md':
return {
h: baseH * 0.7,
w: baseW * 0.7
}
return { h: baseH * 0.7, w: baseW * 0.7 }
case 'xl':
return {
h: baseH * 1.5,
w: baseW * 1.5
}
return { h: baseH * 1.5, w: baseW * 1.5 }
}
return { h: baseH, w: baseW }
}

interface INethermind {
Expand All @@ -42,36 +32,7 @@ const Nethermind: React.FC<INethermind> = ({ size = 'xs' }): React.ReactElement
const sz = sizeToDimenstions(size)
return (
<a href={'https://nethermind.io'} target={'_blank'} rel="noreferrer">
<svg xmlns="http://www.w3.org/2000/svg" width={sz.w} height={sz.h} viewBox="0 0 252 126" fill="none">
<path
fill="#00aceb"
d="m77.2 1.6-9.1 33.9c-1.6-.3-3.3-.5-5-.5-2.5 0-4.9.3-7.3.9C51.7 37 48 39 44.9 41.7L20.1 16.9c3.2-3 6.7-5.7 10.5-7.9l1.9-1.1c4.4-2.4 9.2-4.4 14.2-5.7C51.9.7 57.4 0 63 0c4.9 0 9.6.5 14.2 1.6z"
/>
<path
fill="#00bff2"
d="M250.5 48.9c1.1 4.5 1.6 9.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.8 5.4-2 7.9-3.6z"
/>
<path
fill="#00bff2"
d="m16.9 20.1 24.8 24.8C39 48 37 51.7 35.9 55.8c-.6 2.3-.9 4.7-.9 7.2 0 1.7.1 3.3.4 4.9L1.6 77.1C.5 72.6 0 67.9 0 63c0-5.7.7-11.1 2.1-16.3 1.3-5 3.3-9.7 5.7-14.1l1.1-2c2.4-3.8 5-7.3 8-10.5z"
/>
<path
fill="#ffa726"
d="m249.3 44.5-33.8 9.2c-1.4-4-3.7-7.6-6.6-10.6-3.4-3.4-7.8-6-12.6-7.3-2.3-.6-4.7-.9-7.3-.9-2.5 0-5 .3-7.3.9-2.9.8-5.6 2-8.1 3.6l-24.7-25.2c2.4-2 4.9-3.8 7.6-5.3l2-1.2c4.4-2.4 9.2-4.4 14.1-5.7 5.4-1.3 10.8-2 16.5-2 5.6 0 11.1.7 16.3 2.1 5 1.3 9.7 3.3 14.1 5.7l2 1.2c4.4 2.6 8.5 5.8 12.1 9.5 3.6 3.6 6.8 7.7 9.5 12.1l1.1 1.9c2.1 3.8 3.9 7.8 5.1 12z"
/>
</svg>
<img width={sz.w} height={sz.h} src={useIcon('nethermind-logo.svg')}></img>
</a>
)
}
Expand Down
Empty file.
49 changes: 49 additions & 0 deletions plugin/src/components/Settings/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react'
import { BsChevronDown } from 'react-icons/bs'
import { useAtom, useAtomValue } from 'jotai'
import { solidityVersionAtom, versionsAtom } from '@/atoms'
import * as Dropdown from '@/ui_components/Dropdown'
import './settings.css'

export const Settings = () => {
const [solidityVersion, setSolidityVersion] = useAtom(solidityVersionAtom)
const versions = useAtomValue(versionsAtom)

return (
<div className="settings-wrapper">
<div className="text-center font-bold w-full">Settings</div>
<div className={'settings-box'}>
<div className={'settings-box-header'}>zksolc Version</div>
<div className={'blank'}></div>
<div className={'settings-box-content'}>
<div>
<Dropdown.Root>
<Dropdown.Trigger>
<label className="flex p-2 border gap-2">
zksolc-{solidityVersion}&nbsp;
<BsChevronDown />
</label>
</Dropdown.Trigger>
<Dropdown.Portal>
<Dropdown.Content>
{versions.map((v, i) => {
return (
<Dropdown.Item
key={i}
onClick={() => {
setSolidityVersion(v)
}}
>
{v}
</Dropdown.Item>
)
})}
</Dropdown.Content>
</Dropdown.Portal>
</Dropdown.Root>
</div>
</div>
</div>
</div>
)
}
36 changes: 36 additions & 0 deletions plugin/src/components/Settings/settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.settings-wrapper {
padding: 16px;
margin: 0;
display: flex;
flex-direction: column;

gap: 16px;
}

.settings-box {
display: grid;
grid-template-columns: 3fr 1fr 4fr;

align-items: center;
font-size: 14px;

border-bottom: 1px solid var(--light);

padding: 8px;

width: 100%;
}

.settings-box-header {
font-weight: bold;
}

.settings-box-content {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 12px;

width: 100%;
}
12 changes: 4 additions & 8 deletions plugin/src/features/Compilation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,9 @@ export const Compilation = ({ setAccordian }: CompilationProps) => {
}

return (
<Container>
{/* <div className="align-center d-flex justify-content-center">
Only files in the contracts folder can be compiled.
</div> */}

<Container className="flex flex-column justify-content-center">
<button
className="btn btn-warning w-100 text-break remixui_disabled mb-1 mt-1 px-2"
className="btn btn-secondary d-block text-break mb-1 text-center"
onClick={() => handleCompile({ type: 'PROJECT' })}
disabled={isCompiling || !isContractsFolderAvailable}
>
Expand All @@ -139,7 +135,7 @@ export const Compilation = ({ setAccordian }: CompilationProps) => {
<span style={{ paddingLeft: '0.5rem' }}>{status}</span>
</>
) : isContractsFolderAvailable ? (
<span> Compile Project</span>
<div className="text-truncate overflow-hidden text-nowrap">Compile Project</div>
) : (
<Tooltip
icon={
Expand All @@ -159,7 +155,7 @@ export const Compilation = ({ setAccordian }: CompilationProps) => {
</button>

<button
className="btn btn-primary w-100 text-break remixui_disabled mb-1 mt-1 px-2"
className="btn btn-primary d-block text-break mb-1 mt-2"
style={{
cursor: `${!isValidSolidity || !currentFilename ? 'not-allowed' : 'pointer'}`
}}
Expand Down
24 changes: 0 additions & 24 deletions plugin/src/features/CompilerVersion/style.css

This file was deleted.

3 changes: 2 additions & 1 deletion plugin/src/features/Deployment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,13 @@ export const Deployment: React.FC<DeploymentProps> = ({ setActiveTab }) => {
<ConstructorInput inputs={inputs} setInputs={setInputs}></ConstructorInput>

<button
className="deploy-btn btn btn-primary btn-warning w-100 text-break mb-1 mt-2 px-0"
className="btn btn-warning w-100 text-break mb-1 mt-2 px-0"
onClick={() => {
deploy().catch((err) => {
console.error(err)
})
}}
disabled={deployStatus === 'IN_PROGRESS'}
>
{deployStatus === 'IN_PROGRESS' ? (
<>
Expand Down
Loading

0 comments on commit c9928d7

Please sign in to comment.