This repository was archived by the owner on Feb 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +79
-59
lines changed
src/_pages/LandingPage/components/OtherFeaturesView Expand file tree Collapse file tree 6 files changed +79
-59
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ const config = {
6262 colorMode : {
6363 defaultMode : 'dark' ,
6464 disableSwitch : false ,
65- respectPrefersColorScheme : true ,
65+ respectPrefersColorScheme : false ,
6666 } ,
67- // image: '/img/meta.png', // Gets used in Head
67+ // image: '/img/meta.png', // Gets used in Head as Meta Image (og:image)
6868 announcementBar : {
6969 id : 'github-star' ,
7070 content : customFields . announcementBarContent ,
Original file line number Diff line number Diff line change 3434 "react-icons" : " ^4.1.0" ,
3535 "react-live" : " ^2.2.3" ,
3636 "react-spring" : " ^8.0.27" ,
37+ "react-swipeable" : " ^6.0.1" ,
3738 "react-toastify" : " ^6.2.0" ,
3839 "styled-components" : " ^5.2.1"
3940 },
4041 "devDependencies" : {
42+ "@types/jest" : " ^26.0.15" ,
4143 "@types/node" : " ^12.0.0" ,
4244 "@types/react" : " ^17.0.0" ,
4345 "@types/react-dom" : " ^16.9.8" ,
4446 "@types/react-helmet" : " ^6.1.0" ,
4547 "@types/react-router-dom" : " ^5.1.6" ,
4648 "@types/styled-components" : " ^5.1.0" ,
47- "@types/jest" : " ^26.0.15" ,
4849 "@typescript-eslint/eslint-plugin" : " ^4.12.0" ,
4950 "@typescript-eslint/parser" : " ^4.12.0" ,
5051 "eslint" : " ^7.17.0" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Card from './components/Card';
33import styles from './styles.module.css' ;
44import BulletItem from './components/BulletItem' ;
55import { useWindowSize } from '../../../../../../hooks/useWindowSize' ;
6+ import { useSwipeable } from 'react-swipeable' ;
67
78export interface CardInterface {
89 title : string ;
@@ -26,6 +27,19 @@ const Cards: React.FC<Props> = (props) => {
2627 height : 600 ,
2728 } ) ;
2829
30+ const handlers = useSwipeable ( {
31+ onSwipedLeft : ( ) => {
32+ console . log ( 'Swiped Left' ) ;
33+ if ( index < cards . length - 1 ) setIndex ( index + 1 ) ;
34+ } ,
35+ onSwipedRight : ( ) => {
36+ console . log ( 'Swiped Right' ) ;
37+ if ( index > 0 ) setIndex ( index - 1 ) ;
38+ } ,
39+ preventDefaultTouchmoveEvent : true ,
40+ trackMouse : true ,
41+ } ) ;
42+
2943 const getCardProps = useCallback (
3044 (
3145 i : number
@@ -104,7 +118,7 @@ const Cards: React.FC<Props> = (props) => {
104118 ) ;
105119
106120 return (
107- < div className = { styles . Container } >
121+ < div className = { styles . Container } { ... handlers } >
108122 < div
109123 className = { styles . Slider }
110124 style = { {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const cards: CardInterface[] = [
2727 {
2828 title : 'Well Tested' ,
2929 description :
30- 'AgileTs has over 1000 jest tests to ensure everything works as expected.' ,
30+ 'AgileTs has over 2000 jest tests to ensure everything works as expected.' ,
3131 to : 'docs/introduction' ,
3232 imagePath : 'img/pages/landing/engineer.svg' ,
3333 } ,
You can’t perform that action at this time.
0 commit comments