Skip to content

Commit

Permalink
fix(lint): Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
David Code Howard committed Oct 30, 2023
1 parent 94ccb96 commit ddd40f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
1 change: 0 additions & 1 deletion dev-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dev-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@rnmapbox/maps": "^10.0.15",
"formik": "^2.4.5",
"i18next": "^23.6.0",
"lodash": "^4.17.21",
"native-base": "^3.4.28",
"react": "18.2.0",
"react-i18next": "^13.3.1",
Expand Down
23 changes: 10 additions & 13 deletions dev-client/src/screens/SiteTransferProjectScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ import {FormTooltip} from 'terraso-mobile-client/components/common/Form';

type Props = {projectId: string};

const UNAFFILIATED = {
projectId: Symbol('unaffiliated'),
projectName: '',
};

export const SiteTransferProjectScreen = ({projectId}: Props) => {
const {t} = useTranslation();
const dispatch = useDispatch();
const navigation = useNavigation();

// Don't want this re-rendering
// Otherwise it declares multiple symbols that are *not* equal
const UNAFFILIATED = useMemo(
() => ({
projectId: Symbol('unaffiliated'),
projectName: t('projects.transfer_sites.unaffiliated'),
}),
[],
);
UNAFFILIATED.projectName = t('projects.transfer_sites.unaffiliated');

const hasUnaffiliatedProject = (o: object) =>
Object.getOwnPropertySymbols(o).find(
Expand All @@ -50,7 +47,7 @@ export const SiteTransferProjectScreen = ({projectId}: Props) => {
projectName: UNAFFILIATED.projectName,
}));
return [...prospectiveSites, ...unaffiliated];
}, [sites, projectId]);
}, [sites, projectId, unaffiliatedSites]);

const projectsExcludingCurrent: Record<
string | symbol,
Expand Down Expand Up @@ -108,13 +105,13 @@ export const SiteTransferProjectScreen = ({projectId}: Props) => {
displayedProjects[UNAFFILIATED.projectId],
]);
}
const projects = pool.sort((a, b) => {
const sortedProjects = pool.sort((a, b) => {
if (a[1].projId === UNAFFILIATED.projectId) {
return -1;
}
return a[1].projectName.localeCompare(b[1].projectName);
});
return projects;
return sortedProjects;
}, [displayedProjects]);

const projectRecord = useMemo(() => {
Expand Down Expand Up @@ -166,7 +163,7 @@ export const SiteTransferProjectScreen = ({projectId}: Props) => {
const payload = {projectId, siteIds};
await dispatch(transferSites(payload));
return navigation.pop();
}, [projState]);
}, [projState, dispatch, navigation, projectId]);

const ListHeader = (
<VStack space="10px" px="12px" pt="5%">
Expand Down

0 comments on commit ddd40f8

Please sign in to comment.