Skip to content

Commit

Permalink
feat: ✨ add pinia and nuxt/image
Browse files Browse the repository at this point in the history
  • Loading branch information
CRBroughton committed Nov 1, 2023
1 parent 91dd5a1 commit 56293a0
Show file tree
Hide file tree
Showing 7 changed files with 786 additions and 257 deletions.
18 changes: 9 additions & 9 deletions components/GithubUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ const props = defineProps<{

<style scoped>
.user-wrapper {
margin-top: 50px;
display: flex;
flex-direction: column;
align-items: center;
gap: 1em;
margin-top: 50px;
display: flex;
flex-direction: column;
align-items: center;
gap: 1em;
}
p {
font-size: 24px;
font-size: 24px;
}
img {
width: 80px;
height: 80px;
border-radius: 50%;
width: 80px;
height: 80px;
border-radius: 50%;
}
</style>
7 changes: 6 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
export default defineNuxtConfig({
modules: [
'@sidebase/nuxt-auth',
'@nuxt/image',
'@nuxt/devtools',
'@nuxtjs/tailwindcss',
'@pinia/nuxt',
],
imports: {
dirs: ['./stores'],
},
build: { transpile: ['trpc-nuxt'] },
css: ['~/assets/css/main.css'],
postcss: {
Expand All @@ -25,7 +30,7 @@ export default defineNuxtConfig({
origin: process.env.AUTH_ORIGIN,
},
devtools: {
enabled: false,
enabled: true,
},
experimental: {
componentIslands: false,
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.6",
"@nuxt/image": "^1.0.0",
"@pinia/nuxt": "^0.5.1",
"@prisma/client": "4.14.1",
"@trpc/client": "^10.37.1",
"@trpc/server": "^10.37.1",
"@vueuse/core": "^10.5.0",
"next-auth": "4.22.1",
"pinia": "^2.1.7",
"superjson": "1.12.3",
"trpc-nuxt": "0.10.7",
"ts-pattern": "4.3.0",
Expand Down
10 changes: 4 additions & 6 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<script setup lang="ts">
import { store } from '~~/store'
const { users, getUsers } = store()
const usersStore = userStore()
const { status, data, signIn, signOut } = useAuth()
onMounted(async () => {
await getUsers()
onMounted(() => {
usersStore.getUsers()
})
async function signUserOut() {
Expand All @@ -19,7 +17,7 @@ async function signUserIn() {
</script>

<template>
{{ users }}
{{ usersStore.users }}
<Packages />
<button v-if="status === 'unauthenticated'" @click="signUserIn">
Sign in
Expand Down
Loading

0 comments on commit 56293a0

Please sign in to comment.