Skip to content

Commit

Permalink
fix: Fixed register form council
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed Mar 9, 2024
1 parent 28e7a8b commit 9706f7a
Showing 1 changed file with 26 additions and 43 deletions.
69 changes: 26 additions & 43 deletions src/views/UserView/UserView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,33 @@
</h1>
<div class="py-24">
<div class="mx-auto h-64 w-64 relative group">
<ProfilePicComponent
:src="state.img"
size="64"
alt="Profile pic"
/>
<ProfilePicComponent :src="state.img" size="64" alt="Profile pic" />
<button
v-if="state.userIsUser"
class="absolute top-0 left-0 right-0 bottom-0 m-auto w-10 invisible group-hover:visible"
@click="showChooseModal"
>
<img
:src="editImg"
alt="edit"
class="hover:drop-shadow-md"
>
<img :src="editImg" alt="edit" class="hover:drop-shadow-md" />
</button>
</div>
</div>
<UserViewHeadingContainer>
<template #heading>
Council status
</template>
<template #heading> Council status</template>
<template #body>
<p>{{ user.CouncilStatus }}</p>
<BaseCCButton
v-if="state.userIsUser"
:type="ButtonType.YELLOW"
@click="
state.user.CouncilStatus == CouncilStatus.unavailable
CouncilStatus[state.user.CouncilStatus] ==
CouncilStatus.unavailable
? register()
: deRegister()
"
>
{{
state.user.CouncilStatus == CouncilStatus.unavailable
CouncilStatus[state.user.CouncilStatus] ==
CouncilStatus.unavailable
? "Register for"
: "Deregister from"
}}
Expand All @@ -67,23 +59,21 @@
</h1>
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-16">
<UserViewHeadingContainer>
<template #heading>
Wallet
</template>
<template #heading> Wallet</template>
<template #body>
<b>Address</b> <br>{{ state.addr }}<br>
<br>
<b>Alias</b> <br>{{ state.user.alias }}
<b>Address</b> <br />{{ state.addr }}<br />
<br />
<b>Alias</b> <br />{{ state.user.alias }}
</template>
</UserViewHeadingContainer>
<UserViewHeadingContainer>
<template #heading>
My Cards
</template>
<template #heading> My Cards</template>
<template #body>
<b>{{ state.user.ownedCardSchemes.length }} Card Frame{{
state.user.ownedCardSchemes.length == 1 ? "" : "s"
}}</b>
<b
>{{ state.user.ownedCardSchemes.length }} Card Frame{{
state.user.ownedCardSchemes.length == 1 ? "" : "s"
}}</b
>
<div
v-for="[arr, name] in [
[state.user.ownedCardSchemes, 'Master Card'],
Expand All @@ -92,8 +82,10 @@
class="pb-6"
>
<p class="pb-3">
<b>{{ arr.length }} {{ name
}}{{ arr.length == 1 ? "" : "s" }}</b>
<b
>{{ arr.length }} {{ name
}}{{ arr.length == 1 ? "" : "s" }}</b
>
</p>
<RouterCCButton
:type="ButtonType.YELLOW"
Expand All @@ -108,37 +100,28 @@
</template>
</UserViewHeadingContainer>
<UserViewHeadingContainer>
<template #heading>
Recent Activity
</template>
<template #heading> Recent Activity</template>
<template #body>
<RouterCCButton
:type="ButtonType.YELLOW"
:to="{ name: 'Vote' }"
>
<RouterCCButton :type="ButtonType.YELLOW" :to="{ name: 'Vote' }">
Go to Voting
</RouterCCButton>
</template>
</UserViewHeadingContainer>
</div>
<UserViewHeadingContainer class="pt-8">
<template #heading>
Play History
</template>
<template #heading> Play History</template>
<template #body>
<div class="grid gap-8 md:grid-cols-4">
<UserViewHeadingContainer
v-for="(match, key) in state.matches"
:key="key"
>
<template #heading>
Match {{ key }}
</template>
<template #heading> Match {{ key }}</template>
<template #body>
{{
(match.playerA.addr == state.addr &&
match.outcome == "AWon") ||
(match.playerB.addr == state.addr && match.outcome == "BWon")
(match.playerB.addr == state.addr && match.outcome == "BWon")
? "WIN"
: "LOSE"
}}
Expand Down

0 comments on commit 9706f7a

Please sign in to comment.