style fixes and active color for nav btns

pull/5370/head
lianahus 2 years ago committed by yann300
parent 145ef57203
commit 3e0decbd88
  1. 36
      apps/etherscan/src/app/components/HeaderWithSettings.tsx
  2. 27
      apps/etherscan/src/app/routes.tsx
  3. 1
      apps/etherscan/src/app/views/HomeView.tsx
  4. 2
      libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx

@ -16,21 +16,22 @@ interface IconProps {
const HomeIcon: React.FC<IconProps> = ({ from }: IconProps) => { const HomeIcon: React.FC<IconProps> = ({ from }: IconProps) => {
return ( return (
<NavLink <NavLink
data-id="home" data-id="home"
to={{ to={{
pathname: "/" pathname: "/"
}} }}
state={ from } className={({ isActive }) => isActive ? "btn p-0 m-0" : "btn text-dark p-0 m-0"}
state={ from }
>
<CustomTooltip
tooltipText='Home'
tooltipId='etherscan-nav-home'
placement='bottom'
> >
<CustomTooltip <i className="fas fa-home"></i>
tooltipText='Home' </CustomTooltip>
tooltipId='etherscan-nav-home' </NavLink>
placement='bottom'
>
<i className="fas fa-home"></i>
</CustomTooltip>
</NavLink>
) )
} }
@ -41,8 +42,8 @@ const ReceiptsIcon: React.FC<IconProps> = ({ from }: IconProps) => {
to={{ to={{
pathname: "/receipts" pathname: "/receipts"
}} }}
className={({ isActive }) => isActive ? "btn p-0 m-0 mx-2" : "btn text-dark p-0 m-0 mx-2"}
state={ from } state={ from }
className="mx-2"
> >
<CustomTooltip <CustomTooltip
tooltipText='Receipts' tooltipText='Receipts'
@ -62,6 +63,7 @@ const SettingsIcon: React.FC<IconProps> = ({ from }: IconProps) => {
to={{ to={{
pathname: "/settings" pathname: "/settings"
}} }}
className={({ isActive }) => isActive ? "btn p-0 m-0" : "btn text-dark p-0 m-0"}
state= {from} state= {from}
> >
<CustomTooltip <CustomTooltip
@ -83,9 +85,9 @@ export const HeaderWithSettings: React.FC<Props> = ({
return ( return (
<AppContext.Consumer> <AppContext.Consumer>
{() => ( {() => (
<div> <div className="d-flex justify-content-between">
<h6 className="d-inline">{title}</h6> <h6 className="d-inline">{title}</h6>
<div style={{ float: "right" }}> <div>
<HomeIcon from={from} /> <HomeIcon from={from} />
<ReceiptsIcon from={from} /> <ReceiptsIcon from={from} />
<SettingsIcon from={from} /> <SettingsIcon from={from} />

@ -31,21 +31,30 @@ export const DisplayRoutes = () => (
<Routes> <Routes>
<Route <Route
path="/" path="/"
element={<DefaultLayout from="/" title="Verify Smart Contracts"> element={
<HomeView /> <DefaultLayout from="/" title="Verify Smart Contracts">
</DefaultLayout>} /> <HomeView />
</DefaultLayout>
}
/>
<Route path="/error" <Route path="/error"
element={<ErrorView />} /> element={<ErrorView />} />
<Route <Route
path="/receipts" path="/receipts"
element={<DefaultLayout from="/receipts" title="Check Receipt GUID Status"> element={
<ReceiptsView /> <DefaultLayout from="/receipts" title="Check Receipt GUID Status">
</DefaultLayout>} /> <ReceiptsView />
</DefaultLayout>
}
/>
<Route <Route
path="/settings" path="/settings"
element={<DefaultLayout from="/settings" title="Set Explorer API Key"> element={
<CaptureKeyView /> <DefaultLayout from="/settings" title="Set Explorer API Key">
</DefaultLayout>} /> <CaptureKeyView />
</DefaultLayout>
}
/>
</Routes> </Routes>
</Router> </Router>
) )

@ -8,7 +8,6 @@ import { Receipt } from "../types"
import { VerifyView } from "./VerifyView" import { VerifyView } from "./VerifyView"
export const HomeView: React.FC = () => { export const HomeView: React.FC = () => {
// const [hasError, setHasError] = useState(false)
return ( return (
<AppContext.Consumer> <AppContext.Consumer>
{({ apiKey, clientInstance, setReceipts, receipts, contracts }) => { {({ apiKey, clientInstance, setReceipts, receipts, contracts }) => {

@ -36,7 +36,7 @@ function RootView ({ pluginComponent, children }: RootViewProps) {
return ( return (
<Fragment> <Fragment>
<div id="pluginManager" data-id="pluginManagerComponentPluginManager"> <div id="pluginManager" data-id="pluginManagerComponentPluginManager">
<header className="form-group remixui_pluginSearch plugins-header py-3 px-4 border-bottom" data-id="pluginManagerComponentPluginManagerHeader"> <header className="form-group remixui_pluginSearch plugins-header pt-3 pb-0 px-4 border-bottom" data-id="pluginManagerComponentPluginManagerHeader">
<input <input
type="text" type="text"
onChange={(event) => { onChange={(event) => {

Loading…
Cancel
Save