Skip to content

Commit 22ea149

Browse files
authored
Merge pull request #4050 from LiteFarmOrg/LF-5133-map-tutorial-icon-should-be-hidden-in-offline-mode
LF-5133 Map tutorial icon should be hidden in offline mode
2 parents 90819f3 + 3b05893 commit 22ea149

14 files changed

Lines changed: 33 additions & 168 deletions

File tree

packages/webapp/.storybook/state.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,10 @@ export default {
18021802
offlineDetectorReducer: {
18031803
isOffline: false,
18041804
},
1805+
offlineReadinessReducer: {
1806+
wentOfflineDuringSetup: false,
1807+
cacheValidation: null,
1808+
},
18051809
},
18061810
baseReducer: {},
18071811
insightReducer: {

packages/webapp/public/locales/en/translation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@
978978
"TITLE": "Draw a line"
979979
}
980980
},
981-
"TUTORIALS": "Map Tutorials",
982981
"UNABLE_TO_RETIRE": {
983982
"BODY": "You can only retire locations that have no active or planned crops, no animals or tasks.",
984983
"TITLE": "Unable to retire"
-5.64 MB
Binary file not shown.
-5.76 MB
Binary file not shown.
-5.89 MB
Binary file not shown.

packages/webapp/src/components/Icons/icons.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ import { ReactComponent as RemoveAnimalIcon } from '../../assets/images/animals/
6363
// Tasks
6464
import { ReactComponent as SoilAmendmentTask } from '../../assets/images/task/SoilAmendment.svg';
6565

66-
// Map
67-
import { ReactComponent as VideoLogo } from '../../assets/images/map/video.svg';
68-
6966
// System
7067
import { ReactComponent as ExternalLinkIcon } from '../../assets/images/icon_external_link.svg';
7168
import { ReactComponent as MoreHorizontalIcon } from '../../assets/images/more-horizontal.svg';
@@ -144,8 +141,6 @@ export const iconMap = {
144141
REMOVE_ANIMAL: RemoveAnimalIcon,
145142
// Tasks
146143
SOIL_AMENDMENT_TASK: SoilAmendmentTask,
147-
// Map
148-
VIDEO_LOGO: VideoLogo,
149144
// System
150145
EXTERNAL_LINK: ExternalLinkIcon,
151146
MORE_HORIZONTAL: MoreHorizontalIcon,

packages/webapp/src/components/Map/Header/index.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
import PropTypes from 'prop-types';
22
import styles from './styles.module.scss';
33
import { useTranslation } from 'react-i18next';
4-
import Icon, { Cross } from '../../Icons';
4+
import { Cross } from '../../Icons';
55

66
type MapHeaderProps = {
77
farmName: string;
8-
isAdmin?: boolean;
98
};
109

1110
interface MapHeaderMain extends MapHeaderProps {
12-
handleVideoClick: () => void;
1311
handleClose?: never;
1412
}
1513

1614
interface MapHeaderViewer extends MapHeaderProps {
17-
handleVideoClick?: never;
1815
handleClose: () => void;
1916
}
2017

21-
export default function PureMapHeader({
22-
farmName,
23-
isAdmin,
24-
handleVideoClick,
25-
handleClose,
26-
}: MapHeaderMain | MapHeaderViewer) {
18+
export default function PureMapHeader({ farmName, handleClose }: MapHeaderMain | MapHeaderViewer) {
2719
const { t } = useTranslation();
2820

2921
return (
@@ -35,9 +27,6 @@ export default function PureMapHeader({
3527
{' | '}
3628
<span className={styles.farmMap}>{t('FARM_MAP.TITLE')}</span>
3729
</div>
38-
{isAdmin && handleVideoClick && (
39-
<Icon iconName="VIDEO_LOGO" onClick={handleVideoClick} className={styles.pointer} />
40-
)}
4130
{handleClose && <Cross className={styles.cross} onClick={handleClose} />}
4231
</div>
4332
);

packages/webapp/src/components/Map/Videos/index.jsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

packages/webapp/src/components/Map/Videos/styles.module.scss

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/webapp/src/containers/Map/index.jsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,6 @@ export default function Map({ isCompactSideMenu }) {
387387

388388
const mapWrapperRef = useRef();
389389

390-
const handleVideoClick = () => {
391-
history.push('/map/videos');
392-
};
393-
394390
const handleCloseSuccessHeader = () => {
395391
dispatch(canShowSuccessHeader(false));
396392
setShowSuccessHeader(false);
@@ -455,13 +451,7 @@ export default function Map({ isCompactSideMenu }) {
455451
return (
456452
isLoaded && (
457453
<>
458-
{!drawingState.type && !showSuccessHeader && (
459-
<PureMapHeader
460-
farmName={farm_name}
461-
handleVideoClick={handleVideoClick}
462-
isAdmin={is_admin}
463-
/>
464-
)}
454+
{!drawingState.type && !showSuccessHeader && <PureMapHeader farmName={farm_name} />}
465455
{showSuccessHeader && (
466456
<PureSnackbarWithoutBorder
467457
className={styles.successSnackbar}

0 commit comments

Comments
 (0)