File tree Expand file tree Collapse file tree 6 files changed +20
-15
lines changed Expand file tree Collapse file tree 6 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 77 < meta name ="theme-color " content ="#000000 " />
88 < meta
99 name ="description "
10- content ="Web site created using create-react-app "
10+ content ="Declarative routing library for React ⚛ with page transitions and animations. Under Development 🧪. Web site created using create-react-app "
1111 />
1212 < link rel ="apple-touch-icon " href ="%PUBLIC_URL%/logo192.png " />
1313 <!--
2424 work correctly both with client-side routing and a non-root public URL.
2525 Learn how to configure a non-root public URL by running `npm run build`.
2626 -->
27- < title > React App </ title >
27+ < title > React Motion Router </ title >
2828 </ head >
2929 < body >
3030 < noscript > You need to enable JavaScript to run this app.</ noscript >
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import ChevronLeftIcon from '@mui/icons-material/ChevronLeft' ;
33import IconButton from '@mui/material/IconButton' ;
4- import { Navigation } from 'react-motion-router' ;
54import '../css/Navbar.css' ;
65
76interface NavbarProps {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default function Cards(props: CardsProps) {
2020 {
2121 Heroes . map ( ( hero : Hero , index ) => {
2222 return (
23- < ButtonBase onClick = { ( ) => props . navigation . navigate ( '/details' , {
23+ < ButtonBase key = { index } onClick = { ( ) => props . navigation . navigate ( '/details' , {
2424 profile : hero
2525 } ) } >
2626 < Card sx = { { width : 345 } } >
@@ -36,13 +36,7 @@ export default function Cards(props: CardsProps) {
3636 < SharedElement id = { `title-${ hero . id } ` } >
3737 < Typography gutterBottom variant = "h5" component = "h5" > { hero . name } </ Typography >
3838 </ SharedElement >
39- {
40- hero . description ?
41- < SharedElement id = { `desc-${ hero . id } ` } >
42- < p > { hero . description } </ p >
43- </ SharedElement >
44- : undefined
45- }
39+ < p > { hero . description } </ p >
4640 </ CardContent >
4741 </ Card >
4842 </ ButtonBase >
Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ export default function Details(props: DetailsProps) {
3838 < SharedElement id = { `title-${ props . route . params . profile . id } ` } >
3939 < h1 > { props . route . params . profile . name } </ h1 >
4040 </ SharedElement >
41- < SharedElement id = { `desc-${ props . route . params . profile . id } ` } >
42- < p > { props . route . params . profile . description } </ p >
43- </ SharedElement >
41+ < p > { props . route . params . profile . description } </ p >
4442 </ div >
4543 </ div >
4644 </ div >
Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
2- import { Heroes , Hero } from '../assets/Heroes' ;
2+ import { Heroes } from '../assets/Heroes' ;
33import ClearIcon from '@mui/icons-material/Clear' ;
44import { Navigation , SharedElement } from 'react-motion-router' ;
55import IconButton from '@mui/material/IconButton' ;
Original file line number Diff line number Diff line change 2626 text-align : justify;
2727 line-height : 1.5rem ;
2828 height : 100% ;
29+ }
30+ .details .text-content p {
31+ animation : slide-up 300ms ease-out;
32+ }
33+
34+ @keyframes slide-up {
35+ from {
36+ opacity : 0 ;
37+ transform : translateY (15px );
38+ }
39+ to {
40+ opacity : 1 ;
41+ transform : translateY (0px );
42+ }
2943}
You can’t perform that action at this time.
0 commit comments