Skip to content

Commit 145913d

Browse files
danger9224solkimicreb
authored andcommitted
test(pokedex): updated formatting
1 parent daacd79 commit 145913d

9 files changed

Lines changed: 52 additions & 49 deletions

File tree

examples/pokedex/src/App.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ body {
283283
margin: 2rem auto;
284284
}
285285

286-
.modal-content h2, .modal-content h3 {
287-
margin-top: .5rem;
286+
.modal-content h2,
287+
.modal-content h3 {
288+
margin-top: 0.5rem;
288289
}
289290

290291
.modal-header {

examples/pokedex/src/App.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { useEffect } from "react";
2-
import { view } from "react-easy-state";
3-
import pokedex from "./store";
4-
import List from "./components/List";
5-
import Modal from "./components/Modal";
6-
import "./App.css";
1+
import React, { useEffect } from 'react';
2+
import { view } from 'react-easy-state';
3+
import pokedex from './store';
4+
import List from './components/List';
5+
import Modal from './components/Modal';
6+
import './App.css';
77

88
export default view(() => {
99
useEffect(() => {
@@ -15,7 +15,7 @@ export default view(() => {
1515
<div className="header">
1616
<img src="https://upload.wikimedia.org/wikipedia/commons/9/98/International_Pok%C3%A9mon_logo.svg" />
1717
<p>
18-
A demo Pokédex app built with GraphQL and{" "}
18+
A demo Pokédex app built with GraphQL and{' '}
1919
<a href="https://github.com/risingstack/react-easy-state">
2020
react-easy-state
2121
</a>

examples/pokedex/src/components/Attack.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from "react";
2-
import { view } from "react-easy-state";
3-
import Type from "./Type";
1+
import React from 'react';
2+
import { view } from 'react-easy-state';
3+
import Type from './Type';
44

55
export const Attack = view(attack => {
66
const { name, damage, type } = attack.attack;
Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
import React from "react";
2-
import { view } from "react-easy-state";
3-
import Type from "./Type";
4-
import pokedex from "../store";
1+
import React from 'react';
2+
import { view } from 'react-easy-state';
3+
import Type from './Type';
4+
import pokedex from '../store';
55

6-
export default view(({ id, name, image, classification, types, mini }) => (
7-
<div
8-
className={`pokemon-card ${mini && "pokemon-card-mini"}`}
9-
onClick={() => {
10-
pokedex.fetchPokemon(id);
11-
pokedex.showModal();
12-
}}
13-
>
14-
<img src={image} />
15-
<h2>{name}</h2>
16-
{!mini && (
17-
<>
18-
<p className="classification">{classification}</p>
19-
<div className="type-container">
20-
{types.map(type => (
21-
<Type key={type} type={type} />
22-
))}
23-
</div>
24-
</>
25-
)}
26-
</div>
27-
));
6+
export default view(
7+
({ id, name, image, classification, types, mini }) => (
8+
<div
9+
className={`pokemon-card ${mini && 'pokemon-card-mini'}`}
10+
onClick={() => {
11+
pokedex.fetchPokemon(id);
12+
pokedex.showModal();
13+
}}
14+
>
15+
<img src={image} />
16+
<h2>{name}</h2>
17+
{!mini && (
18+
<>
19+
<p className="classification">{classification}</p>
20+
<div className="type-container">
21+
{types.map(type => (
22+
<Type key={type} type={type} />
23+
))}
24+
</div>
25+
</>
26+
)}
27+
</div>
28+
),
29+
);

examples/pokedex/src/components/Evolution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "react";
2-
import { view } from "react-easy-state";
1+
import React from 'react';
2+
import { view } from 'react-easy-state';
33

44
export default view(evolution => {
55
const { image, name } = evolution.evolution;

examples/pokedex/src/components/List.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from "react";
2-
import { view } from "react-easy-state";
3-
import pokedex from "../store";
4-
import Card from "./Card";
1+
import React from 'react';
2+
import { view } from 'react-easy-state';
3+
import pokedex from '../store';
4+
import Card from './Card';
55

66
export default view(() => {
77
return (

examples/pokedex/src/components/Type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React from 'react';
22

33
export const Type = type => {
44
return (

examples/pokedex/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ body {
1010
margin: 0;
1111
padding: 0;
1212
line-height: 100%;
13-
}
13+
}

examples/pokedex/src/store.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { store } from "react-easy-state";
2-
import * as api from "./api";
1+
import { store } from 'react-easy-state';
2+
import * as api from './api';
33

44
const pokedex = store({
55
isModalOpen: false,
@@ -22,7 +22,7 @@ const pokedex = store({
2222
},
2323
showModal() {
2424
pokedex.isModalOpen = true;
25-
}
25+
},
2626
});
2727

2828
export default pokedex;

0 commit comments

Comments
 (0)