Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/static/locales/en/me.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,6 @@
"apiKeyMessage2": "Once you generate an API Key, we will require a two factor authentication for your login. This you’ll be able to setup next time you log in.",
"apiKeyMessage3": "Regenerating an API Key will invalidate your existing API Key immediately.",
"regenerateKey": "Regenerate Key",
"giftFund": "GiftFund"
"giftFund": "GiftFund",
"donatedTrees": "Donated Trees"
}
16 changes: 13 additions & 3 deletions src/features/user/Profile/components/MyTrees/MyTrees.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactElement } from 'react';
import React from 'react';
import styles from '../../styles/MyTrees.module.scss';
import dynamic from 'next/dynamic';
import {
Expand All @@ -23,7 +23,7 @@ interface Props {
}

export default function MyTrees({ profile, authenticatedType, token }: Props) {
const { t, i18n, ready } = useTranslation(['country', 'me']);
const { t, ready } = useTranslation(['country', 'me']);
const [contributions, setContributions] = React.useState();
const { handleError } = React.useContext(ErrorHandlingContext);

Expand Down Expand Up @@ -85,6 +85,16 @@ export default function MyTrees({ profile, authenticatedType, token }: Props) {
? t('me:myForest')
: t('me:nameForest', { name: profile.displayName })}
</div>
<div className={styles.MyTreesLegend}>
<div className={styles.donatedTrees}>
<TreesIcon color="currentColor" />
<p>{t('me:donatedTrees')}</p>
</div>
<div className={styles.registeredTrees}>
<TreesIcon color="currentColor" />
<p>{t('me:registeredTrees')}</p>
</div>
</div>
Comment thread
mohitb35 marked this conversation as resolved.
<div className={styles.myTreesContainer}>
<div className={styles.treesList}>
{contributions.map((contribution: any, index: any) => {
Expand All @@ -102,7 +112,7 @@ export default function MyTrees({ profile, authenticatedType, token }: Props) {

function TreeList({ contribution }: any) {
const date = formatDate(contribution.properties.plantDate);
const { t, i18n, ready } = useTranslation(['country', 'me']);
const { t, i18n } = useTranslation(['country', 'me']);

return (
<div key={contribution.properties.id} className={styles.tree}>
Expand Down
21 changes: 21 additions & 0 deletions src/features/user/Profile/styles/MyTrees.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,27 @@
font-family: $primaryFontFamily;
}


.registeredTrees {
color: #3d67b1;
}

.donatedTrees{
color: #68b030;
}

.MyTreesLegend {
display: flex;
gap: 14px;
padding-bottom: 10px;
div {
display: flex;
gap: 5px;
}
}



@include mdTabletView {
.myTreesSection {
height: 80vh;
Expand Down