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

refactor: remove dead code #34

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
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