This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import Head from 'next/head' // or react-helmet | |
const SEO = () => { | |
// Fill this object with your data (from i18n / props / hooks / etc.) | |
const seo = { | |
name: 'Project Name', | |
title: 'Page title', | |
description: 'Page description', | |
image: 'path/to/page-social-image', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const toFixedN = ( | |
number: number | null | undefined, | |
fractionDigits = 8, | |
canBeNull = true, | |
): string => { | |
let num = number | |
// @ts-ignore | |
num = +num | |
if (isNaN(num)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const fs = require('fs') | |
function replaceAll(str, find, replace) { | |
return str.replace(new RegExp(find, 'g'), replace) | |
} | |
export const createSchemaCustomization = ({ actions, schema }) => { | |
const { createTypes } = actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/SignupConfig.php'; | |
use Directus\Application\Application; | |
use Directus\Application\Http\Request; | |
use Directus\Application\Http\Response; | |
use Directus\Authentication\Exception\ExpiredRequestTokenException; | |
use Directus\Authentication\Exception\InvalidTokenException; | |
use Directus\Util\JWTUtils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useScrollPosition } from '@n8tb1t/use-scroll-position' | |
import { useRef } from 'react' | |
import { get } from 'lodash' | |
export const useOnEndScroll = (onEnd: () => void, disabled: boolean = false) => { | |
const { body, documentElement } = document | |
const isTracking = useRef<boolean>(true) // To avoid repeated requests | |
const offsetFromBottom = 100 | |
useScrollPosition( |