generated from git-baboo/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from git-baboo/develop
本番リリース
- Loading branch information
Showing
34 changed files
with
2,538 additions
and
219 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
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,21 @@ | ||
name: Test | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14.x | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/yarn | ||
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | ||
restore-keys: ${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile --prefer-offline | ||
- name: Run test | ||
run: yarn test |
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,18 @@ | ||
module.exports = { | ||
testEnvironment: "jsdom", | ||
roots: ["<rootDir>/src"], | ||
transform: { | ||
"^.+\\.(ts|tsx)$": "ts-jest", | ||
}, | ||
globals: { | ||
"ts-jest": { | ||
tsconfig: "<rootDir>/tsconfig.jest.json", | ||
}, | ||
}, | ||
moduleDirectories: ["node_modules", "<rootDir>"], | ||
testPathIgnorePatterns: ["/node_modules", "<rootDir>/src/tests/testUtils"], | ||
moduleNameMapper: { | ||
"@/(.*)": "<rootDir>/src/$1", | ||
}, | ||
setupFilesAfterEnv: ["@testing-library/jest-dom"], | ||
}; |
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
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
import { User } from "firebase/auth"; | ||
import { createContext, useEffect, useState } from "react"; | ||
|
||
import { auth } from "@/utils/firebase"; | ||
|
||
type AuthContextProps = { | ||
currentUser: User | null | undefined; | ||
signInCheck: boolean; | ||
}; | ||
|
||
const AuthContext = createContext<AuthContextProps>({ | ||
currentUser: undefined, | ||
signInCheck: false, | ||
}); | ||
|
||
const AuthProvider = ({ children }: { children: JSX.Element }) => { | ||
const [currentUser, setCurrentUser] = useState<User | null | undefined>( | ||
undefined | ||
); | ||
const [signInCheck, setSignInCheck] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
auth.onAuthStateChanged(async (user) => { | ||
if (user) { | ||
setCurrentUser(user); | ||
setSignInCheck(true); | ||
} else { | ||
setSignInCheck(true); | ||
} | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<AuthContext.Provider value={{ currentUser, signInCheck }}> | ||
{children} | ||
</AuthContext.Provider> | ||
); | ||
}; | ||
|
||
export { AuthContext, AuthProvider }; |
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,34 @@ | ||
import { ExternalLinkIcon } from "@chakra-ui/icons"; | ||
import { Flex, MenuItem, MenuItemProps, Text } from "@chakra-ui/react"; | ||
import { ReactNode } from "react"; | ||
|
||
import { HSpacer } from "@/components/Spacer"; | ||
|
||
type CustomProps = { | ||
isExternal?: boolean; | ||
children: ReactNode; | ||
}; | ||
|
||
type Props = CustomProps & MenuItemProps; | ||
|
||
const CustomMenuItem = ({ | ||
isExternal = false, | ||
children, | ||
...menuItemProps | ||
}: Props) => { | ||
return ( | ||
<MenuItem {...menuItemProps}> | ||
<Flex justify="space-between" align="center"> | ||
<Text>{children}</Text> | ||
{isExternal && ( | ||
<> | ||
<HSpacer size={2} /> | ||
<ExternalLinkIcon color="gray.500" /> | ||
</> | ||
)} | ||
</Flex> | ||
</MenuItem> | ||
); | ||
}; | ||
|
||
export default CustomMenuItem; |
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.