Skip to content

Instantly share code, notes, and snippets.

@zocom-christoffer-wallenberg
Last active December 27, 2021 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zocom-christoffer-wallenberg/d827e540a749c7c7ad99d27ac8b80b19 to your computer and use it in GitHub Desktop.
Save zocom-christoffer-wallenberg/d827e540a749c7c7ad99d27ac8b80b19 to your computer and use it in GitHub Desktop.

header-fu-react

Övning

I denna övning ska du göra ett bibliotek av barnböcker. Du hittar en JSON-fil med böcker här med som heter childrensbooks.json som du kan importera med import books from '../assets/childrensbooks.json'; (skapa en mapp som heter assets samt skapa en fil som heter childrensbooks.json och lägg in nedanstående innehåll).

Använd dig av React router med två vyer, en för alla böcker och en för en detaljerad vy av en bok.

Figmaskiss: https://www.figma.com/file/lm4l7OViUO8ypfQn9IBG91/Mini-Library?node-id=2%3A41

Funktionalitet

  • Lista alla böcker från childrensbooks.json
  • När jag klickar på en bok ska den visas med mer information se Figmaskiss.
[
{
"id": 1,
"title" : "Goodnight Moon",
"author" : "Margaret Wise Brown",
"publisher" : "Harper Festival",
"year" : 1947,
"pages" : 30,
"plot" : "In a soothing, repetitive tone, a young rabbit says goodnight to all the things in the room. Instead of plot, Goodnight Moon looks at the world from the eyes of a very young child, calming children with the ritual of naming each object around them. Lulling babies to sleep since 1947, this classic still ranks on bestseller lists, with some estimates of all-time copies sold worldwide topping 48 million. Find out more of the best books to help your child fall asleep.",
"audience" : "1 - 4 years",
"color" : "#2F80ED"
},
{
"id": 2,
"title" : "The Very Hungry Caterpillar",
"author" : "Eric Carle",
"publisher" : "Philomel Books",
"year" : 1969,
"pages" : 26,
"plot" : "In this classic children’s book, a caterpillar eats his way through a week’s worth of food before making his glorious transformation into a butterfly. With colorful artwork of tissue paper and paint, plus fun holes to stick tiny fingers through, this children’s classic touches on everything from counting to the days of the week to the life cycle of living things.",
"audience" : "2 - 3 years",
"color" : "#27AE60"
},
{
"id": 3,
"title" : "A Wrinkle in Time",
"author" : "Madeleine L’Engle",
"publisher" : "Square Fish",
"year" : 1962,
"pages" : 256,
"plot" : "Back on current bestseller lists, likely thanks to Disney’s recent movie adaptation, this groundbreaking 1962 novel features a heroine in a genre-bending science fiction–fantasy story about a girl tasked with traveling through space and time to save her scientist father—and the world. A forerunner of modern young-adult sci-fi and fantasy, including The Hunger Games and Harry Potter, and winner of the 1963 Newbery Medal, this story continues to thrill today. Check out more books you need to read before the movie version comes out.",
"audience" : "10 - 14 years",
"color" : "#6FCF97"
},
{
"id": 4,
"title" : "Harold and the Purple Crayon",
"author" : "Crockett Johnson",
"publisher" : "Harper Collins",
"year" : 1955,
"pages" : null,
"plot" : "Imagine if you could create a whole world just with one crayon. That’s what happens to Harold, and his story has been sparking children’s imaginations since 1955. Harold is also a great problem-solver: For example, he draws a boat to climb into after he unintentionally draws an ocean. This simple but lovely story frequently ranks on lists of the best children’s books, including those from the National Education Association and School Library Journal.",
"audience" : "4 - 8 years",
"color" : "#9B51E0"
},
{
"id": 5,
"title" : "Where the Wild Things Are",
"author" : "Maurice Sendak",
"publisher" : "Harper Collins",
"year" : 1963,
"pages" : 48,
"plot" : "Ranking at number one on lists of best children’s books compiled by Scholastic, School Library Journal, and Time magazine, 1963’s Where the Wild Things Are is all about imagination. As in Harold and the Purple Crayon (not surprisingly, that book’s author was Sendak’s mentor), young Max creates a whole world for himself after he’s punished by being sent to his room. Eventually, though, he realizes the importance of his home and family. Its exploration of complex emotions, recognition of childhood struggles, and their resolution make this seemingly simple book rich with meaning.",
"audience" : "4 - 8 years",
"color" : "#56CCF2"
},
{
"id": 6,
"title" : "Madeline",
"author" : "Ludwig Bemelmans",
"publisher" : "The Viking Press",
"year" : 1939,
"pages" : 54,
"plot" : "In this charming story the title heroine explores Paris with her classmates, then needs her appendix out! She’s the smallest in her class, but she’s also the bravest, and handles what could be a scary situation with fearlessness and confidence. The calming rhymes lend a sense of soothing to the tale as well. Ranking among the New York Public Library’s 100 Great Children’s Books, the original story sparked numerous sequels featuring the plucky Madeline. Read more awesome books to read with fierce female characters.",
"audience" : "3 - 7 years",
"color" : "#F2C94C"
},
{
"id": 7,
"title" : "The Tale of Peter Rabbit",
"author" : "Beatrix Potter",
"publisher" : "Warne",
"year" : 1902,
"pages" : 72,
"plot" : "Beatrix Potter’s classic children’s book with lovely illustrations make this little rabbit a mainstay of children’s literature over a hundred years later. In the first of many tales, mischievous Peter runs into danger when he disobeys his mother and ventures into the neighbor’s garden. A story about consequences, the playful tale is never scary and ranks at number two on Publishers Weekly‘s list of all-time bestselling children’s books. It’s amazing that it’s one of the iconic books that almost didn’t get published.",
"audience" : "3 - 7 years",
"color" : "#F2994A"
},
{
"id": 8,
"title" : "Charlotte’s Web ",
"author" : "E. B. White",
"publisher" : "Harper Collins",
"year" : 1952,
"pages" : 192,
"plot" : "Number one on the National Education Association‘s list of the best children’s books, this 1952 classic tells a tale of friendship featuring a spider named Charlotte, a pig named Wilbur, and a girl named Fern. But the cycle of life in this pastoral farm setting doesn’t just make for a sweet story—death does occur, although in a peaceful way. Caregivers should be aware of questions that may arise as children make the transition to reading literature with deeper themes, like this one. Find out the special joy of reading children’s books through grown-up eyes.",
"audience" : "8 - 12 years",
"color" : "#EB5757"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment