-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hide behind feature flag and fix email config
- Loading branch information
Showing
12 changed files
with
2,330 additions
and
1,858 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
module.exports = { | ||
'env': { | ||
'browser': true, | ||
'es2020': true, | ||
'node': true, | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
node: true, | ||
"jest/globals": true, | ||
}, | ||
'extends': [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'google', | ||
'prettier', | ||
'plugin:jest/recommended', | ||
'plugin:jest/style' | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"google", | ||
"prettier", | ||
"plugin:jest/recommended", | ||
"plugin:jest/style", | ||
], | ||
'parser': '@typescript-eslint/parser', | ||
'parserOptions': { | ||
'ecmaFeatures': { | ||
'jsx': true, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
'ecmaVersion': 11, | ||
'sourceType': 'module', | ||
ecmaVersion: 11, | ||
sourceType: "module", | ||
}, | ||
'plugins': [ | ||
'jest', | ||
'react', | ||
'@typescript-eslint', | ||
'prettier', | ||
], | ||
'rules': { | ||
plugins: ["jest", "react", "@typescript-eslint", "prettier"], | ||
rules: { | ||
"react/react-in-jsx-scope": "off", | ||
"require-jsdoc": "off", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"prettier/prettier": "error", | ||
"jest/no-export": "off" | ||
"jest/no-export": "off", | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Wraps NextAuth useSession but overriding the typing to include our custom fields. | ||
|
||
import { | ||
Session as NextAuthSession, | ||
useSession as nextAuthUseSession, | ||
} from "next-auth/client"; | ||
|
||
export type User = { | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
}; | ||
|
||
export interface Session extends NextAuthSession { | ||
user: User; | ||
} | ||
|
||
// Tricking typescript to believe that we know what we are doing. | ||
const useSession = (): [Session | null, boolean] => { | ||
const [session, loading] = nextAuthUseSession(); | ||
return [(session as unknown) as Session | null, loading]; | ||
}; | ||
|
||
export default useSession; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
setupFiles: ["./configureTestEnvironmentVariables.js"] | ||
}; | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
setupFiles: ["./configureTestEnvironmentVariables.js"], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/* eslint-disable spaced-comment */ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module.exports = { | ||
env: { | ||
PAGARME_ENC_KEY: process.env.PAGARME_ENC_KEY, | ||
ROLLOUT_API_KEY: process.env.ROLLOUT_API_KEY | ||
ROLLOUT_API_KEY: process.env.ROLLOUT_API_KEY, | ||
}, | ||
serverRuntimeConfig: { | ||
PROJECT_ROOT: __dirname | ||
} | ||
} | ||
PROJECT_ROOT: __dirname, | ||
}, | ||
}; |
Oops, something went wrong.