@visualizevalue/mint-app-base 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/styles/prose.css +1 -1
- package/app/assets/styles/variables/fonts.css +0 -1
- package/app/assets/styles/variables/ui.css +1 -1
- package/app/components/AppHeader.vue +25 -6
- package/app/components/Breadcrumbs.vue +6 -6
- package/app/components/Button/AddCollection.vue +1 -1
- package/app/components/Button/Profile/Discord.vue +1 -1
- package/app/components/Button.vue +8 -2
- package/app/components/Collection/OverviewCard.vue +6 -0
- package/app/components/GasPrice.client.vue +2 -4
- package/app/components/Icon.vue +21 -16
- package/app/components/MintGasPrice.client.vue +5 -2
- package/app/components/MintGasPricePopover.client.vue +1 -1
- package/app/components/MintToken.vue +1 -1
- package/app/components/Modal.vue +3 -1
- package/app/components/Profile/Header.client.vue +6 -3
- package/app/components/Token/MintTimeline.client.vue +1 -1
- package/app/components/Token/MintTimelineItem.vue +4 -0
- package/app/composables/gasPrice.ts +12 -8
- package/package.json +1 -1
- package/app/composables/darkMode.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<header>
|
|
2
|
+
<header class="app-header">
|
|
3
3
|
<ClientOnly>
|
|
4
4
|
<Breadcrumbs :items="breadcrumbs" />
|
|
5
5
|
|
|
@@ -41,6 +41,16 @@ const breadcrumbs = computed(() => {
|
|
|
41
41
|
})
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
|
+
<style>
|
|
45
|
+
:root {
|
|
46
|
+
--app-header-font-family: var(--ui-font-family);
|
|
47
|
+
--app-header-font-size: var(--ui-font-size);
|
|
48
|
+
--app-header-font-weight: var(--ui-font-weight);
|
|
49
|
+
--app-header-text-transform: var(--ui-text-transform);
|
|
50
|
+
--app-header-letter-spacing: var(--ui-letter-spacing);
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
53
|
+
|
|
44
54
|
<style scoped>
|
|
45
55
|
header {
|
|
46
56
|
height: var(--navbar-height);
|
|
@@ -50,6 +60,12 @@ header {
|
|
|
50
60
|
gap: var(--spacer);
|
|
51
61
|
padding: var(--size-3) var(--size-6);
|
|
52
62
|
|
|
63
|
+
font-size: var(--app-header-font-size);
|
|
64
|
+
font-family: var(--app-header-font-family);
|
|
65
|
+
font-weight: var(--app-header-font-weight);
|
|
66
|
+
text-transform: var(--app-header-text-transform);
|
|
67
|
+
letter-spacing: var(--app-header-letter-spacing);
|
|
68
|
+
|
|
53
69
|
@media (--md) {
|
|
54
70
|
gap: var(--spacer-lg);
|
|
55
71
|
}
|
|
@@ -78,11 +94,14 @@ header {
|
|
|
78
94
|
}
|
|
79
95
|
}
|
|
80
96
|
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
:deep(> .button),
|
|
98
|
+
:deep(> button),
|
|
99
|
+
:deep(> a) {
|
|
100
|
+
font-size: inherit;
|
|
101
|
+
font-family: inherit;
|
|
102
|
+
font-weight: inherit;
|
|
103
|
+
text-transform: inherit;
|
|
104
|
+
letter-spacing: inherit;
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
107
|
</style>
|
|
@@ -16,14 +16,14 @@ defineProps({
|
|
|
16
16
|
<style>
|
|
17
17
|
:root {
|
|
18
18
|
--breadcrumb-nav-color: var(--muted);
|
|
19
|
-
--breadcrumb-nav-active-color: var(--
|
|
19
|
+
--breadcrumb-nav-active-color: var(--color);
|
|
20
20
|
--breadcrumb-separator-color: var(--muted);
|
|
21
21
|
|
|
22
|
-
--breadcrumb-font-family: var(--
|
|
23
|
-
--breadcrumb-font-size: var(--
|
|
24
|
-
--breadcrumb-font-font-weight: var(--
|
|
25
|
-
--breadcrumb-text-transform: var(--
|
|
26
|
-
--breadcrumb-letter-spacing: var(--
|
|
22
|
+
--breadcrumb-font-family: var(--app-header-font-family);
|
|
23
|
+
--breadcrumb-font-size: var(--app-header-font-size);
|
|
24
|
+
--breadcrumb-font-font-weight: var(--app-header-font-weight);
|
|
25
|
+
--breadcrumb-text-transform: var(--app-header-text-transform);
|
|
26
|
+
--breadcrumb-letter-spacing: var(--app-header-letter-spacing);
|
|
27
27
|
}
|
|
28
28
|
</style>
|
|
29
29
|
|
|
@@ -61,12 +61,18 @@ defineProps({
|
|
|
61
61
|
align-items: baseline;
|
|
62
62
|
height: inherit;
|
|
63
63
|
margin: 0 !important;
|
|
64
|
-
padding
|
|
65
|
-
|
|
64
|
+
padding: 0 calc(var(--ui-padding-x)/2) !important;
|
|
65
|
+
border: 0;
|
|
66
66
|
line-height: inherit;
|
|
67
|
+
color: var(--muted);
|
|
68
|
+
|
|
69
|
+
&:--highlight {
|
|
70
|
+
color: var(--color);
|
|
71
|
+
}
|
|
67
72
|
|
|
68
73
|
.icon {
|
|
69
74
|
align-self: center;
|
|
75
|
+
height: inherit;
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<span>{{ unitPrice.formatted.gwei }} GWEI</span>
|
|
4
|
-
</slot>
|
|
2
|
+
<span>{{ unitPrice.formatted.gwei }} GWEI</span>
|
|
5
3
|
</template>
|
|
6
4
|
|
|
7
5
|
<script setup>
|
|
8
|
-
const unitPrice =
|
|
6
|
+
const unitPrice = useGasPrice()
|
|
9
7
|
</script>
|
package/app/components/Icon.vue
CHANGED
|
@@ -10,22 +10,27 @@ const props = defineProps({
|
|
|
10
10
|
})
|
|
11
11
|
|
|
12
12
|
const ICONS = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
|
|
13
|
+
'add': '➕',
|
|
14
|
+
'check': '☑️',
|
|
15
|
+
'chevron-down': '⬇️',
|
|
16
|
+
'chevron-right': '➡️',
|
|
17
|
+
'chevron-up': '⬆️',
|
|
18
|
+
'close': '✖️',
|
|
19
|
+
'discord': '@',
|
|
20
|
+
'edit': '📝',
|
|
21
|
+
'email': '📧',
|
|
22
|
+
'folder': '📁',
|
|
23
|
+
'github': '@',
|
|
24
|
+
'home': '🏠',
|
|
25
|
+
'image': '🏞️',
|
|
26
|
+
'link': '🔗',
|
|
27
|
+
'loader': '⏳',
|
|
28
|
+
'times': '✖️',
|
|
29
|
+
'trash': '🗑️',
|
|
30
|
+
'twitter': '@',
|
|
31
|
+
'user': '👤',
|
|
32
|
+
'website': '🌐',
|
|
33
|
+
'withdraw': '💵',
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
const symbol = computed(() => ICONS[props.type])
|
|
@@ -14,7 +14,10 @@ const props = defineProps({
|
|
|
14
14
|
}
|
|
15
15
|
})
|
|
16
16
|
const mintCount = computed(() => props.mintCount)
|
|
17
|
-
const { price, displayPrice } =
|
|
17
|
+
const { price, displayPrice } = useMintPrice(mintCount)
|
|
18
18
|
const priceFeed = usePriceFeedStore()
|
|
19
|
-
const dollarPrice = computed(() =>
|
|
19
|
+
const dollarPrice = computed(() => {
|
|
20
|
+
const usd = priceFeed.weiToUSD(price.value)
|
|
21
|
+
return parseFloat(usd) > 0 ? usd : `<0.00`
|
|
22
|
+
})
|
|
20
23
|
</script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<template #content>
|
|
5
5
|
<div class="prose">
|
|
6
6
|
<h1>Mint Pricing</h1>
|
|
7
|
-
<p>Artifacts are priced based on the
|
|
7
|
+
<p>Artifacts are priced based on the Ethereum network fees at the time of collecting.</p>
|
|
8
8
|
<p>Network fees (Gas fees) are an essential component of of securing and running decentralized blockchains.</p>
|
|
9
9
|
<p>
|
|
10
10
|
The cost to store and secure the object on the network is mirrored as compensation to the artist,
|
|
@@ -59,7 +59,7 @@ const secondsRemaining = computed(() => blocksToSeconds(blocksRemaining.value))
|
|
|
59
59
|
const until = computed(() => nowInSeconds() + secondsRemaining.value)
|
|
60
60
|
|
|
61
61
|
const mintCount = computed(() => props.mintCount)
|
|
62
|
-
const { price, displayPrice } =
|
|
62
|
+
const { price, displayPrice } = useMintPrice(mintCount)
|
|
63
63
|
|
|
64
64
|
const mintRequest = computed(() => async () => {
|
|
65
65
|
const count = BigInt(props.mintCount)
|
package/app/components/Modal.vue
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<DialogFrame class="modal" :class="class" ref="dialog">
|
|
3
|
-
<button v-if="xClose" class="close" @click="$emit('close')"
|
|
3
|
+
<button v-if="xClose" class="close" @click="$emit('close')">
|
|
4
|
+
<Icon type="close" />
|
|
5
|
+
</button>
|
|
4
6
|
|
|
5
7
|
<slot />
|
|
6
8
|
</DialogFrame>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<header v-if="artist">
|
|
2
|
+
<header v-if="artist" class="profile-header">
|
|
3
3
|
<slot name="before" />
|
|
4
4
|
|
|
5
|
-
<img :src="artist.avatar || `/icons/opepen.svg`" :alt="name"
|
|
5
|
+
<img :src="artist.avatar || `/icons/opepen.svg`" :alt="name" />
|
|
6
6
|
<h1 @click="() => copy(address)">
|
|
7
7
|
<span>{{ name }}</span>
|
|
8
8
|
<small v-if="copied">copied...</small>
|
|
@@ -60,7 +60,10 @@ header {
|
|
|
60
60
|
|
|
61
61
|
small {
|
|
62
62
|
color: var(--muted);
|
|
63
|
-
font-size: var(--font-
|
|
63
|
+
font-size: var(--font-sm);
|
|
64
|
+
font-family: var(--ui-font-family);
|
|
65
|
+
letter-spacing: var(--ui-letter-spacing);
|
|
66
|
+
text-transform: var(--ui-text-transform);
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -5,16 +5,18 @@ import { useConfig, useBlockNumber } from '@wagmi/vue'
|
|
|
5
5
|
|
|
6
6
|
let priceWatcher: WatchStopHandle|null = null
|
|
7
7
|
const price: Ref<bigint> = ref(0n)
|
|
8
|
-
export const useGasPrice =
|
|
8
|
+
export const useGasPrice = () => {
|
|
9
9
|
const config = useConfig()
|
|
10
10
|
const { data: blockNumber } = useBlockNumber()
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const updatePrice = async () => {
|
|
13
|
+
price.value = await getGasPrice(config)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
if (
|
|
17
|
-
|
|
16
|
+
if (! priceWatcher) {
|
|
17
|
+
updatePrice()
|
|
18
|
+
|
|
19
|
+
priceWatcher = watch(blockNumber, () => updatePrice())
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const unitPrice = computed(() => ({
|
|
@@ -23,7 +25,7 @@ export const useGasPrice = async () => {
|
|
|
23
25
|
eth: formatEther(price.value as bigint),
|
|
24
26
|
|
|
25
27
|
formatted: {
|
|
26
|
-
gwei: price.value as bigint >
|
|
28
|
+
gwei: price.value as bigint > 2_000_000_000_000n
|
|
27
29
|
? roundNumber(formatGwei(price.value as bigint))
|
|
28
30
|
: toFloat(formatGwei(price.value as bigint), 1),
|
|
29
31
|
eth: formatEther(price.value as bigint),
|
|
@@ -33,8 +35,8 @@ export const useGasPrice = async () => {
|
|
|
33
35
|
return unitPrice
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
export const useMintPrice =
|
|
37
|
-
const gasPrice =
|
|
38
|
+
export const useMintPrice = (mintCount: Ref<number>) => {
|
|
39
|
+
const gasPrice = useGasPrice()
|
|
38
40
|
|
|
39
41
|
const price = computed(() => (gasPrice.value.wei || 0n) * 60_000n * BigInt(mintCount.value))
|
|
40
42
|
const displayPrice = computed(() => customFormatEther(price.value))
|
|
@@ -42,5 +44,7 @@ export const useMintPrice = async (mintCount: Ref<number>) => {
|
|
|
42
44
|
return {
|
|
43
45
|
price,
|
|
44
46
|
displayPrice,
|
|
47
|
+
gasPrice,
|
|
45
48
|
}
|
|
46
49
|
}
|
|
50
|
+
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const isDark = ref(localStorage.getItem('color-scheme') !== 'light')
|