Skip to content

Commit

Permalink
changed button-toggle to text box for version and date info #8
Browse files Browse the repository at this point in the history
  • Loading branch information
nadyasav committed Oct 11, 2023
1 parent ed63197 commit 82c98a5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 68 deletions.
19 changes: 2 additions & 17 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,18 @@ import './index.scss';
import './App.css';
import '@rainbow-me/rainbowkit/styles.css';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import DevModeToggle from './components/devModeToggle/DevModeToggle';
import VersionInfo from './components/versionInfo/VersionInfo';

function App() {
const [count, setCount] = useState(0);
const [devModeState, setDevModeState] = useState(false);
const versionGitTag = import.meta.env.VITE_REACT_APP_GIT_TAG;
const gitDate = import.meta.env.VITE_REACT_APP_GIT_DATE;

console.log('VITE_REACT_APP_GIT_TAG - ', versionGitTag);
console.log('VITE_REACT_APP_GIT_DATE - ', gitDate);

const handleToggleDevMode = (value: boolean) => {
setDevModeState(value);
};

return (
<div className='app appBox'>
{versionGitTag && gitDate && (
<div>
<DevModeToggle isDevMode={devModeState} handleToggleDevMode={handleToggleDevMode} />
{devModeState && (
<div>
<p>Version: {versionGitTag}</p>
<p>Date: {gitDate}</p>
</div>
)}
</div>
)}
<div className='logoBox'>
<a href='https://vitejs.dev' target='_blank' rel='noreferrer'>
<img src={viteLogo} className='logo' alt='Vite logo' />
Expand All @@ -50,6 +34,7 @@ function App() {
</div>
<p className='read-the-docs'>Click on the Vite and React logos to learn more</p>
<ConnectButton />
{versionGitTag && gitDate && <VersionInfo version={versionGitTag} versionDate={gitDate} />}
</div>
);
}
Expand Down
14 changes: 0 additions & 14 deletions frontend/src/components/devModeToggle/DevModeToggle.module.scss

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/src/components/devModeToggle/DevModeToggle.tsx

This file was deleted.

24 changes: 24 additions & 0 deletions frontend/src/components/versionInfo/VersionInfo.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.versionInfoBox {
position: absolute;
bottom: 5px;
right: 5px;
color: #ffffff;
padding: 10px;
font-size: 14px;
border-radius: 10px;
max-width: 250px;
background: rgba(0, 0, 0, 0.8);
}

.versionInfoItem {
word-break: break-all;
margin-top: 10px;

&:first-child {
margin-top: 0;
}
}

.versionInfoName {
padding-right: 5px;
}
23 changes: 23 additions & 0 deletions frontend/src/components/versionInfo/VersionInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styles from './VersionInfo.module.scss';

interface IVersionInfo {
version: string;
versionDate: string;
}

function VersionInfo(props: IVersionInfo) {
return (
<div className={styles.versionInfoBox}>
<p className={styles.versionInfoItem}>
<span className={styles.versionInfoName}>Version: </span>
{props.version}
</p>
<p className={styles.versionInfoItem}>
<span className={styles.versionInfoName}>Date: </span>
{props.versionDate}
</p>
</div>
);
}

export default VersionInfo;
30 changes: 15 additions & 15 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,9 @@
"@types/ms" "*"

"@types/eslint@^8.4.2":
version "8.44.3"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.3.tgz#96614fae4875ea6328f56de38666f582d911d962"
integrity sha512-iM/WfkwAhwmPff3wZuPLYiHX18HI24jU8k1ZSH7P8FHwxTjZ2P6CoX2wnF43oprR+YXJM6UUxATkNvyv/JHd+g==
version "8.44.4"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.4.tgz#28eaff82e1ca0a96554ec5bb0188f10ae1a74c2f"
integrity sha512-lOzjyfY/D9QR4hY9oblZ76B90MYTB3RrQ4z2vBIJKj9ROCRqdkYl2gSUx1x1a4IWPjKJZLL4Aw1Zfay7eMnmnA==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"
Expand Down Expand Up @@ -953,16 +953,16 @@
integrity sha512-kMpQpfZKSCBqltAJwskgePRaYRFukDkm1oItcAbC3gNELR20XIBcN9VRgg4+m8DKsTfkWeA4m4Imp4DDuWy7FQ==

"@types/react-dom@^18.2.7":
version "18.2.12"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.12.tgz#58479c463d1e0b7f1ee7cd80e09186189f9ec32d"
integrity sha512-QWZuiA/7J/hPIGocXreCRbx7wyoeet9ooxfbSA+zbIWqyQEE7GMtRn4A37BdYyksnN+/NDnWgfxZH9UVGDw1hg==
version "18.2.13"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.13.tgz#89cd7f9ec8b28c8b6f0392b9591671fb4a9e96b7"
integrity sha512-eJIUv7rPP+EC45uNYp/ThhSpE16k22VJUknt5OLoH9tbXoi8bMhwLf5xRuWMywamNbWzhrSmU7IBJfPup1+3fw==
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@^18.2.15":
version "18.2.27"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.27.tgz#746e52b06f3ccd5d7a724fd53769b70792601440"
integrity sha512-Wfv7B7FZiR2r3MIqbAlXoY1+tXm4bOqfz4oRr+nyXdBqapDBZ0l/IGcSlAfvxIHEEJjkPU0MYAc/BlFPOcrgLw==
version "18.2.28"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.28.tgz#86877465c0fcf751659a36c769ecedfcfacee332"
integrity sha512-ad4aa/RaaJS3hyGz0BGegdnSRXQBkd1CCYDCdNjBPg90UUpLgo+WlJqb9fMYUxtehmzF3PJaTWqRZjko6BRzBg==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
Expand Down Expand Up @@ -2126,9 +2126,9 @@ eastasianwidth@^0.2.0:
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==

electron-to-chromium@^1.4.535:
version "1.4.548"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.548.tgz#e695d769e0e801fa6d438b63f6bc9b80372000d6"
integrity sha512-R77KD6mXv37DOyKLN/eW1rGS61N6yHOfapNSX9w+y9DdPG83l9Gkuv7qkCFZ4Ta4JPhrjgQfYbv4Y3TnM1Hi2Q==
version "1.4.549"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.549.tgz#ab223f5d85c55a9def358db163bc8cacba72df69"
integrity sha512-gpXfJslSi4hYDkA0mTLEpYKRv9siAgSUgZ+UWyk+J5Cttpd1ThCVwdclzIwQSclz3hYn049+M2fgrP1WpvF8xg==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -3765,9 +3765,9 @@ safe-stable-stringify@^2.1.0:
integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==

sass@^1.69.1:
version "1.69.1"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.1.tgz#659b3b04452245dcf82f731684831e990ddb0c89"
integrity sha512-nc969GvTVz38oqKgYYVHM/Iq7Yl33IILy5uqaH2CWSiSUmRCvw+UR7tA3845Sp4BD5ykCUimvrT3k1EjTwpVUA==
version "1.69.2"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.2.tgz#8aeaeb6c1dcdbeaa26bbfeddece67c9fcd4b1d93"
integrity sha512-48lDtG/9OuSQZ9oNmJMUXI2QdCakAWrAGjpX/Fy6j4Og8dEAyE598x5GqCqnHkwV7+I5w8DJpqjm581q5HNh3w==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
Expand Down

0 comments on commit 82c98a5

Please sign in to comment.