-
Notifications
You must be signed in to change notification settings - Fork 83
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 #3659 from LiteFarmOrg/LF-4631_b/Implement_sensor_…
…addition_UI_flow LF-4631 (1): Implement sensor addition UI flow
- Loading branch information
Showing
12 changed files
with
406 additions
and
5 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 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
50 changes: 50 additions & 0 deletions
50
packages/webapp/src/components/Form/ContextForm/HeaderWithBackAndClose.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,50 @@ | ||
/* | ||
* 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 { ReactNode } from 'react'; | ||
import Icon from '../../Icons'; | ||
import TextButton from '../Button/TextButton'; | ||
import { ReactComponent as XIcon } from '../../../assets/images/x-icon.svg'; | ||
import styles from './styles.module.scss'; | ||
|
||
interface HeaderWithBackAndCloseProps { | ||
title: ReactNode; | ||
onCancel?: () => void; | ||
onGoBack?: () => void; | ||
} | ||
|
||
const HeaderWithBackAndClose = ({ title, onCancel, onGoBack }: HeaderWithBackAndCloseProps) => { | ||
return ( | ||
<div className={styles.headerWrapper}> | ||
<div className={styles.container}> | ||
<div className={styles.leftContainer}> | ||
{onGoBack && ( | ||
<TextButton onClick={onGoBack}> | ||
<Icon iconName="CHEVRON_LEFT" className={styles.backButton} /> | ||
</TextButton> | ||
)} | ||
<div className={typeof title === 'string' ? styles.textTitle : ''}>{title}</div> | ||
</div> | ||
{onCancel && ( | ||
<TextButton className={styles.closeButtonContainer} onClick={onCancel}> | ||
<XIcon className={styles.closeButton} /> | ||
</TextButton> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeaderWithBackAndClose; |
38 changes: 38 additions & 0 deletions
38
packages/webapp/src/components/Form/ContextForm/Loading.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,38 @@ | ||
/* | ||
* 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 Spinner from '../../Spinner'; | ||
import styles from './styles.module.scss'; | ||
|
||
interface LoadingProps { | ||
dataName?: string; | ||
} | ||
|
||
const Loading = ({ dataName = '' }: LoadingProps) => { | ||
const { t } = useTranslation(['translation', 'common']); | ||
|
||
return ( | ||
<div className={styles.loadingScreen}> | ||
<div> | ||
<Spinner /> | ||
</div> | ||
<div className={styles.loadingText}>{t('common:LOADING')}</div> | ||
<div className={styles.loadingMessage}>{t('common:FETCHING_YOUR_DATA', { dataName })}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Loading; |
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
Oops, something went wrong.