{"size": 1038, "ext": "js", "max_stars_repo_path": "src/components/TopNav.js", "max_stars_repo_name": "DarthAmun/DnDTome", "max_stars_repo_stars_event_min_datetime": "2020-01-07T12:19:07.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-15T23:30:27.000Z", "max_issues_repo_path": "src/components/TopNav.js", "max_issues_repo_name": "DMsGuild201/DnDTome", "max_issues_repo_issues_event_min_datetime": "2021-01-28T20:35:29.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T22:05:37.000Z", "max_forks_repo_path": "src/components/TopNav.js", "max_forks_repo_name": "DarthAmun/DnDTome", "max_forks_repo_forks_event_min_datetime": "2020-01-07T19:58:36.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-16T23:36:13.000Z"}
{"max_stars_count": 14, "max_issues_count": 7, "max_forks_count": 2, "avg_line_length": 29.6571428571, "max_line_length": 73, "alphanum_fraction": 0.5722543353}
import React, { Component } from 'react';
import '../assets/css/TopNav.css';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTimes } from '@fortawesome/free-solid-svg-icons';
import { faWindowMinimize } from '@fortawesome/free-regular-svg-icons';

const electron = window.require('electron');
const ipcRenderer = electron.ipcRenderer;

class TopNav extends Component {

    closeMainWindow = () => {
        ipcRenderer.send('closeMainWindow');
    }

    minimizeWindow = () => {
        ipcRenderer.send('minimizeMainWindow');
    }

    render() {
        return (
            <div id="topNav">
                <div id="topBar"></div>
                <div id="close" onClick={() => this.closeMainWindow()}>
                    <FontAwesomeIcon icon={faTimes} />
                </div>
                <div id="minimize" onClick={() => this.minimizeWindow()}>
                    <FontAwesomeIcon icon={faWindowMinimize} />
                </div>
            </div>
        )
    }
}

export default TopNav;