Skip to content

Commit

Permalink
add some subs
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Jun 13, 2024
1 parent b995a7d commit dbd606e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
48 changes: 48 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"clsx": "^2.1.1",
"date-fns": "^3.6.0",
"dexie": "^4.0.7",
Expand Down
1 change: 1 addition & 0 deletions src/subscriptions/components/subscription-upsert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const SubscriptionUpsert = memo(() => {
{...register('price', { required: true })}
placeholder="Price"
type="number"
step=".01"
autoComplete="off"
/>
</FormLabel>
Expand Down
19 changes: 19 additions & 0 deletions src/subscriptions/models/subscription.model.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { preprocessNullableValue } from '@/form/utils/preprocess-nullable-value.ts';
import { cn } from '@/ui/utils/cn.ts';
import { faHouse } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { ReactElement } from 'react';
import GitHub from 'simple-icons/icons/github.svg?react';
import GoDaddy from 'simple-icons/icons/godaddy.svg?react';
import HeadSpace from 'simple-icons/icons/headspace.svg?react';
import JetBrains from 'simple-icons/icons/jetbrains.svg?react';
import Netflix from 'simple-icons/icons/netflix.svg?react';
import Telegram from 'simple-icons/icons/telegram.svg?react';
Expand All @@ -14,6 +18,9 @@ export const subscriptionIcons = [
'jetbrains',
'github',
'youtube',
'home',
'headspace',
'godaddy',
] as const;
export type SubscriptionIcon = (typeof subscriptionIcons)[number];

Expand All @@ -23,6 +30,15 @@ export const subscriptionIconToSvg = {
jetbrains: <JetBrains className={cn(`fill-[#000000]`)} />,
github: <GitHub className={cn(`fill-[#181717]`)} />,
youtube: <YouTube className={cn(`fill-[#FF0000]`)} />,
home: (
<FontAwesomeIcon
size="2xl"
icon={faHouse}
color="#000000"
/>
),
headspace: <HeadSpace className={cn(`fill-[#F47D31]`)} />,
godaddy: <GoDaddy className={cn(`fill-[#1BDBDB]`)} />,
} as const satisfies Record<SubscriptionIcon, ReactElement>;

export const subscriptionIconToLabel = {
Expand All @@ -31,6 +47,9 @@ export const subscriptionIconToLabel = {
jetbrains: 'JetBrains',
github: 'GitHub',
youtube: 'YouTube',
home: 'Home',
headspace: 'HeadSpace',
godaddy: 'GoDaddy',
} as const satisfies Record<SubscriptionIcon, string>;

export const subscriptionCyclePeriods = ['monthly', 'yearly'] as const;
Expand Down

0 comments on commit dbd606e

Please sign in to comment.