Skip to content

Commit

Permalink
Switch from react-icons to lucide (#3265)
Browse files Browse the repository at this point in the history
* add lucide

* remove unused and use arrow right

* remove arrow long

* next and back icon

* charity icon

* check and copy

* check circle

* chevron down

* chevron credit

* crop

* dash

* dashbaord

* delete

* close

* mail

* exclamation

* extlink

* download

* fitler

* folder

* hourglass

* pencil

* replaced

* sizing

* file download

* fix type errors

* use fill

* copier test
  • Loading branch information
ap-justin committed Sep 3, 2024
1 parent eebcedf commit 618f912
Show file tree
Hide file tree
Showing 89 changed files with 289 additions and 343 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"fuse.js": "7.0.0",
"gsap": "3.12.5",
"is-mobile": "4.0.0",
"lucide-react": "0.436.0",
"mipd": "0.0.7",
"nprogress": "0.2.0",
"qrcode.react": "3.1.0",
Expand All @@ -69,7 +70,6 @@
"react-fast-marquee": "1.6.4",
"react-helmet": "6.1.0",
"react-hook-form": "7.51.5",
"react-icons": "5.2.1",
"react-player": "2.16.0",
"react-redux": "9.1.2",
"react-router-dom": "6.23.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App/Footer/Newsletter/SubscriptionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function SubscriptionForm() {
function SuccessMessage() {
return (
<span className="flex gap-1 w-full text-xs">
<Icon type="Check" />
<Icon type="Check" size={14} />
<p>
The form was sent successfully. By doing so, you have agreed to our
privacy policy
Expand Down
2 changes: 1 addition & 1 deletion src/App/Header/NavDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function NavDropdown({ links }: Props) {
/>
<Icon
type="ChevronDown"
size={24}
size={20}
className="text-blue-d7 data-[open]:text-blue-d7/70 max-sm:hidden transition duration-150 ease-in-out group-hover:text-blue-d7/80"
aria-hidden="true"
/>
Expand Down
6 changes: 3 additions & 3 deletions src/App/Header/UserMenu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Menu({ user, signOut, classes }: Props) {
to={`${appRoutes.user_dashboard}/donations`}
className=" hover:text-blue-d1 text-sm flex items-center gap-2"
>
<Icon type="Money" className="text-lg" />
<Icon type="DollarCircle" size={18} />
<span>My Donations</span>
</MenuItem>
<Organizations userId={user.email} classes="mt-6" />
Expand All @@ -37,7 +37,7 @@ export default function Menu({ user, signOut, classes }: Props) {
to={appRoutes.applications}
className="hover:text-blue-d1 text-sm flex items-center gap-1"
>
<Icon type="SecurityScan" size={22} />
<Icon type="SecurityScan" size={18} />
<span>Applications Dashboard</span>
</MenuItem>
)}
Expand All @@ -47,7 +47,7 @@ export default function Menu({ user, signOut, classes }: Props) {
to={appRoutes.banking_applications}
className="hover:text-blue-d1 text-sm flex items-center gap-1 mt-1"
>
<Icon type="SecurityScan" size={22} />
<Icon type="SecurityScan" size={18} />
<span>Banking applications</span>
</MenuItem>
)}
Expand Down
10 changes: 6 additions & 4 deletions src/components/BookmarkBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ export default function BookmarkBtn({
aria-label="Add to favorites button"
onClick={toogleBookmark}
disabled={isBookmarksLoading || isTogglingBookmark}
className={`flex items-center gap-1 disabled:text-gray-l4 ${
isBookmarked ? "text-red" : ""
} ${classes}`}
className={`flex items-center gap-1 disabled:text-gray-l4 ${classes}`}
>
<Icon type={isBookmarked ? "HeartFill" : "HeartOutline"} size={20} />
<Icon
type="Heart"
size={19}
className={isBookmarked ? "fill-red text-red" : ""}
/>
{children}
</button>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Copier/Copier.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ describe("Copier component test:", () => {
);

// Expects the button to change appearance once clicked
expect(await screen.findByTitle("Copied!")).toBeInTheDocument();
expect(await screen.findByLabelText(/copied/i)).toBeInTheDocument();

// Expects the button to revert back to it's original appearance
expect(await screen.findByTitle("Copy Address")).toBeInTheDocument();
expect(await screen.findByLabelText(/copy address/i)).toBeInTheDocument();
});
});
16 changes: 13 additions & 3 deletions src/components/Copier/Copier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,32 @@ export default function Copier({ text, classes, size, children }: Props) {
const { handleCopy, copied } = useCopier(text);
const { container, icon } = unpack(classes);
return (
<button className={container} type="button" onClick={handleCopy}>
<button
className={container + " relative"}
type="button"
onClick={handleCopy}
>
{(copied && (
<Icon
type="Check"
className={`${icon} cursor-default hover:text-current`}
title="Copied!"
size={size?.check}
aria-labelledby="copied"
/>
)) || (
<Icon
type="Copy"
className={`${icon} cursor-pointer`}
title="Copy Address"
size={size?.copy}
aria-labelledby="copy"
/>
)}
<span id="copied" className="invisible absolute">
Copied!
</span>
<span id="copy" className="invisible absolute">
Copy Address
</span>
{children}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/CountrySelector/CountrySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function CountrySelector<
</span>

<ComboboxButton>
{({ open }) => <DrawerIcon isOpen={open} size={25} className="mr-1" />}
{({ open }) => <DrawerIcon isOpen={open} size={20} className="mr-1" />}
</ComboboxButton>

<ComboboxInput
Expand Down
2 changes: 1 addition & 1 deletion src/components/CurrencySelector/CurrencySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function CurrencySelector<T extends CurrencyOption>({
) : (
<DrawerIcon
isOpen={open}
size={25}
size={20}
className={`${isCurrencyError ? "text-red" : ""}`}
aria-hidden
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DonateMethods/DonateMethods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Method({
onPointerDown={(e) => controls.start(e)}
disabled={value.disabled}
>
<Icon type="Drag" />
<Icon type="Drag" size={20} />
</button>

<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileDropzone/DropzoneText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function DropzoneText({
if (isFilesEmpty && isPreviewsEmpty) {
return (
<div className="grid justify-items-center text-sm text-navy-l1 dark:text-navy-l2 select-none">
<Icon type="FileUpload" size={24} className="mb-[1.125rem]" />
<Icon type="Upload" size={20} className="mb-[1.125rem]" />
<p className="font-semibold mb-1">Upload file</p>
<span>Click to Browse or Drag &amp; Drop</span>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/HeaderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export function HeaderButton<T>(
type={
_activeSortKey === _sortKey
? _sortDirection === "asc"
? "Up"
: "Down"
: "Unsorted"
? "ChevronUp"
: "ChevronDown"
: "ChevronsUpDown"
}
className={`w-4 h-4 shrink-0 ${
_activeSortKey === _sortKey
Expand Down
4 changes: 2 additions & 2 deletions src/components/Icon/DrawerIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { IconBaseProps } from "react-icons";
import type { LucideProps } from "lucide-react";
import Icon from "./Icon";

export function DrawerIcon({
isOpen,
className,
...props
}: IconBaseProps & { isOpen: boolean }) {
}: LucideProps & { isOpen: boolean }) {
return (
<Icon
{...props}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IconBaseProps } from "react-icons";
import type { LucideProps } from "lucide-react";
import { type IconType, icons } from "./icons";

interface IconProps extends IconBaseProps {
interface IconProps extends LucideProps {
type: IconType;
}

Expand Down
Loading

0 comments on commit 618f912

Please sign in to comment.