Skip to content

Commit

Permalink
Merge pull request #19 from dm3-org/rpc-info-msg
Browse files Browse the repository at this point in the history
Rpc info msg
  • Loading branch information
malteish authored Jul 10, 2024
2 parents 4610ba7 + 9a3049a commit 236d270
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const App = () => {
/>

<Env
rpc={rpc}
profileAndKeysCreated={profileAndKeysCreated}
storeEnv={storeEnv}
/>
Expand Down
17 changes: 16 additions & 1 deletion src/components/Env.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { useState } from 'react';
import { storeConfig } from '../utils/fileUtils';

interface EnvProps {
rpc: string;
profileAndKeysCreated: boolean;
storeEnv: () => void;
}

export function Env(props: EnvProps) {
const [showRpcInfo, setShowRpcInfo] = useState<boolean>(false);

return (
<div className="step description-text">
<h2 className="heading-text">
Expand All @@ -16,13 +20,24 @@ export function Env(props: EnvProps) {
clicking below buttons and keep it securely with you. Both the
files are needed in step 4.
</p>
{showRpcInfo &&
props.profileAndKeysCreated &&
!props.rpc.length && (
<p className="info-text">
Remember to add a valid rpc url to your .env file before
using it.
</p>
)}
{/* Button to download .env file */}
<button
className={'btn env-btn active-btn '.concat(
!props.profileAndKeysCreated ? 'disabled-btn' : '',
)}
disabled={!props.profileAndKeysCreated}
onClick={props.storeEnv}
onClick={() => {
setShowRpcInfo(true);
props.storeEnv();
}}
>
Store .env
</button>{' '}
Expand Down
6 changes: 6 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ body {
margin-top: 1rem;
}

.info-text {
font-size: 14px;
color: #0F980D;
margin-bottom: 0px;
}

/* changes rainbowkit button background color */
[data-rk] {
--rk-colors-connectButtonBackground: rgb(133, 53, 240) !important;
Expand Down

0 comments on commit 236d270

Please sign in to comment.