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 nodemailer from 'nodemailer' | |
import Env from '@ioc:Adonis/Core/Env' | |
export const emailConfig = { | |
rootUrl: Env.getOrFail('PUBLIC_URL') as string, | |
service: Env.getOrFail('SMPT_SERVICE') as string, | |
user: Env.getOrFail('SMPT_USER') as string, | |
pass: Env.getOrFail('SMPT_PASSWORD') as string, | |
} |
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 * as AWS from 'aws-sdk' | |
import Env from '@ioc:Adonis/Core/Env' | |
import { v4 as uuid } from 'uuid' | |
import { ManagedUpload } from 'aws-sdk/clients/s3' | |
const AWS_BUCKET_NAME = Env.getOrFail('AWS_BUCKET_NAME') as string | |
const AWS_REGION = Env.getOrFail('AWS_REGION') as string | |
const AWS_SECRET_ACCESS_KEY = Env.getOrFail('AWS_SECRET_ACCESS_KEY') as string | |
const AWS_ACCESS_KEY_ID = Env.getOrFail('AWS_ACCESS_KEY_ID') as string |
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
<FormControl | |
{...otherProps} | |
variant="outlined" | |
fullWidth | |
> | |
<Field name={name}> | |
{({ input, meta: { touched, error, submitError } }) => ( | |
<Fragment> | |
<FormLabel>{label}</FormLabel> | |
{/* |
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 isInitialMount = useRef(true); | |
const [search, setSearch] = useState<string>(); | |
// https://stackoverflow.com/questions/55075604/react-hooks-useeffect-only-on-update | |
useEffect(() => { | |
let debounceFunc: NodeJS.Timeout; | |
if (isInitialMount.current) { | |
isInitialMount.current = false; | |
} else { |
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, { useState, useEffect } from 'react'; | |
import { Backdrop, CircularProgress, Typography, Box } from '@material-ui/core'; | |
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; | |
const useStyles = makeStyles((theme: Theme) => createStyles({ | |
backdrop: { | |
zIndex: theme.zIndex.drawer + 1, | |
background: '#0000001f', | |
}, | |
title: { |
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 'providers/message'; | |
import 'core-js/stable'; | |
import 'regenerator-runtime/runtime'; | |
import 'raf/polyfill'; | |
import 'scss/index.scss'; | |
import 'providers/sentry'; | |
import React from 'react'; | |
import { hydrate } from 'react-dom'; | |
import { Provider as ReduxProvider } from 'react-redux'; | |
import Providers from 'providers'; |
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
$font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
$font-family: "Poppins", $font-system; |
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
/* eslint-disable no-empty, no-param-reassign */ | |
import api from 'utils/api'; | |
const LS_SESSION = 'hasSession'; | |
export const startSession = () => window.localStorage.setItem(LS_SESSION, 'true'); | |
export const resetSession = () => window.localStorage.removeItem(LS_SESSION); | |
export const hasSession = (): boolean => { | |
const val = Boolean(window.localStorage.getItem(LS_SESSION)); |
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
/** Retrieve token cookie generated by backend */ | |
const [cookieCsrfToken] = document.cookie.split('; ').filter((v) => /^xsrf-token=/.test(v)); | |
const csrfToken = cookieCsrfToken.replace('xsrf-token=', ''); | |
const DEFAULT_API_BASE_URL = `${process.env.API_BASE_URL}/api`; | |
const API_BASE_URL = process.env.NODE_ENV === 'development' && process.env.API_BASE_URL | |
? DEFAULT_API_BASE_URL | |
: '/api'; | |
/** |
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 ReactGA, { EventArgs, TimingArgs } from 'react-ga'; | |
const GA_CODE = process.env.GA_TRACKING_CODE; | |
/** returns an initialized ReactGA instance */ | |
const initGA = () => ReactGA.initialize(GA_CODE); | |
/** | |
* Send page view | |
* @param page optional. Defaults to current browser URL |
NewerOlder