Skip to content

Instantly share code, notes, and snippets.

View yoovanr's full-sized avatar

Artem Misiura yoovanr

  • Porto, Portugal
View GitHub Profile
@yoovanr
yoovanr / index.vue
Created July 23, 2021 10:46
[Vue] pages/settings/accounts/index.vue
<template>
<div class="accounts-staff">
<!-- top start -->
<div class="accounts-staff__top bottom-24">
<AppTitle
class="mb-0"
bold="Accounts & permissions"
/>
@yoovanr
yoovanr / account-users.js
Created July 23, 2021 10:45
[Vue] store/account-users.js
export const state = () => ({
accountUsers: [],
accountUsersLoading: false,
accountUsersTotalCount: 0,
accountUsersCurrentPage: 1,
accountUsersPerPage: 10,
accountUsersFilter: null,
accountUsersSearch: null,
@yoovanr
yoovanr / index.vue
Created July 23, 2021 10:44
[Vue] pages/sign-in/index.vue
<template>
<div class="SignIn">
<SignInForm />
</div>
</template>
<style lang="scss" scoped>
.SignIn {
position: relative;
padding: 90px 0;
@yoovanr
yoovanr / SignInForm.vue
Last active August 27, 2021 05:10
[Vue] components/SignInForm.vue
<template>
<form
class="SignInForm"
autocomplete="off"
@submit.prevent="login"
>
<!-- title start -->
<AppTitle bold="Sign in" />
@yoovanr
yoovanr / oauth.js
Created July 23, 2021 10:42
[Vue] store/oauth.js
export const state = () => ({
signinLoading: false,
logoutLoading: false,
})
export const getters = {
signinLoading: (state) => state.signinLoading,
logoutLoading: (state) => state.logoutLoading,
}
@yoovanr
yoovanr / meta-tags.js
Last active July 23, 2021 10:47
[Vue] helpers/meta-tags.js
const generateMetaTags = (params) => {
const metaTags = []
const validMetaTags = ['description']
validMetaTags.forEach((metaTag) => {
if (params[metaTag]) {
metaTags.push({
hid: `${metaTag}`,
name: `${metaTag}`,
content: params[metaTag],
// pages/index.js
import React, { useEffect } from 'react'
import CookiesUtils from '../utils/cookies'
const HomePage = () => {
useEffect(() => {
CookiesUtils.getItem('server-side-cookies') // Output: Aloha from server side cookies!
// pages/_app.js
import React from 'react'
import CookiesUtils from '../utils/cookies'
const App = () => {
// ...
}
// utils/cookies.js
import Cookies from 'cookies'
import cookieCutter from 'cookie-cutter'
// Default server side cookies instance
let serverSideCookiesInstance = null
// Set a new server side cookies instance
const setServerSideCookiesInstance = (ctx) => {
@yoovanr
yoovanr / instance.js
Created May 1, 2020 17:37
[React] Axios Instance Example
import { Alert } from 'react-native'
import axios from 'axios'
import SocketService from './socket'
import store, { actions } from '../store'
import config from '../config'