Skip to content

Commit

Permalink
Removes legacy code and updates Solutions document
Browse files Browse the repository at this point in the history
  • Loading branch information
antjernberg committed Oct 25, 2021
1 parent 492ecf5 commit 0948906
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lab2/DO_NOT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ I `List.js`:
```javascript
render() {
...
{items.length > 0 &&
{
items.map((item, index) => (
<li className="list-group-item" key={index}>{item.name}</li>
))
Expand All @@ -60,7 +60,7 @@ I `List.js`:

```javascript
render() {
const filteredItems = this.filterListItemsBySearchTerm(this.state.searchTerm);
const filteredItems = this.filterListItemsBySearchTerm(searchTerm);
...
{filteredItems.length > 0 &&
filteredItems.map((item, index) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from "react";
import React from "react";
import colors from "./colors";
import "./BackgroundColorPicker.css";

Expand Down
1 change: 0 additions & 1 deletion lab2/src/components/List/List.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState } from "react";
import PropTypes from "prop-types";
import SearchBar from "../SearchBar/SearchBar";

import "./List.css";
Expand Down
4 changes: 2 additions & 2 deletions lab3/DO_NOT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ I `userActions.js`:

```javascript
.then((users) => {
dispatch({
useDispatch({
type: USERS_RECEIVED,
payload: users
})
Expand Down Expand Up @@ -59,4 +59,4 @@ const users = useSelector((state) => state.users.all);

## Del 2

Lösninsförslag till del två går att se genom att byta branch till `solutions`. Här finns även alla uppgifter till alla labbar lösta.
Lösningsförslag till del två går att se genom att byta branch till `solutions`. Här finns även alla uppgifter till alla labbar lösta.
3 changes: 1 addition & 2 deletions lab3/src/components/List/List.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from "react";
import SearchBar from "../SearchBar/SearchBar";
import { connect } from "react-redux";

import "./List.css";

Expand Down Expand Up @@ -33,7 +32,7 @@ const List = ({ title }) => {
<div className="alert alert-warning">Empty list...</div>
) : (
<ul className="list-group">
{filteredUsers.length > 0 &&
{
filteredUsers.map((item) => (
<li
className="List-item list-group-item"
Expand Down
2 changes: 1 addition & 1 deletion lab3/src/components/SearchBar/SearchBar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from "react";
import React from "react";

const SearchBar = ({ onKeyPressed }) => (
<div className="input-group mb-12">
Expand Down

0 comments on commit 0948906

Please sign in to comment.