Skip to content

Commit

Permalink
fix(style): run format
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Aug 28, 2024
1 parent d771032 commit a41873d
Show file tree
Hide file tree
Showing 13 changed files with 41,534 additions and 30,143 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: pnpm format

- name: Run unit tests
run: pnpm test:unit
run: pnpm run test:unit

- name: Run build
run: pnpm build
Expand Down
33 changes: 27 additions & 6 deletions src/components/Footer/LicenseText.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
<template>
<div class="h-max self-center">
<p class="copyright max-w-100 footer-text">© <span>2018-{{ new Date().getFullYear() }}</span><contributorsText /></p>
<p class="copyright max-w-100 footer-text">
© <span>2018-{{ new Date().getFullYear() }}</span
><contributorsText />
</p>
<p class="copyright max-w-100 footer-text"><licenseText /></p>
</div>
</template>

<script setup lang="tsx">
const WITNET_FOUNDATION_URL = 'https://witnet.foundation'
const CREATIVE_COMMONS_URL = 'https://creativecommons.org/publicdomain/zero/1.0/'
const contributorsText = () => <span> by <a href={WITNET_FOUNDATION_URL} target="_blank">Witnet Foundation</a> and individual contributors.</span>
const licenseText = () => <span> Content available under a <a href={CREATIVE_COMMONS_URL} target="_blank">Creative Commons License</a>.</span>
const contributorsText = () => (
<span>
{' '}
by{' '}
<a href={WITNET_FOUNDATION_URL} target="_blank">
Witnet Foundation
</a>{' '}
and individual contributors.
</span>
)
const licenseText = () => (
<span>
{' '}
Content available under a{' '}
<a href={CREATIVE_COMMONS_URL} target="_blank">
Creative Commons License
</a>
.
</span>
)
defineProps({
customContributorsText: {
type: String,
required: false,
required: false
},
customLicenseText: {
type: String,
required: false,
required: false
}
})
</script>
</script>
70 changes: 69 additions & 1 deletion src/components/Footer/WFooter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,75 @@ import WFooter from './WFooter.vue'

describe('WFooter', () => {
it('renders properly', () => {
const wrapper = mount(WFooter)
const wrapper = mount(WFooter, {
props: {
footerSections: [
{
title: 'Developers',
links: [
{
url: '#reference',
label: 'reference'
},
{
url: '#randomness',
label: 'randomness'
},
{
url: '#randomness',
label: 'randomness'
},
{
url: '#supported_chains',
label: 'supported_chains'
},
{
url: '#solidity_sdk',
label: 'solidity_sdk'
}
]
},
{
title: 'Ecosystem',
links: [
{
url: '#block_explorer',
label: 'block_explorer'
},
{
url: '#data_feeds_explorer',
label: 'data_feeds_explorer'
},
{
url: '#sheikah',
label: 'sheikah'
},
{
url: '#my_wit_wallet',
label: 'my_wit_wallet'
}
]
},
{
title: 'Learn',
links: [
{
url: '#whitepaper',
label: 'whitepaper'
},
{
url: '#medium',
label: 'medium'
},
{
url: '#tutorials',
label: 'tutorials'
}
]
}
]
}
})

expect(wrapper).toMatchSnapshot()

Check failure on line 78 in src/components/Footer/WFooter.spec.ts

View workflow job for this annotation

GitHub Actions / cache-and-install

src/components/Footer/WFooter.spec.ts > WFooter > renders properly

Error: Snapshot `WFooter > renders properly 1` mismatched - Expected + Received @@ -640,11 +640,11 @@ "ADO_URL": "https://github.com/adoracles/", "AdoIcon": { "render": [Function], }, "LicenseText": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -656,11 +656,11 @@ }, "render": [Function], "setup": [Function], }, "WSection": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Section/WSection.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Section/WSection.vue", "__name": "WSection", "props": { "contentClasses": { "default": "", "type": [Function], @@ -918,11 +918,11 @@ "ADO_URL": "https://github.com/adoracles/", "AdoIcon": { "render": [Function], }, "LicenseText": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -934,11 +934,11 @@ }, "render": [Function], "setup": [Function], }, "WSection": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Section/WSection.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Section/WSection.vue", "__name": "WSection", "props": { "contentClasses": { "default": "", "type": [Function], @@ -9015,11 +9015,11 @@ "type": "div", }, "suspense": null, "suspenseId": 0, "type": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -9104,11 +9104,11 @@ "target": null, "targetAnchor": null, "targetStart": null, "transition": null, "type": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Functio

Check failure on line 78 in src/components/Footer/WFooter.spec.ts

View workflow job for this annotation

GitHub Actions / cache-and-install

src/components/Footer/WFooter.spec.ts > WFooter > renders properly

Error: Snapshot `WFooter > renders properly 1` mismatched - Expected + Received @@ -640,11 +640,11 @@ "ADO_URL": "https://github.com/adoracles/", "AdoIcon": { "render": [Function], }, "LicenseText": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -656,11 +656,11 @@ }, "render": [Function], "setup": [Function], }, "WSection": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Section/WSection.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Section/WSection.vue", "__name": "WSection", "props": { "contentClasses": { "default": "", "type": [Function], @@ -918,11 +918,11 @@ "ADO_URL": "https://github.com/adoracles/", "AdoIcon": { "render": [Function], }, "LicenseText": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -934,11 +934,11 @@ }, "render": [Function], "setup": [Function], }, "WSection": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Section/WSection.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Section/WSection.vue", "__name": "WSection", "props": { "contentClasses": { "default": "", "type": [Function], @@ -9015,11 +9015,11 @@ "type": "div", }, "suspense": null, "suspenseId": 0, "type": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Function], @@ -9104,11 +9104,11 @@ "target": null, "targetAnchor": null, "targetStart": null, "transition": null, "type": { - "__file": "/Users/gabaldon/Witnet/wit-vue-ui/src/components/Footer/LicenseText.vue", + "__file": "/home/runner/work/wit-vue-ui/wit-vue-ui/src/components/Footer/LicenseText.vue", "__name": "LicenseText", "props": { "customContributorsText": { "required": false, "type": [Functio
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer/WFooter.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export const Footer: Story = {
{
url: '#tutorials',
label: 'tutorials'
},
}
]
},
}
]
}
}
7 changes: 3 additions & 4 deletions src/components/Footer/WFooter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export type FooterSection = {
title: string,
title: string
links: FooterLink[]
}
export type FooterLink = { key: string
url: string,
export type FooterLink = {
url: string
label: string
}

38 changes: 16 additions & 22 deletions src/components/Footer/WFooter.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<WSection
:frame-classes="'bg-black-950'"
:content-classes="'grid justify-items-center'"
>
<WSection :frame-classes="'bg-black-950'" :content-classes="'grid justify-items-center'">
<template #content>
<div class="footer grid gap-xl">
<div class="grid grid-cols-[max-content_1fr] md:grid-cols-1 gap-3xl">
Expand All @@ -18,11 +15,7 @@
{{ section.title }}
</p>
<ul class="py-2 flex flex-col gap-sm">
<li
v-for="link in section.links"
:key="link.label"
class="link-list-item"
>
<li v-for="link in section.links" :key="link.label" class="link-list-item">
<a
class="link footer-text"
:href="link.url"
Expand All @@ -37,20 +30,22 @@
</div>
<div class="w-full grid gap-md xs:mt-lg">
<AdoIcon class="mb-2 w-[50px] h-auto" />
<p class="footer-text">{{ adoDescription }}<a
class="py-1 underline footer-text"
:href="ADO_URL"
target="_blank"
>
theado.org
</a></p>
<p class="footer-text">
{{ adoDescription
}}<a class="py-1 underline footer-text" :href="ADO_URL" target="_blank">
theado.org
</a>
</p>
</div>
</div>
<div
class="grid grid-cols-[max-content_max-content_1fr] sm:grid-cols-1 align-middle gap-lg pt-xl items-center"
>
<WitOracleIcon class="w-[140px] h-auto white" name="witnet_dark" />
<LicenseText :custom-contributors-text="customContributorsText" :custom-license-text="customLicenseText" />
<LicenseText
:custom-contributors-text="customContributorsText"
:custom-license-text="customLicenseText"
/>
<!-- <client-only>
<LanguageSwitcher class="justify-self-end self-center" />
</client-only> -->
Expand All @@ -73,20 +68,19 @@ const ADO_URL = 'https://github.com/adoracles/'
defineProps({
footerSections: {
type: Object as PropType<FooterSection[]>,
required: true,
required: true
},
adoDescription: {
type: String,
default: `Witnet is part of the Alliance of Decentralized Oracles (ADO), a joint effort by leading decentralized oracle solutions to make the life of smart contract developers easier by creating oracle standards. Learn more about the ADO at`,
default: `Witnet is part of the Alliance of Decentralized Oracles (ADO), a joint effort by leading decentralized oracle solutions to make the life of smart contract developers easier by creating oracle standards. Learn more about the ADO at`
},
customContributorsText: {
type: String,
required: false,
required: false
},
customLicenseText: {
type: String,
required: false,
required: false
}
})
</script>

Loading

0 comments on commit a41873d

Please sign in to comment.