Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon changes #2359

Merged
merged 8 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
33 changes: 26 additions & 7 deletions public/assets/images/icons/headerIcons/DefaultProfileImageIcon.tsx
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
const DefaultProfileImageIcon = () => {
return (
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="12" fill="#DFF4E8" />
<path
fillRule="evenodd"
clipRule="evenodd"
d="M16.4632 9.93092C16.4632 9.93092 15.6142 9.97331 15.423 10.8185C15.423 10.8185 15.4202 8.32812 13.5176 6.94321C13.5176 6.94321 12.9615 7.37839 12.9727 8.28421C12.9727 8.28421 11.3727 6.4935 7.93948 5.60212C6.98604 9.05149 7.74561 11.3021 7.74561 11.3021C6.96679 10.8394 6.31185 11.1034 6.31185 11.1034C6.56035 13.4433 8.71523 14.6912 8.71523 14.6912C7.88769 14.4342 7.42645 15.1483 7.42645 15.1483C9.48192 17.8293 12.2914 18.2031 14.3401 17.1436C14.4749 17.0738 14.6066 16.9978 14.7344 16.9159C16.6763 15.6714 17.7575 13.0519 16.4632 9.93092ZM14.3401 17.1436L13.4524 15.6061L10.8222 15.3421L10.8748 14.8956L13.1756 15.1267L11.9034 12.9232L9.27324 12.6591L9.32553 12.2122L11.6264 12.4434L9.97035 9.57501L10.3647 9.34735L12.0207 12.2157L12.971 10.1075L13.3841 10.2857L12.2977 12.6955L13.57 14.8991L14.5202 12.7909L14.9331 12.9686L13.8467 15.3784L16.1366 19.3447L15.7423 19.5724L14.3401 17.1436Z"
fill="#219653"
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="44" height="44" rx="22" fill="#DFF4E8" />
<rect
x="2"
y="2"
width="44"
height="44"
rx="22"
stroke="white"
strokeWidth="2.15138"
/>
<g clipPath="url(#clip0_65_29)">
<path
d="M26.0541 24.7993C28.5227 23.8038 30.2559 21.4379 30.2559 18.6582C30.2559 14.9865 27.2227 12 23.4936 12C19.7645 12 16.7445 14.9865 16.7445 18.6582C16.7445 21.4379 18.4777 23.8167 20.9463 24.7993C17.1384 25.8595 14.2628 29.1304 14.0002 33.1771C13.9739 33.6425 14.1446 34.1079 14.4598 34.457C14.788 34.8061 15.2607 35 15.7466 35H31.2407C31.7134 35 32.1992 34.8061 32.5275 34.457C32.8558 34.1209 33.0265 33.6425 32.9871 33.1771C32.7245 29.1304 29.8357 25.8465 26.041 24.7993H26.0541Z"
fill="#219653"
/>
</g>
<defs>
<clipPath id="clip0_65_29">
<rect
width="19"
height="23"
fill="white"
transform="translate(14 12)"
/>
Comment on lines +13 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Adjust clipping path to remove white space.

The clipping path dimensions and translation create unnecessary white space around the icon. Consider adjusting these values to fill the container better.

           <rect
-            width="19"
-            height="23"
+            width="21"
+            height="25"
             fill="white"
-            transform="translate(14 12)"
+            transform="translate(13.5 11.5)"
           />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<rect
width="19"
height="23"
fill="white"
transform="translate(14 12)"
/>
<rect
width="21"
height="25"
fill="white"
transform="translate(13.5 11.5)"
/>

</clipPath>
</defs>
</svg>
);
};
Expand Down
272 changes: 272 additions & 0 deletions public/assets/images/icons/projectV2/PointMarkerIconsSymbol.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,33 @@ import { useMemo } from 'react';
import { useTranslations } from 'next-intl';
import styles from '../styles/ProjectListControls.module.scss';
import { availableFilters } from '../../../../utils/projectV2';
import {
TreePlanting,
Agroforestry,
NaturalRegeneration,
ManagedRegeneration,
UrbanRestoration,
OtherPlanting,
Mangroves,
} from '../../../../../public/assets/images/icons/projectV2/PointMarkerIconsSymbol';
// import TreePlanting from '../../../../../public/assets/images/icons/project/TreePlanting';

interface ClassificationDropDownProps {
selectedClassification: TreeProjectClassification[];
setSelectedClassification: SetState<TreeProjectClassification[]>;
selectedMode?: ViewMode;
}

const classificationItemIcons = {
'large-scale-planting': <TreePlanting width={'20'} height={'20'} />,
agroforestry: <Agroforestry width={'20'} height={'20'} />,
'natural-regeneration': <NaturalRegeneration width={'20'} height={'20'} />,
'managed-regeneration': <ManagedRegeneration width={'20'} height={'20'} />,
'urban-planting': <UrbanRestoration width={'20'} height={'20'} />,
'other-planting': <OtherPlanting width={'20'} height={'20'} />,
mangroves: <Mangroves width={'20'} height={'20'} />,
};

export const ClassificationDropDown = ({
selectedClassification,
setSelectedClassification,
Expand Down Expand Up @@ -67,12 +87,13 @@ export const ClassificationDropDown = ({
onClick={() => handleFilterSelection(filterItem)}
>
<div
className={
className={`${
selectedClassification?.includes(filterItem)
? styles.classificationSelected
: styles.classificationUnselected
}
} ${styles.classificationItem}`}
>
{classificationItemIcons[filterItem]}
{tAllProjects(`classificationTypes.${filterItem}`)}
</div>
{index !== availableFilters.length - 1 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@
top: 67px;
}

.classificationItem {
display: flex;
color: rgba($dark, 1);
width: 100%;
align-items: center;
gap: 4px;
}

.classificationUnselected {
font-size: $fontXXSmall;
line-height: normal;
Expand Down
8 changes: 3 additions & 5 deletions src/features/user/Profile/ProfileCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import React from 'react';
import { Avatar } from '@mui/material';
import getImageUrl from '../../../../utils/getImageURL';
import styles from './ProfileCard.module.scss';
import {
DefaultUserProfileImage,
SettingsIcon,
} from '../../../../../public/assets/images/icons/ProfilePageV2Icons';
import { SettingsIcon } from '../../../../../public/assets/images/icons/ProfilePageV2Icons';
import DefaultProfileImageIcon from '../../../../../public/assets/images/icons/headerIcons/DefaultProfileImageIcon';
import Link from 'next/link';
import ProfileActions from './ProfileActions';
import DonorCircleMemberBadge from './MicroComponents/DonorCircleMemberBadge';
Expand All @@ -28,7 +26,7 @@ const ProfileCard = ({ userProfile, profilePageType }: ProfileV2Props) => {
<Avatar alt={userProfile.displayName} src={userImageUrl} />
) : (
<Avatar>
<DefaultUserProfileImage />
<DefaultProfileImageIcon />
</Avatar>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/features/user/Settings/EditProfile/EditProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Delete from '../../../../../public/assets/images/icons/manageProjects/Del
import CustomTooltip from '../../../common/Layout/CustomTooltip';
import NewToggleSwitch from '../../../common/InputTypes/NewToggleSwitch';
import { useRouter } from 'next/router';
import { DefaultUserProfileImage } from '../../../../../public/assets/images/icons/ProfilePageV2Icons';
import DefaultProfileImageIcon from '../../../../../public/assets/images/icons/headerIcons/DefaultProfileImageIcon';
import themeProperties from '../../../../theme/themeProperties';
import NewInfoIcon from '../../../../../public/assets/images/icons/projectV2/NewInfoIcon';

Expand Down Expand Up @@ -274,7 +274,7 @@ export default function EditProfileForm() {
</div>
) : (
<div className={styles.noProfilePic}>
<DefaultUserProfileImage />
<DefaultProfileImageIcon />
</div>
)}
</div>
Expand Down
Loading