Skip to content

Commit 2993f2a

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 4722086 + e73c137 commit 2993f2a

File tree

7 files changed

+57
-46
lines changed

7 files changed

+57
-46
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
99

10-
## [1.0.5](https://github.com/annabranco/my-profile/compare/v1.0.4...1.0.5)
10+
## [1.1.0](https://github.com/annabranco/my-profile/compare/1.0.5...1.1.0)
11+
12+
### Commits
13+
14+
- enh: [#a06] Enhanced details on devices [`edcac23`](https://github.com/annabranco/my-profile/commit/edcac23417419dad7ba6dea641ef86686a85a6be)
15+
16+
## [1.0.5](https://github.com/annabranco/my-profile/compare/v1.0.5...1.0.5) - 2021-04-22
17+
18+
## [v1.0.5](https://github.com/annabranco/my-profile/compare/v1.0.4...v1.0.5) - 2021-04-22
1119

1220
### Commits
1321

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "anna-branco-profile",
33
"author": "Anna Branco <anna.branco@icloud.com> (https://github.com/annabranco)",
44
"description": "This is Anna Branco's developer profile",
5-
"version": "1.0.5",
5+
"version": "1.1.0",
66
"repository": "github:annabranco/my-profile/",
77
"homepage": "http://annabranco.github.io/my-profile/",
88
"keywords": [

src/components/mainComponents/ScrollArea/index.js

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef } from 'react';
1+
import React, { useCallback, useEffect, useRef } from 'react';
22
import { useDispatch, useSelector } from 'react-redux';
33
import { bool, func } from 'prop-types';
44
import {
@@ -127,44 +127,50 @@ const ScrollArea = ({
127127
const resetScrollPosition = delay =>
128128
setTimeout(() => scrollAreaRef.current.scrollTo(0, 0), delay);
129129

130-
const goToNextSection = type => {
131-
if (type === BACK_ACTION) {
132-
dispatch(changeSection(getPreviousSection(currentSection)));
133-
changeActiveSection(getPreviousSection(currentSection));
134-
} else {
135-
dispatch(changeSection(getNextSection(currentSection)));
136-
changeActiveSection(getNextSection(currentSection));
137-
}
138-
};
130+
const goToNextSection = useCallback(
131+
type => {
132+
if (type === BACK_ACTION) {
133+
dispatch(changeSection(getPreviousSection(currentSection)));
134+
changeActiveSection(getPreviousSection(currentSection));
135+
} else {
136+
dispatch(changeSection(getNextSection(currentSection)));
137+
changeActiveSection(getNextSection(currentSection));
138+
}
139+
},
140+
[dispatch, currentSection, changeActiveSection]
141+
);
139142

140-
const handleTouchStart = ev => {
143+
const handleTouchStart = useCallback(ev => {
141144
const xCoord = ev.changedTouches[0].screenX;
142145
touchEvent = xCoord;
143-
};
144-
145-
const handleTouchEnd = ev => {
146-
const xCoord = ev.changedTouches[0].screenX;
147-
const difference = touchEvent - xCoord;
148-
149-
if (difference >= 200) {
150-
if (showInstructions && !langModalVisible) {
151-
ev.stopPropagation();
152-
toggleInstructions(false);
153-
return;
154-
}
155-
goToNextSection();
156-
} else if (difference <= -200) {
157-
if (showInstructions && !langModalVisible) {
158-
ev.stopPropagation();
159-
toggleInstructions(false);
160-
return;
146+
}, []);
147+
148+
const handleTouchEnd = useCallback(
149+
ev => {
150+
const xCoord = ev.changedTouches[0].screenX;
151+
const difference = touchEvent - xCoord;
152+
153+
if (difference >= 100) {
154+
if (showInstructions && !langModalVisible) {
155+
ev.stopPropagation();
156+
toggleInstructions(false);
157+
return;
158+
}
159+
goToNextSection();
160+
} else if (difference <= -100) {
161+
if (showInstructions && !langModalVisible) {
162+
ev.stopPropagation();
163+
toggleInstructions(false);
164+
return;
165+
}
166+
goToNextSection(BACK_ACTION);
161167
}
162-
goToNextSection(BACK_ACTION);
163-
}
164-
setTimeout(() => {
165-
touchEvent = 0;
166-
}, 1000);
167-
};
168+
setTimeout(() => {
169+
touchEvent = 0;
170+
}, 1000);
171+
},
172+
[showInstructions, langModalVisible, goToNextSection, toggleInstructions]
173+
);
168174

169175
const getNextSectionName = () =>
170176
sectionsTexts[getNextSection(currentSection)];
@@ -267,7 +273,7 @@ const ScrollArea = ({
267273
document.removeEventListener('touchend', handleTouchEnd);
268274
touchActive.current = false;
269275
};
270-
}, [handleTouchStart, handleTouchEnd, handleTouchEnd]);
276+
}, [handleTouchStart, handleTouchEnd]);
271277

272278
return (
273279
<ScrollAreaWrapper

src/components/sections/MyInfoPage/styles.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const Advise = styled.div`
7979
position: absolute;
8080
margin-left: 3vw;
8181
padding: 5px 10px;
82-
bottom: 25vh;
82+
bottom: 20vh;
8383
width: 45vw;
8484
background: rgba(254, 255, 255, 0.3);
8585
font-size: 0.8em;
@@ -263,6 +263,8 @@ MeuBarquinho.displayName = 'Ship Image';
263263
export const MoreText = styled.p`
264264
z-index: 50;
265265
position: absolute;
266+
top: 50%;
267+
transform: translate(0, -50%);
266268
font-family: ${fontTitleAlt};
267269
color: ${colorWhite};
268270
`;

src/components/sections/Seabed/seaElements/FishesElement/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const FishesElement = () => {
6969
}
7070
updateFishes(currentFishes);
7171
}, 12000);
72-
}, []);
72+
}, [updateFishes]);
7373

7474
return <>{fishes.map(fish => fish)}</>;
7575
};

src/utils/sections.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ const sections = [
1818

1919
export const getNextSection = current => {
2020
const currentId = sections.findIndex(section => section === current);
21-
console.log('$$$ currentId', currentId);
2221

23-
console.log('$$$ sections[currentId + 1]', sections[currentId + 1]);
2422
if (currentId === 0 || currentId !== -1) {
2523
if (currentId === sections.length - 1) {
2624
return INFO_PAGE_SECTION;
@@ -32,9 +30,6 @@ export const getNextSection = current => {
3230

3331
export const getPreviousSection = current => {
3432
const currentId = sections.findIndex(section => section === current);
35-
console.log('$$$ currentId', currentId);
36-
37-
console.log('$$$ sections[currentId + 1]', sections[currentId + 1]);
3833

3934
if (currentId === 0 || currentId === -1) {
4035
return INFO_PAGE_SECTION;

0 commit comments

Comments
 (0)