Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new modifications for header app #3

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions frontend/assets/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Deoxys Telemetry</title>
<script type="text/javascript" src="/tmp/env-config.js"></script>
<style>
body, html {
background: #fff;
color: #111;
}
</style>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Deoxys Telemetry</title>
<script type="text/javascript" src="/tmp/env-config.js"></script>
<style>
body,
html {
background: #fff;
color: #111;
}
</style>
<link rel="icon" type="image/png+xml" href="/favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>

</html>
Binary file added frontend/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.App {
text-align: left;
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/Chain/Chain.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
left: 0;
right: 0;
bottom: 0;
top: 330px;
top: 300px;
}

.Chain-content {
width: 100%;
min-width: 1350px;
min-height: 100%;
background: #2c2b2b;
color: #fff;
color: #000;
border-radius: 10px;
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
box-shadow: rgba(0, 0, 0, 0.5) 0 3px 30px;
}
28 changes: 28 additions & 0 deletions frontend/src/components/Chain/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@
padding: 20px 0px;
}

.Image-row {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}

.Column-image {
display: flex;
flex-direction: column;
justify-content: center;
align-items: start;
gap: 5px;
}

.Column-image p {
margin: 0;
}

.text-gray {
color: #666;
}

.text-bold {
font-size: 1.5rem;
font-weight: 800;
}

.Header-top-row {
display: flex;
justify-content: space-between;
Expand Down
47 changes: 11 additions & 36 deletions frontend/src/components/Chain/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ import blockIcon from '../../icons/blockchain-icon.svg';
import finalizedIcon from '../../icons/distribute-icon.svg';
import blockTimeIcon from '../../icons/stopwatch-icon.svg';
import lastTimeIcon from '../../icons/timer.svg';
import listIcon from '../../icons/list-alt-regular.svg';
import worldIcon from '../../icons/location.svg';
import settingsIcon from '../../icons/settings.svg';
import statsIcon from '../../icons/graph.svg';
import kasarImg from '../../assets/kasarLogo.png'
import deoxysImg from '../../assets/deoxys.png'

import { FiGithub } from "react-icons/fi";
import { PiTwitterLogoBold } from "react-icons/pi";
import { SiGoogledocs } from "react-icons/si";
import { MdOutlineContactSupport } from "react-icons/md";

import './Header.css';

Expand Down Expand Up @@ -67,22 +58,26 @@ export class Header extends React.Component<HeaderProps, { pressedButton: Button

// Event handler for button clicks
handleButtonClick = (buttonId: ButtonId) => {
console.log('Button clicked:', buttonId); // Add this line to check if method is called
this.setState({ pressedButton: buttonId });
};
public render() {
const { best, finalized, blockTimestamp, blockAverage } = this.props;
const { currentTab, setDisplay } = this.props;

console.log(this.state.pressedButton)
return (
<div className="Header">
<div className="Header-top-row">
<img
src={deoxysImg}
alt="Deoxys"
className="ImageIcon"
/>
<div className="Image-row">
<img
src={deoxysImg}
alt="Deoxys"
className="ImageIcon"
/>
<div className="Column-image">
<p className='text-bold'>Deoxis</p>
<p className='text-gray'>v0.1.0-alpha</p>
</div>
</div>
<div className="Row-icons">
<button className="button-outline" onClick={() => window.open('https://github.com/KasarLabs/deoxys')}>
Github
Expand All @@ -96,10 +91,6 @@ export class Header extends React.Component<HeaderProps, { pressedButton: Button
<button className="button-outline" onClick={() => window.open('https://t.me/kasarlabs')}>
Support
</button>
{/* <FiGithub onClick={() => window.open('https://github.com/KasarLabs/deoxys')} size={30} />
<PiTwitterLogoBold onClick={() => window.open('https://twitter.com/kasarlabs')} size={30} />
<SiGoogledocs onClick={() => window.open('https://deoxys-docs.kasar.io')} size={30} />
<MdOutlineContactSupport onClick={() => window.open('https://t.me/kasarlabs')} size={30} /> */}
</div>
</div>
<div className="Header-row-first">
Expand All @@ -123,22 +114,6 @@ export class Header extends React.Component<HeaderProps, { pressedButton: Button

</div>
<div className="Header-row-second">
{/* <button className={`button-outline ${this.state.pressedButton === 'nodes' ? 'pressed' : ''}`}
onClick={() => this.handleButtonClick('nodes')}>
Nodes
</button>
<button className={`button-outline ${this.state.pressedButton === 'map' ? 'pressed' : ''}`}
onClick={() => this.handleButtonClick('map')}>
Map
</button>
<button className={`button-outline ${this.state.pressedButton === 'stats' ? 'pressed' : ''}`}
onClick={() => this.handleButtonClick('stats')}>
Stats
</button>
<button className={`button-outline ${this.state.pressedButton === 'params' ? 'pressed' : ''}`}
onClick={() => this.handleButtonClick('params')}>
Params
</button> */}

<Tab
text="Nodes"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/List/THead.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

.THead {
background: #338CF5;
color: #fff;
}

.THeadCell {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Settings/Setting.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
}

.Setting-on {
color: #fff;
color: #000;
}

.Setting .Icon {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Stats/Stats.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

.Stats-category {
text-align: left;
background-color: #fff;
background-color: #000;
margin-bottom: 2.5rem;
padding: 1rem;
}
Expand All @@ -37,7 +37,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
}

.Stats-category tr:nth-child(even) {
background-color: #eee;
background-color: #000;
}

.Stats-percent {
Expand Down
45 changes: 25 additions & 20 deletions frontend/src/components/Tile.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,49 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
.Tile {
font-size: 1.8em; /* Increased text size */
text-align: left;
width: 200px;
height: 80px;
display: inline-block;
position: relative;
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
border-radius: 10px;
padding: 20px;
justify-content: center;
color: black;
margin: 20px;
border-right: 1px solid #666;
padding: 10px 0px;
margin: 10px;
}

.Row-tiles .Tile:last-child {
border-right: none;
}

.Tile-row {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
gap: 10px;
}

.Tile-label {
position: absolute;
background-color: transparent;
padding: 2px;
left: 50px;
right: 0;
font-size: 0.6em; /* Increased text size */
font-weight: 600; /* Increased text weight */
font-weight: 800; /* Increased text weight */
color: black;
letter-spacing: 2px;
}

.Tile-content {
position: absolute;
bottom: 10px;
background-color: transparent;
padding: 2px;
left: 50px;
right: 0;
font-weight: 600; /* Increased text weight */
font-size: 0.6em; /* Increased text size */
color: black;
font-weight: 400; /* Increased text weight */
font-size: 0.5em; /* Increased text size */
color: #666;
}

.Tile .Icon {
position: absolute;
background-color: transparent;
left: 15px;
font-size: 0.9em; /* Increased text size */
color: black;
border: none;
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/Tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ interface TileProps {
export function Tile(props: TileProps) {
return (
<div className="Tile">
<Icon src={props.icon} />
<span className="Tile-label">{props.title}</span>
<div className="Tile-row">
<Icon src={props.icon} />
<span className="Tile-label">{props.title}</span>
</div>
<span className="Tile-content">{props.children}</span>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ module.exports = {
// Use our index.html as a starting point (to add script links etc to)
// and make sure to use/copy over the favicon too.
new HtmlWebpackPlugin({
favicon: "./assets/favicon.svg",
template: "./assets/index.html"
favicon: "./assets/favicon.ico",
template: "./assets/index.html"
}),
],
resolve: {
Expand Down
Loading