diff --git a/app/(homescreens)/add-cards/predefined-companies-list.tsx b/app/(homescreens)/add-cards/predefined-companies-list.tsx index 66f6af7..c73b05b 100644 --- a/app/(homescreens)/add-cards/predefined-companies-list.tsx +++ b/app/(homescreens)/add-cards/predefined-companies-list.tsx @@ -3,6 +3,7 @@ import { getNameFilter } from '@/app/lib/filters'; import { predefinedCompanies } from '@/app/lib/predefined-companies'; import { Routes } from '@/app/lib/shared'; +import { sortAlphabetically } from '@/app/lib/sorts'; import Image from 'next/image'; import Link from 'next/link'; import { useSearchParams } from 'next/navigation'; @@ -16,20 +17,28 @@ export function PredefinedCompaniesList() { : predefinedCompanies; return ( ); } diff --git a/app/(homescreens)/my-cards/my-cards-page.tsx b/app/(homescreens)/my-cards/my-cards-page.tsx index f1b8a5e..0136bd7 100644 --- a/app/(homescreens)/my-cards/my-cards-page.tsx +++ b/app/(homescreens)/my-cards/my-cards-page.tsx @@ -1,6 +1,7 @@ 'use client'; import { CardsList } from '@/app/(homescreens)/my-cards/cards-list'; +import { sortAlphabetically } from '@/app/lib/sorts'; import { AppActionTypes, AppState, @@ -96,7 +97,12 @@ export default function MyCardsPage() { description="No cards found for given filter. Adjust your filter to see other cards." /> ) : ( - + + sortAlphabetically(nameA, nameB) + )} + dispatch={dispatch} + /> )} ); diff --git a/app/lib/predefined-companies.ts b/app/lib/predefined-companies.ts index ae57b18..bbbb5b7 100644 --- a/app/lib/predefined-companies.ts +++ b/app/lib/predefined-companies.ts @@ -80,22 +80,6 @@ export const predefinedCompanies: { height: 2500, }, }, - { - name: 'O2', - svg: { - src: '/company-logos/o2.svg', - width: 2500, - height: 2500, - }, - }, - { - name: 'Rossmann', - svg: { - src: '/company-logos/rossmann.svg', - width: 116.6, - height: 14.3, - }, - }, { name: 'Tesco', svg: { diff --git a/app/lib/shared.ts b/app/lib/shared.ts index 35baed4..894126e 100644 --- a/app/lib/shared.ts +++ b/app/lib/shared.ts @@ -14,6 +14,7 @@ import { IconPaperclip, IconPaw, IconPlane, + IconShirt, IconShoppingCart, IconTheater, IconTicket, @@ -56,14 +57,16 @@ export enum CardIcon { Office = 'Office', Gaming = 'Gaming', Entertainment = 'Entertainment', + Clothes = 'Clothes', } export const iconsMap = { [CardIcon.Grocery]: IconShoppingCart, + [CardIcon.Clothes]: IconShirt, [CardIcon.Retail]: IconPaperBag, [CardIcon.Pharmacy]: IconFirstAidKit, - [CardIcon.Gas]: IconGasStation, [CardIcon.Restaurant]: IconToolsKitchen2, [CardIcon.Cafes]: IconCoffee, + [CardIcon.Gas]: IconGasStation, [CardIcon.Accommodation]: IconBed, [CardIcon.Airlines]: IconPlane, [CardIcon.Car]: IconCar, diff --git a/app/lib/sorts.ts b/app/lib/sorts.ts new file mode 100644 index 0000000..cdc4ce0 --- /dev/null +++ b/app/lib/sorts.ts @@ -0,0 +1,3 @@ +export function sortAlphabetically(a: string, b: string): number { + return a.toLocaleLowerCase() > b.toLocaleLowerCase() ? 1 : -1; +} diff --git a/app/ui/dropdown-field.tsx b/app/ui/dropdown-field.tsx index e695051..7249c72 100644 --- a/app/ui/dropdown-field.tsx +++ b/app/ui/dropdown-field.tsx @@ -49,11 +49,11 @@ export function DropdownField({ {label}
-
+
{currentOption ? currentOption.label : ''}
diff --git a/public/company-logos/o2.svg b/public/company-logos/o2.svg deleted file mode 100644 index 6ce3c13..0000000 --- a/public/company-logos/o2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/company-logos/rossmann.svg b/public/company-logos/rossmann.svg deleted file mode 100644 index f9f9927..0000000 --- a/public/company-logos/rossmann.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - -