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

Fix the cut-off and text. #150

Merged
2 commits merged into from
Dec 1, 2023
Merged
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
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ccscan-frontend",
"description": "CCDScan frontend",
"version": "1.5.21",
"version": "1.5.22",
"engine": "16",
"type": "module",
"private": true,
Expand Down
29 changes: 12 additions & 17 deletions frontend/src/components/Staking/CommissionRates.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<template>
<Tooltip
<span
v-if="
props.nextPaydayCommission !== undefined &&
props.nextPaydayCommission !== null &&
props.nextPaydayCommission !== props.currentPaydayCommission
props.currentPaydayCommission === undefined ||
props.currentPaydayCommission === null
"
class="numerical"
>
{{ `${formatPercentage(props.nextPaydayCommission)}%` }}
</span>
<Tooltip
v-else-if="props.nextPaydayCommission !== props.currentPaydayCommission"
:text="`Rates will change to ${formatPercentage(
props.nextPaydayCommission
)}% on the next payday.`"
>
<span class="numerical change">
{{
props.currentPaydayCommission !== undefined &&
props.currentPaydayCommission !== null
? `${formatPercentage(props.currentPaydayCommission)}%`
: 'unknown'
}}
{{ `${formatPercentage(props.currentPaydayCommission)}%` }}
<ArrowUpIcon
v-if="
!props.currentPaydayCommission ||
Expand All @@ -28,12 +28,7 @@
</span>
</Tooltip>
<span v-else class="numerical">
{{
props.currentPaydayCommission !== undefined &&
props.currentPaydayCommission !== null
? `${formatPercentage(props.currentPaydayCommission)}%`
: 'unknown'
}}
{{ `${formatPercentage(props.currentPaydayCommission)}%` }}
</span>
</template>
<script lang="ts" setup>
Expand All @@ -45,7 +40,7 @@ import { formatPercentage } from '~/utils/format'

type Props = {
currentPaydayCommission: number | null
nextPaydayCommission: number | null
nextPaydayCommission: number
}
const props = defineProps<Props>()
</script>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/components/atoms/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ const handleOnMouseLeave = () => {
pointer-events: auto;
white-space: normal;
text-align: center;
width: 200px;
@media screen and (max-width: 640px) {
width: 150px;
}
}

/* Binding variables from a composable to a pseudo element does not work in Vue */
Expand Down