Skip to content

Commit

Permalink
core: playground eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Sep 19, 2022
1 parent c3812de commit 40a7fc4
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 65 deletions.
4 changes: 2 additions & 2 deletions apps/nuxt-playground/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
autoprefixer: {}
}
}
4 changes: 2 additions & 2 deletions apps/nuxt-playground/src/components/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ILink } from '~/types'
defineProps({
link: {
type: Object as () => ILink,
required: true,
},
required: true
}
})
</script>

Expand Down
12 changes: 7 additions & 5 deletions apps/nuxt-playground/src/components/starter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@ const lists = computed<ILink[]>(() => [
{ id: 1, title: t('modal'), url: 'modal', icon: 'i-carbon-collapse-all' },
{ id: 1, title: 'Menu', url: 'menu', icon: 'i-carbon-menu' },
{ id: 1, title: 'Naive UI', url: 'naive', icon: 'i-carbon-milestone' },
{ id: 1, title: 'New soon...', url: '', icon: 'i-carbon-milestone' },
{ id: 1, title: 'New soon...', url: '', icon: 'i-carbon-milestone' }
])
</script>

<template>
<div class="mx-auto mt-4 max-w-sm">
<div class="mb-10 flex items-center justify-between">
<a target="_blank" href="https://productdevbook.com">productdevbook.com</a>
<a target="_blank" href="https://productdevbook.com"
>productdevbook.com</a
>
<div class="flex space-x-2">
<TemLanguageChange />
<TemColorChange />
</div>
</div>
<div class="flex flex-col">
<h1>{{ t("follow") }}</h1>
<h1>{{ t('follow') }}</h1>
<div class="flex w-full items-center justify-between py-2">
<img
class="h-20 w-20 rounded-full"
height="160"
width="160"
src="https://avatars.githubusercontent.com/u/38668796?v=4"
alt="productdevbook"
>
/>

<div
class="place-items-centerr grid grid-cols-3 justify-items-center gap-4 [&>*]:flex [&>*]:items-center [&>*]:justify-center [&>*]:rounded-md [&>*]:bg-gray-100 [&>*]:p-3 dark:[&>*]:bg-gray-600"
Expand Down Expand Up @@ -68,7 +70,7 @@ const lists = computed<ILink[]>(() => [
id: item.id,
title: item.title,
url: item.url,
icon: item.icon,
icon: item.icon
}"
/>
</li>
Expand Down
16 changes: 7 additions & 9 deletions apps/nuxt-playground/src/components/tem/ColorChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ import {
ListboxButton,
ListboxLabel,
ListboxOption,
ListboxOptions,
ListboxOptions
} from '@headlessui/vue'
const colorMode = useColorMode()
const availableColor = ref([
{
id: 1,
name: 'system',
icon: 'i-ph-laptop-duotone',
icon: 'i-ph-laptop-duotone'
},
{
id: 2,
name: 'dark',
icon: 'i-ph-moon-stars-duotone',
icon: 'i-ph-moon-stars-duotone'
},
{
id: 3,
name: 'light',
icon: 'i-ph-sun-dim-duotone',
},
icon: 'i-ph-sun-dim-duotone'
}
])
</script>

Expand All @@ -33,9 +33,7 @@ const availableColor = ref([
as="div"
class="relative flex items-center"
>
<ListboxLabel class="sr-only">
Theme
</ListboxLabel>
<ListboxLabel class="sr-only"> Theme </ListboxLabel>
<ListboxButton type="button" title="Change Color">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
Expand All @@ -55,7 +53,7 @@ const availableColor = ref([
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
colorMode.preference === color.name,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
colorMode.preference !== color.name,
colorMode.preference !== color.name
}"
>
<span class="truncate">
Expand Down
9 changes: 4 additions & 5 deletions apps/nuxt-playground/src/components/tem/LanguageChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {
ListboxButton,
ListboxLabel,
ListboxOption,
ListboxOptions,
ListboxOptions
} from '@headlessui/vue'
import { useI18n } from 'vue-i18n'
import { availableLocales } from '~/locales/availableLocales'
const { locale } = useI18n()
Expand All @@ -24,9 +25,7 @@ watch(localeUserSetting, () => {
as="div"
class="relative flex items-center"
>
<ListboxLabel class="sr-only">
Theme
</ListboxLabel>
<ListboxLabel class="sr-only"> Theme </ListboxLabel>
<ListboxButton type="button" title="Change Language">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
Expand All @@ -46,7 +45,7 @@ watch(localeUserSetting, () => {
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
localeUserSetting === lang.iso,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
localeUserSetting !== lang.iso,
localeUserSetting !== lang.iso
}"
>
<span class="truncate">
Expand Down
2 changes: 1 addition & 1 deletion apps/nuxt-playground/src/composables/useLang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { useI18n } from 'vue-i18n'
export const useLang = () => {
const { t } = useI18n()
return {
t,
t
}
}
6 changes: 3 additions & 3 deletions apps/nuxt-playground/src/locales/availableLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export const availableLocales: ILocales = {
en: {
name: 'English',
iso: 'en-US',
flag: 'i-twemoji-flag-us-outlying-islands',
flag: 'i-twemoji-flag-us-outlying-islands'
},
tr: {
name: 'Turkce',
iso: 'tr-TR',
flag: 'i-twemoji-flag-turkey',
},
flag: 'i-twemoji-flag-turkey'
}
}
10 changes: 5 additions & 5 deletions apps/nuxt-playground/src/pages/menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
<button
class="group flex w-full items-center rounded-md px-2 py-2 text-sm"
:class="[
active ? 'bg-violet-500 text-white' : 'text-gray-900',
active ? 'bg-violet-500 text-white' : 'text-gray-900'
]"
>
<UnoIcon
Expand All @@ -46,7 +46,7 @@ import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
<button
class="group flex w-full items-center rounded-md px-2 py-2 text-sm"
:class="[
active ? 'bg-violet-500 text-white' : 'text-gray-900',
active ? 'bg-violet-500 text-white' : 'text-gray-900'
]"
>
<UnoIcon
Expand All @@ -61,7 +61,7 @@ import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
<button
class="group flex w-full items-center rounded-md px-2 py-2 text-sm"
:class="[
active ? 'bg-violet-500 text-white' : 'text-gray-900',
active ? 'bg-violet-500 text-white' : 'text-gray-900'
]"
>
<UnoIcon
Expand All @@ -74,7 +74,7 @@ import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
<button
class="group flex w-full items-center rounded-md px-2 py-2 text-sm"
:class="[
active ? 'bg-violet-500 text-white' : 'text-gray-900',
active ? 'bg-violet-500 text-white' : 'text-gray-900'
]"
>
<UnoIcon
Expand All @@ -90,7 +90,7 @@ import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue'
<button
class="group flex w-full items-center rounded-md px-2 py-2 text-sm"
:class="[
active ? 'bg-violet-500 text-white' : 'text-gray-900',
active ? 'bg-violet-500 text-white' : 'text-gray-900'
]"
>
<UnoIcon
Expand Down
7 changes: 4 additions & 3 deletions apps/nuxt-playground/src/pages/modal.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
import { ref } from 'vue'
import {
Dialog,
DialogOverlay,
DialogTitle,
TransitionChild,
TransitionRoot,
TransitionRoot
} from '@headlessui/vue'
import { ref } from 'vue'
const open = ref(false)
</script>
Expand Down Expand Up @@ -43,7 +43,8 @@ const open = ref(false)
<span
class="hidden sm:inline-block sm:h-screen sm:align-middle"
aria-hidden="true"
>&#8203;</span>
>&#8203;</span
>
<TransitionChild
as="template"
enter="ease-out duration-300"
Expand Down
24 changes: 13 additions & 11 deletions apps/nuxt-playground/src/pages/naive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
import { darkTheme, lightTheme } from 'naive-ui'
const color = useColorMode()
const theme = computed(() => {
return color.preference === 'system' ? (color.value ? lightTheme : darkTheme) : color.value === 'light' ? lightTheme : darkTheme
return color.preference === 'system'
? color.value
? lightTheme
: darkTheme
: color.value === 'light'
? lightTheme
: darkTheme
})
const router = useRouter()
Expand All @@ -18,16 +24,16 @@ onUnmounted(() => {
<NGlobalStyle />
<div class="mx-auto mt-4 max-w-sm">
<div class="mb-10 flex items-center justify-between">
<a target="_blank" href="https://productdevbook.com">productdevbook.com</a>
<a target="_blank" href="https://productdevbook.com"
>productdevbook.com</a
>
<div class="flex space-x-2">
<TemLanguageChange />
<TemColorChange />
</div>
</div>
<div class="grid grid-cols-1 gap-6">
<NButton @click="router.push('/')">
Back Home
</NButton>
<NButton @click="router.push('/')"> Back Home </NButton>
<p>Nuxt module naive ui!</p>
<NButton>Default</NButton>
<NInput placeholder="NInput" />
Expand Down Expand Up @@ -71,16 +77,12 @@ onUnmounted(() => {
<NEmpty />
<NEl>NEl</NEl>
<NGradientText>NGradientText</NGradientText>
<NH1 id="NH1">
H1
</NH1>
<NH1 id="NH1"> H1 </NH1>
<NHr />
<NA>NA</NA>
<NTag>NTag</NTag>
<NText>NText</NText>
<NBadge :value="999">
NBadge
</NBadge>
<NBadge :value="999"> NBadge </NBadge>
</div>
</div>
</NConfigProvider>
Expand Down
8 changes: 4 additions & 4 deletions apps/nuxt-playground/src/pages/pinia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const counter = useCounter()
<!-- Remove this component to get started! -->
<p>
N: {{ counter.n }}
<br>
<br />
myRef: {{ counter.myRef }}
</p>

<input v-model="counter.myRef" class="text-black" type="text">
<br>
<input v-model="counter.n" class="text-black" type="number">
<input v-model="counter.myRef" class="text-black" type="text" />
<br />
<input v-model="counter.n" class="text-black" type="number" />
</div>
<button class="global-text p-4" @click="counter.increment()">
+1 number click
Expand Down
8 changes: 4 additions & 4 deletions apps/nuxt-playground/src/store/counter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Ref, ref } from 'vue'
import { defineStore } from 'pinia'
import { Ref, ref } from 'vue'

interface CounterState {
n: number
Expand All @@ -9,11 +9,11 @@ interface CounterState {
export const useCounter = defineStore('counter', {
state: (): CounterState => ({
n: 5,
myRef: ref('hello'),
myRef: ref('hello')
}),
actions: {
increment() {
this.n++
},
},
}
}
})
2 changes: 1 addition & 1 deletion apps/nuxt-playground/src/utils/initApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export function InitApp() {
const language = languageController()

return {
language,
language
}
}
6 changes: 3 additions & 3 deletions apps/nuxt-playground/src/utils/languageController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useI18n } from 'vue-i18n'

import { availableLocales } from '../locales/availableLocales'

export function languageController() {
Expand All @@ -11,8 +12,7 @@ export function languageController() {
try {
const lang = window ? window.navigator.language : 'en-US'
return availableLocales[lang] ? lang : 'en-US'
}
catch (error) {
} catch (error) {
return 'en-US'
}
}
Expand All @@ -34,6 +34,6 @@ export function languageController() {

return {
systemi18n,
init,
init
}
}
14 changes: 7 additions & 7 deletions apps/nuxt-playground/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ module.exports = {
'./plugins/**/*.{js,ts}',
'./app.vue',
'./assets/**/*.scss',
'./assets/**/*.css',
'./assets/**/*.css'
],
theme: {
extend: {
fontFamily: {
sans: ['"Inter var"', ...defaultTheme.fontFamily.sans],
},
},
sans: ['"Inter var"', ...defaultTheme.fontFamily.sans]
}
}
},
variants: {
extend: {},
extend: {}
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('@tailwindcss/line-clamp'),
require('@tailwindcss/aspect-ratio'),
],
require('@tailwindcss/aspect-ratio')
]
}

0 comments on commit 40a7fc4

Please sign in to comment.