Skip to content
Snippets Groups Projects
Commit befd6f08 authored by Carl Valdemar Ebbesen's avatar Carl Valdemar Ebbesen
Browse files

add goBack button

parent 0258603b
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import LandingPage from "./pages/landingPage/landingPage";
import OverviewPage from "./pages/overviewPage/Overview";
import { GlobalCommitContext } from './context/commitPageContext';
import { useState } from 'react';
import IssuePage from './pages/issuePage';
import IssuePage from './pages/issueListPage/issuePage';
import { CommitPage } from './pages/commitGraphPage/CommitPage';
import { IssueGraphPage } from './pages/issueGraphPage/issueGraphPage';
import CommitPageWrapper from "./pages/commitListPage/commitPageWrapper"
......
.button {
padding: 10px;
border-radius: 16px;
background-color: #F5CA7B;
font-size: 16px;
position: absolute;
left: 30px;
top: 30px;
cursor: pointer;
}
.button:hover{
background-color: #f3d295;
}
\ No newline at end of file
import React from 'react';
import { useHistory } from 'react-router';
import style from "./goBackButton.module.css"
const GobackButton = () => {
const history = useHistory();
return (
<button className={style.button} onClick={()=> history.goBack()}>Go back</button>
);
};
export default GobackButton;
\ No newline at end of file
import React from 'react';
import IssuesListComponent from "../components/issuesListComponent/issuesListComponent";
import IssuesListComponent from "../../components/issuesListComponent/issuesListComponent";
import styles from "./issuePage.module.css";
import {useGitlabApi} from "../utils/gitlab_api_service";
import {queryTypes, Issue} from "../utils/queryType";
import {useGitlabApi} from "../../utils/gitlab_api_service";
import {queryTypes, Issue} from "../../utils/queryType";
import ClipLoader from "react-spinners/ClipLoader";
const IssuePage = () => {
......
......@@ -4,6 +4,7 @@ import { useGitlabApi } from '../../utils/gitlab_api_service';
import { Languages, queryTypes } from '../../utils/queryType';
import StatsBox from '../../components/stats/statsBox';
import { ClipLoader } from 'react-spinners';
import GobackButton from '../../components/goBack/goBackButton';
const OverviewPage = () => {
const slug = window.location.pathname;
......@@ -13,11 +14,12 @@ const OverviewPage = () => {
return (
<div className={style.wrapper}>
<GobackButton/>
{slug==="/overview" ?<h1>Stats:</h1>: null}
{isLoading ? <ClipLoader loading={isLoading}/> :
slug==="/overview" ?<StatsBox content={data as Languages ? Object.entries(data as Languages).map(element => `${element[0]}: ${element[1]} %`): ["Loading ..."] } />
:null}
<h2 style={{marginTop: "30px"}}>{slug=== "/overview" ?"More info:": "Choose display form"}</h2>
<h2 style={{marginTop: "30px"}}>{slug=== "/overview" ?"More info:": "Choose display from:"}</h2>
<div className={style.buttonWrapper}>
<button className={style.button} onClick= {() => history.push(slug=== "/overview" ? "/issue" : `${slug}graph`)}>
{slug=== "/overview" ? "Issues" : "Graph"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment