Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Jan 23, 2024
1 parent 653c9b3 commit 22ed844
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 151 deletions.
50 changes: 0 additions & 50 deletions libs/client/features/src/user-billing/SubscriberGuard.tsx

This file was deleted.

1 change: 0 additions & 1 deletion libs/client/features/src/user-billing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './PlanSelector'
export * from './PremiumIcon'
export * from './UpgradePrompt'
export * from './UpgradeTakeover'
export * from './SubscriberGuard'
1 change: 0 additions & 1 deletion libs/client/shared/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export * from './useLocalStorage'
export * from './useLogger'
export * from './useQueryParam'
export * from './useScreenSize'
export * from './useAccountNotifications'
export * from './usePlaid'
export * from './useTeller'
export * from './useProviderStatus'
Expand Down
33 changes: 0 additions & 33 deletions libs/client/shared/src/hooks/useAccountNotifications.ts

This file was deleted.

48 changes: 0 additions & 48 deletions libs/client/shared/src/utils/browser-utils.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,7 @@
import type {
PlaidLinkError,
PlaidLinkOnEventMetadata,
PlaidLinkOnExitMetadata,
} from 'react-plaid-link'

export async function copyToClipboard(text: string) {
if ('clipboard' in navigator) {
return navigator.clipboard.writeText(text)
} else {
return document.execCommand('copy', true, text)
}
}

export function getLocalStorageSession<TData>(key: string, initialValue: TData) {
return {
getLocalStorageItem: () => {
if (typeof window === 'undefined') return initialValue

const item = window.localStorage.getItem(key)

return item ? (JSON.parse(item) as TData) : initialValue
},
setLocalStorageItem: (data: TData | ((data: TData) => TData)) => {
if (typeof window === 'undefined') return

const previousValue = window.localStorage.getItem(key)

const isFunc = data instanceof Function

window.localStorage.setItem(
key,
JSON.stringify(
isFunc ? data(previousValue ? JSON.parse(previousValue) : initialValue) : data
)
)
},
}
}

export function prepareSentryContext(
plaidMetadata: PlaidLinkOnExitMetadata | PlaidLinkOnEventMetadata,
plaidError?: PlaidLinkError | null
): { [key: string]: any } | undefined {
if (!plaidError && !plaidMetadata) return undefined

// The keys here will be the headers in Sentry context sections (hence the formatted spacing)
const errorContext = plaidError ? { 'Plaid Error': plaidError } : undefined
const metadataContext = plaidMetadata ? { 'Plaid Metadata': plaidMetadata } : undefined

return {
...errorContext,
...metadataContext,
}
}
17 changes: 0 additions & 17 deletions libs/shared/src/types/user-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
User as PrismaUser,
AuthUser,
} from '@prisma/client'
import type { Institution } from 'plaid'
import type { TimeSeries, TimeSeriesResponseWithDetail, Trend } from './general-types'
import type { DateTime } from 'luxon'

Expand Down Expand Up @@ -211,18 +210,6 @@ export type UserMemberCardDetails = {
imageUrl: string
}

export type RiskQuestionChoice = {
key: string
text: string
riskScore: number
}

export type RiskQuestion = {
key: string
text: string
choices: RiskQuestionChoice[]
}

export type RiskAnswer = {
questionKey: string
choiceKey: string
Expand Down Expand Up @@ -266,7 +253,3 @@ export type PlaidLinkUpdateMode = 'reconnect' | 'new-accounts'
export interface LinkConfig {
token: string
}

export type PublicTokenExchange = LinkConfig & {
institution: Institution
}
1 change: 0 additions & 1 deletion prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Institution, PrismaClient, Provider } from '@prisma/client'
import bcrypt from 'bcrypt'

const prisma = new PrismaClient()

Expand Down

0 comments on commit 22ed844

Please sign in to comment.