@visualizevalue/mint-app-base 0.1.4 → 0.1.5

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  > * {
22
22
  margin: var(--spacer-sm) 0;
23
- color: var(--muted);
23
+ color: var(--color);
24
24
 
25
25
  &:first-child {
26
26
  margin-top: 0;
@@ -2,7 +2,6 @@
2
2
 
3
3
  --rem: 16px;
4
4
  --font-base: var(--rem);
5
- --font-xs: calc(var(--font-base) * 0.8);
6
5
  --font-sm: calc(var(--font-base) * 0.8);
7
6
  --font-lg: calc(var(--font-base) * 1.2);
8
7
  --font-weight-light: 300;
@@ -1,7 +1,7 @@
1
1
  :root {
2
2
 
3
3
  --ui-font-family: var(--font-family);
4
- --ui-font-size: var(--font-sm);
4
+ --ui-font-size: var(--font-base);
5
5
  --ui-font-weight: var(--font-weight);
6
6
  --ui-text-transform: var(--text-transform);
7
7
  --ui-letter-spacing: var(--letter-spacing);
@@ -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
- .account {
82
- font-family: var(--ui-font-family);
83
- font-size: var(--ui-font-size);
84
- letter-spacing: var(--ui-letter-spacing);
85
- text-transform: var(--ui-text-transform);
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(--muted);
19
+ --breadcrumb-nav-active-color: var(--color);
20
20
  --breadcrumb-separator-color: var(--muted);
21
21
 
22
- --breadcrumb-font-family: var(--ui-font-family);
23
- --breadcrumb-font-size: var(--ui-font-size);
24
- --breadcrumb-font-font-weight: var(--ui-font-weight);
25
- --breadcrumb-text-transform: var(--ui-text-transform);
26
- --breadcrumb-letter-spacing: var(--ui-letter-spacing);
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
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <Button :to="{ name: `id-create`, params: { id } }">
3
- <Icon type="add"/>
3
+ <Icon type="add" />
4
4
  <span>Collection</span>
5
5
  </Button>
6
6
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <Button v-if="validateURI(profile.url)" :to="validateURI(profile.url)">
3
- <Icon type="website" />
3
+ <Icon type="discord" />
4
4
  {{ getMainDomain(profile.url) }}
5
5
  </Button>
6
6
  </template>
@@ -61,12 +61,18 @@ defineProps({
61
61
  align-items: baseline;
62
62
  height: inherit;
63
63
  margin: 0 !important;
64
- padding-top: 0;
65
- padding-bottom: 0;
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
- <slot :price="unitPrice">
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 = await useGasPrice()
6
+ const unitPrice = useGasPrice()
9
7
  </script>
@@ -10,22 +10,27 @@ const props = defineProps({
10
10
  })
11
11
 
12
12
  const ICONS = {
13
- home: '🜂',
14
- trash: '',
15
- times: '',
16
- close: '',
17
- folder: '',
18
- edit: '',
19
- check: '',
20
- add: '+',
21
- image: '+',
22
- link: '↗︎',
23
- user: '',
24
- loader: '',
25
- 'chevron-up': '',
26
- 'chevron-down': '',
27
- 'chevron-right': '',
28
- withdraw: 'Ξ',
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 } = await useMintPrice(mintCount)
17
+ const { price, displayPrice } = useMintPrice(mintCount)
18
18
  const priceFeed = usePriceFeedStore()
19
- const dollarPrice = computed(() => priceFeed.weiToUSD(price.value))
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 ethereum network fees at the time of collecting.</p>
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 } = await useMintPrice(mintCount)
62
+ const { price, displayPrice } = useMintPrice(mintCount)
63
63
 
64
64
  const mintRequest = computed(() => async () => {
65
65
  const count = BigInt(props.mintCount)
@@ -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')"><Icon type="close" /></button>
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-xs);
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
  }
@@ -70,7 +70,7 @@ h1 {
70
70
  margin-bottom: var(--spacer);
71
71
  font-size: var(--font-base);
72
72
  border-bottom: var(--border);
73
- padding: 0 0 var(--spacer-sm);
73
+ padding: 0 0 var(--spacer);
74
74
  margin: 0 0 var(--spacer);
75
75
  }
76
76
 
@@ -65,6 +65,10 @@ const formattedPrice = computed(() => customFormatEther(props.mint.price))
65
65
  .amount {
66
66
  text-align: right;
67
67
  }
68
+
69
+ span:not(.account) {
70
+ font-size: var(--font-base);
71
+ }
68
72
  }
69
73
  }
70
74
  </style>
@@ -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 = async () => {
8
+ export const useGasPrice = () => {
9
9
  const config = useConfig()
10
10
  const { data: blockNumber } = useBlockNumber()
11
11
 
12
- if (! priceWatcher) {
13
- priceWatcher = watch(blockNumber, async () => price.value = await getGasPrice(config))
12
+ const updatePrice = async () => {
13
+ price.value = await getGasPrice(config)
14
14
  }
15
15
 
16
- if (price.value === null && priceWatcher === null) {
17
- price.value = await getGasPrice(config)
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 > 20000000000n
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 = async (mintCount: Ref<number>) => {
37
- const gasPrice = await useGasPrice()
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- export const isDark = ref(localStorage.getItem('color-scheme') !== 'light')