Commit d922639e authored by Live Jortveit Sagebakken's avatar Live Jortveit Sagebakken
Browse files

Deleted filterCommits

parent 7cd46aa9
import { useEffect, useState } from "react";
import Commit from "./commit";
import FilterCommits from "./filterCommits";
function commitView() {
// eslint-disable-next-line react-hooks/rules-of-hooks
......@@ -37,7 +36,6 @@ function commitView() {
return (
<div className="commits">
<h3>Commits</h3>
<FilterCommits />
{commits
? commits.map(
(commit: { message: string; created_at: number }, index) => (
......
import React, { useState } from "react";
import commitView from "./commitView";
import commit from "./commit";
// Resource: https://reactjs.org/docs/forms.html
class filterCommits extends React.Component<{}, { value: string }>{
constructor(props: string) {
super(props);
this.state = {value: 'Alle commits'};
this.handleChange = this.handleChange.bind(this);
}
// Todo: Trenger å finne ut av hva slags type event er
// Bytte navn til filter-funksjon eller noe mer spesifikt
handleChange(event: any) {
this.setState({value: event.currentTarget.value});
alert("Filter on: " + event.currentTarget.value);
}
// Videre: Tror jeg må flytte alle commitsa hit fra commitView, eventuelt lage et interface eller noe (refactoring)
render(){
return (
<div>
<label>Filtrer commits:
<select value = {this.state.value} onChange = {this.handleChange}>
<option value="AllCommits">Alle commits</option>
<option value="lastSevenDays">Siste 7 dager</option>
<option value="lastFourteenDays">Siste 14 dager</option>
<option value="lastTwentyoneDays">Siste 21 dager</option>
<option value="lastThirtyDays">Siste 30 dager</option>
</select>
</label>
</div>
);
}
}
export default filterCommits;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment