Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Curnow JamieCurnow

View GitHub Profile
@JamieCurnow
JamieCurnow / firestore.ts
Last active Mar 20, 2021
Using Firestore with Typescript - including update helper
View firestore.ts
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-more-typescript-8058b6a88674
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Here's the helper type for paths:
type PathImpl<T, K extends keyof T> =
@JamieCurnow
JamieCurnow / firestore.ts
Created Dec 8, 2020
Using Firestore with Typescript - no examples
View firestore.ts
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
@JamieCurnow
JamieCurnow / firestore.ts
Last active May 5, 2021
Using Firestore with Typescript
View firestore.ts
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
View nuxt.config.js
build: {
extractCSS: false,
extend (config, {isDev}) {
if (isDev && process.client) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
View app.scss
// NativeScript core theme
// @see https://docs.nativescript.org/ui/theme
@import '~nativescript-theme-core/scss/light';
// Override variables here
@import '~nativescript-theme-core/scss/index';
// Global SCSS styling
// @see https://docs.nativescript.org/ui/styling
View drawerContent.vue
<template lang="html">
<ScrollView>
<StackLayout width="100%">
<Label class="drawer-header" text="Drawer"/>
<Label
v-for="(page, i) in pages"
@tap="goToPage(page.component)"
class="drawer-item"
:text="page.name"
View main.js
import Vue from 'nativescript-vue'
import routes from '~/router'
import store from '~/store'
import sideDrawer from '~/components/sideDrawer'
import drawerContent from '~/components/drawerContent'
// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = (TNS_ENV === 'production')
Vue.registerElement('RadSideDrawer', () => require('nativescript-ui-sidedrawer').RadSideDrawer)
View drawerContent.vue
<template lang="html">
<ScrollView>
<StackLayout width="100%">
<Label
v-for="(page, i) in pages"
@tap="goToPage(page.component)"
verticalAlignment="center"
width="95%"
height="50"
color="#000000"
View drawerContent.vue
<template lang="html">
<ScrollView>
<StackLayout width="100%">
<Label
v-for="(page, i) in pages"
@tap="goToPage(page.component)"
verticalAlignment="center"
width="95%"
height="50"
color="#000000"
View drawerContent.vue
<template lang="html">
<ScrollView>
<StackLayout v-for="(page, i) in pages" @tap="goToPage(page.component)" width="100%" borderBottomWidth="2px" borderBottomColor="#2e2e2e" :key="i">
<Label verticalAlignment="center" width="100%" heigh="50" color="#000000" :text="page.name"/>
</StackLayout>
</ScrollView>
</template>
<script>
import sideDrawer from '~/mixins/sideDrawer'