-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3660 from LiteFarmOrg/LF-4629-nice-to-have-implem…
…ent-map-footer-redesign Lf 4629 [nice to have] implement map footer redesign
- Loading branch information
Showing
14 changed files
with
249 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/webapp/src/components/Map/Footer/MapNavigationButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2025 LiteFarm.org | ||
* This file is part of LiteFarm. | ||
* | ||
* LiteFarm is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* LiteFarm is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { useTranslation } from 'react-i18next'; | ||
import clsx from 'clsx'; | ||
import Button from '../../Form/Button'; | ||
import styles from './styles.module.scss'; | ||
import { ReactComponent as AddLogo } from '../../../assets/images/map/addSkew.svg'; | ||
import { ReactComponent as FilterLogo } from '../../../assets/images/map/filter-funnel.svg'; | ||
import { ReactComponent as ExportLogo } from '../../../assets/images/map/download.svg'; | ||
|
||
export interface MapNavigationButtonsProps { | ||
isAdmin?: boolean; | ||
showAddDrawer?: boolean; | ||
showMapFilter?: boolean; | ||
showModal?: boolean; | ||
isMapFilterSettingActive?: boolean; | ||
onClickAdd: () => void; | ||
handleClickFilter: () => void; | ||
onClickExport?: () => void; | ||
} | ||
|
||
const MapNavigationButtons = ({ | ||
isAdmin, | ||
showAddDrawer, | ||
showMapFilter, | ||
showModal, | ||
onClickAdd, | ||
handleClickFilter, | ||
onClickExport, | ||
isMapFilterSettingActive, | ||
}: MapNavigationButtonsProps) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
{isAdmin && ( | ||
<Button | ||
color="accent" | ||
data-cy="map-addFeature" | ||
className={clsx(styles.button, showAddDrawer && styles.selected)} | ||
id="mapFirstStep" | ||
onClick={onClickAdd} | ||
sm | ||
> | ||
<span className={styles.buttonText}> | ||
<AddLogo className={styles.svg} /> | ||
<span className={styles.label}>{t('FARM_MAP.ADD_LOCATION')}</span> | ||
</span> | ||
</Button> | ||
)} | ||
<Button | ||
color="accent" | ||
className={clsx(styles.button, showMapFilter && styles.selected)} | ||
id="mapSecondStep" | ||
onClick={handleClickFilter} | ||
sm | ||
> | ||
<span className={styles.buttonText}> | ||
{isMapFilterSettingActive && <span className={styles.circle} />} | ||
<FilterLogo className={styles.svg} /> | ||
<span className={styles.label}>{t('FARM_MAP.FILTER_MAP')}</span> | ||
</span> | ||
</Button> | ||
<Button | ||
color="accent" | ||
className={clsx(styles.button, showModal && styles.selected)} | ||
id="mapThirdStep" | ||
onClick={onClickExport} | ||
sm | ||
> | ||
<span className={styles.buttonText}> | ||
<ExportLogo className={styles.svg} /> | ||
<span className={styles.label}>{t('FARM_MAP.EXPORT_MAP')}</span> | ||
</span> | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MapNavigationButtons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.