Skip to content
Snippets Groups Projects
Commit 95c00402 authored by jherman5's avatar jherman5
Browse files

fixed lint issues within code.

parent bba8900d
No related branches found
No related tags found
No related merge requests found
import React from 'react';
import { Route } from 'react-router-dom';
import { Pattern } from './features/patternGen/patternGeneration';
export function App() {
return (
<>
......
import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import styles from './patternGeneration.module.css';
import { Title } from './patternTitle.js';
......@@ -22,7 +20,6 @@ import {
hideColorFour,
} from './patternSlice';
export function Pattern(props) {
const colorOne = useSelector(selectColorOne);
const colorTwo = useSelector(selectColorTwo);
......@@ -57,16 +54,18 @@ export function Pattern(props) {
<main className={styles.flexbox}>
<Title title={'Color Learner'} />
<div className={styles.buttonGrid}>
<button title='red' className={styles.redbutton} onPointerEnter={onRedEnter} onPointerLeave={onRedLeave}>
<button title="red" className={styles.redbutton} onPointerEnter={onRedEnter} onPointerLeave={onRedLeave}>
{colorOne}
</button>
<button title='blue' className={styles.bluebutton} onPointerEnter={onBlueEnter} onPointerLeave={onBlueLeave}>
<button title="blue" className={styles.bluebutton} onPointerEnter={onBlueEnter} onPointerLeave={onBlueLeave}>
{colorTwo}
</button>
<button title='yellow' className={styles.yellowbutton} onPointerEnter={onYellowEnter} onPointerLeave={onYellowLeave}>
<button title="yellow" className={styles.yellowbutton} onPointerEnter={onYellowEnter}
onPointerLeave={onYellowLeave}>
{colorThree}
</button>
<button title='green' className={styles.greenbutton} onPointerEnter={onGreenEnter} onPointerLeave={onGreenLeave}>
<button title="green" className={styles.greenbutton} onPointerEnter={onGreenEnter}
onPointerLeave={onGreenLeave}>
{colorFour}
</button>
</div>
......
/* eslint-disable no-magic-numbers */
import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
......@@ -20,7 +18,7 @@ import {
hideColorTwo,
hideColorThree,
hideColorFour,
} from './patternSlice.js'
} from './patternSlice.js';
jest.mock('./patternSlice.js', () => ({
selectColorOne: jest.fn().mockName('selectColorOne'),
showColorOne: jest.fn().mockName('showColorOne'),
......@@ -120,4 +118,3 @@ describe('green button', () => {
expect(hideColorFour).toHaveBeenCalledTimes(1);
});
});
......@@ -49,7 +49,6 @@ export const {
hideColorFour,
} = patternSlice.actions;
export function selectColorOne(state) {
return state.pattern.colorOne;
}
......
/* eslint-disable no-magic-numbers */
import patternSlice, {
selectColorOne,
selectColorTwo,
......
......@@ -6,7 +6,7 @@ export function Title(props) {
<h1>
{props.title}:
</h1>
)
);
}
Title.propTypes = {
title: PropTypes.string.isRequired,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment