diff --git a/README.md b/README.md index da3ec2f..cb7e28b 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ You can add your own pets in [`/db.json`](https://github.com/vspedr/developets/b You can use the following format to add your pet -``` +```json { "pets": [ - ... + //... { "id": "", // generate a guid however you like "name": "", @@ -18,7 +18,6 @@ You can use the following format to add your pet "description": "", "img": "" } - ... ] } ``` diff --git a/db.json b/db.json index f6800a1..a4ce7b3 100644 --- a/db.json +++ b/db.json @@ -167,6 +167,14 @@ "type": "dog", "description": "Cute little dog.", "img": "https://i.imgur.com/XoOZNFV.jpeg" + }, + { + "id": "90dbeace-b820-4fa9-8903-3ff9e2b4f0f9", + "name": "LĂrio & Narciso", + "owner": "raphaelalmeidamartins", + "type": "cat", + "description": "My little fellas. They love to turn off my computer when I'm working", + "img": "https://ibb.co/FHJhSCD" } ] } diff --git a/src/App.css b/src/App.css index 6d18f1e..0e04eba 100644 --- a/src/App.css +++ b/src/App.css @@ -55,8 +55,12 @@ body { font-size: large; } +.App main { + padding: 20px 0 30px; +} + .App-content { - padding: 20px; + padding: 20px 0; } .App-pagination { @@ -67,3 +71,9 @@ body { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } + +@media only screen and (max-width: 340px) { + .App-title { + font-size: 2em; + } +} diff --git a/src/App.js b/src/App.js index 682eb61..13af54e 100644 --- a/src/App.js +++ b/src/App.js @@ -1,15 +1,15 @@ +import parse from 'parse-link-header'; import React, { useEffect, useState } from 'react'; -import { usePage } from './hooks/use-page'; -import { Card, Container, Pagination } from 'semantic-ui-react'; +import { HashLoader } from 'react-spinners'; import 'semantic-ui-css/semantic.min.css'; -import parse from 'parse-link-header'; +import { Card, Container, Pagination } from 'semantic-ui-react'; import './App.css'; import { PetCard } from './components/PetCard'; import { PetHeader } from './components/PetHeader'; +import { PETS } from './constants'; +import { usePage } from './hooks/use-page'; import fetchPets from './services/pets'; import { cacheRequest } from './_sessionStorage'; -import { PETS } from './constants'; -import { HashLoader } from "react-spinners"; function App() { const LIMIT = 9; @@ -22,9 +22,13 @@ function App() { useEffect(() => { async function fetchData() { const config = { - params: { _page: page, _limit: LIMIT } + params: { _page: page, _limit: LIMIT }, }; - const result = await cacheRequest(PETS, config.params._page, fetchPets(config)); + const result = await cacheRequest( + PETS, + config.params._page, + fetchPets(config) + ); const parsedLink = parse(result.headers.link); setTotalPages(parsedLink.last._page); setPets(result.data); @@ -39,32 +43,33 @@ function App() { return (
Introduce your animal buddies to your fellow developers -
+