This repository was archived by the owner on Feb 15, 2025. It is now read-only.
File tree 6 files changed +79
-59
lines changed
src/_pages/LandingPage/components/OtherFeaturesView
6 files changed +79
-59
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ const config = {
62
62
colorMode : {
63
63
defaultMode : 'dark' ,
64
64
disableSwitch : false ,
65
- respectPrefersColorScheme : true ,
65
+ respectPrefersColorScheme : false ,
66
66
} ,
67
- // image: '/img/meta.png', // Gets used in Head
67
+ // image: '/img/meta.png', // Gets used in Head as Meta Image (og:image)
68
68
announcementBar : {
69
69
id : 'github-star' ,
70
70
content : customFields . announcementBarContent ,
Original file line number Diff line number Diff line change 34
34
"react-icons" : " ^4.1.0" ,
35
35
"react-live" : " ^2.2.3" ,
36
36
"react-spring" : " ^8.0.27" ,
37
+ "react-swipeable" : " ^6.0.1" ,
37
38
"react-toastify" : " ^6.2.0" ,
38
39
"styled-components" : " ^5.2.1"
39
40
},
40
41
"devDependencies" : {
42
+ "@types/jest" : " ^26.0.15" ,
41
43
"@types/node" : " ^12.0.0" ,
42
44
"@types/react" : " ^17.0.0" ,
43
45
"@types/react-dom" : " ^16.9.8" ,
44
46
"@types/react-helmet" : " ^6.1.0" ,
45
47
"@types/react-router-dom" : " ^5.1.6" ,
46
48
"@types/styled-components" : " ^5.1.0" ,
47
- "@types/jest" : " ^26.0.15" ,
48
49
"@typescript-eslint/eslint-plugin" : " ^4.12.0" ,
49
50
"@typescript-eslint/parser" : " ^4.12.0" ,
50
51
"eslint" : " ^7.17.0" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Card from './components/Card';
3
3
import styles from './styles.module.css' ;
4
4
import BulletItem from './components/BulletItem' ;
5
5
import { useWindowSize } from '../../../../../../hooks/useWindowSize' ;
6
+ import { useSwipeable } from 'react-swipeable' ;
6
7
7
8
export interface CardInterface {
8
9
title : string ;
@@ -26,6 +27,19 @@ const Cards: React.FC<Props> = (props) => {
26
27
height : 600 ,
27
28
} ) ;
28
29
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
+
29
43
const getCardProps = useCallback (
30
44
(
31
45
i : number
@@ -104,7 +118,7 @@ const Cards: React.FC<Props> = (props) => {
104
118
) ;
105
119
106
120
return (
107
- < div className = { styles . Container } >
121
+ < div className = { styles . Container } { ... handlers } >
108
122
< div
109
123
className = { styles . Slider }
110
124
style = { {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const cards: CardInterface[] = [
27
27
{
28
28
title : 'Well Tested' ,
29
29
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.' ,
31
31
to : 'docs/introduction' ,
32
32
imagePath : 'img/pages/landing/engineer.svg' ,
33
33
} ,
You can’t perform that action at this time.
0 commit comments