Skip to content

Commit

Permalink
Rename useTestUser
Browse files Browse the repository at this point in the history
  • Loading branch information
ccali11 committed Sep 12, 2023
1 parent 89d0058 commit 1db85e4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const totalWalletBalance = ref<BreakdownAmount>({
eth: '0 ETH'
})

export default function useTestUser() {
export default function useUser() {
async function addAccountToUser({ provider, address, currency }: { provider: string, address: string, currency: string}) {
const userAccountExists = user.value?.accounts?.some((account: Account | any) => account?.address === address && account?.walletProvider === provider && account?.currency === currency)
if (userAccountExists) return 'Account already exists for this user'
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/layouts/default-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import router from '@/composables/router'
import VueFeather from 'vue-feather'
import useFormat from '@/composables/format'
import useScreenDimensions from '@/composables/screenDimensions'
import useTestUser from '@/composables/testUser'
import useUser from '@/composables/testUser'
import { CryptoAddress, Currency, ProviderString } from '@casimir/types'
import useEthers from '@/composables/ethers'
import useLedger from '@/composables/ledger'
Expand Down Expand Up @@ -40,7 +40,7 @@ const {
addAccountToUser,
login,
logout,
} = useTestUser()
} = useUser()
function checkIfAddressIsUsed (account: CryptoAddress): boolean {
const { address } = account
Expand Down Expand Up @@ -487,4 +487,4 @@ onUnmounted(() =>{
height: 36px;
}
</style>
</style>@/composables/user
6 changes: 3 additions & 3 deletions apps/web/src/pages/operators/Operator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { ProviderString } from '@casimir/types'
import useContracts from '@/composables/contracts'
import useFiles from '@/composables/files'
import useFormat from '@/composables/format'
import useTestUser from '@/composables/testUser'
import useUser from '@/composables/testUser'
const { registerOperatorWithCasimir, loadingRegisteredOperators } = useContracts()
const { exportFile } = useFiles()
const { convertString } = useFormat()
const { user, nonregisteredOperators, registeredOperators, addOperator } = useTestUser()
const { user, nonregisteredOperators, registeredOperators, addOperator } = useUser()
// Form inputs
const selectedWallet = ref({address: '', wallet_provider: ''})
Expand Down Expand Up @@ -869,4 +869,4 @@ async function submitRegisterOperatorForm() {
letter-spacing: -0.03em;
color: #FFFFFF;
}
</style>@/composables/files
</style>@/composables/files@/composables/user
6 changes: 3 additions & 3 deletions apps/web/src/pages/overview/components/BreakdownChart.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts" setup>
import LineChartJS from '@/components/charts/LineChartJS.vue'
import { onMounted, ref, watch} from 'vue'
import useTestUser from '@/composables/testUser'
import useUser from '@/composables/testUser'
import useScreenDimensions from '@/composables/screenDimensions'
import { AnalyticsData, ProviderString } from '@casimir/types'
const { currentStaked, stakingRewards, totalWalletBalance, user, userAnalytics } = useTestUser()
const { currentStaked, stakingRewards, totalWalletBalance, user, userAnalytics } = useUser()
const { screenWidth } = useScreenDimensions()
const chardId = ref('cross_provider_chart')
Expand Down Expand Up @@ -329,4 +329,4 @@ watch(selectedTimeframe, () => {
font-size: 14px;
};
}
</style>
</style>@/composables/user
6 changes: 3 additions & 3 deletions apps/web/src/pages/overview/components/BreakdownTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ref, watch, onMounted } from 'vue'
import * as XLSX from 'xlsx'
import VueFeather from 'vue-feather'
import useTestUser from '@/composables/testUser'
import useUser from '@/composables/testUser'
import useFormat from '@/composables/format'
const { convertString } = useFormat()
Expand Down Expand Up @@ -116,7 +116,7 @@ const tableHeaderOptions = ref(
}
)
const { rawUserAnalytics, user } = useTestUser()
const { rawUserAnalytics, user } = useUser()
const tableData = ref({
Wallets: [] as {tx_hash: string, wallet_provider: string, status: string, staking_fees: string, type: string, amount: string, bal: string, act: string, date: string, blank_column: any, stk_amt: string, tx_type: string, stk_rwd: string }[],
Expand Down Expand Up @@ -847,4 +847,4 @@ onMounted(() =>{
box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.04);
border-radius: 3px;
}
</style>
</style>@/composables/user
6 changes: 3 additions & 3 deletions apps/web/src/pages/overview/components/Staking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import useContracts from '@/composables/contracts'
import useEthers from '@/composables/ethers'
import useFormat from '@/composables/format'
import usePrice from '@/composables/price'
import useTestUser from '@/composables/testUser'
import useUser from '@/composables/testUser'
import TermsOfService from '@/components/TermsOfService.vue'
const { deposit, getDepositFees, getUserStake } = useContracts()
const { getEthersBalance } = useEthers()
const { convertString } = useFormat()
const { getCurrentPrice } = usePrice()
const { user, updateUserAgreement } = useTestUser()
const { user, updateUserAgreement } = useUser()
// Staking Component Refs
const addressBalance = ref<string | null>(null)
Expand Down Expand Up @@ -576,4 +576,4 @@ const handleDeposit = async () => {
box-shadow: 0px 0px 0px 4px rgba(237, 235, 255, 0.26);
border-radius: 4px;
}
</style>
</style>@/composables/user

0 comments on commit 1db85e4

Please sign in to comment.