-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'frontend' into mayu-QRcode
- Loading branch information
Showing
18 changed files
with
205 additions
and
158 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,35 @@ | ||
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: format and commit when PR | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
frontend: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
ref: ${{ github.head_ref }} | ||
- name: Install package | ||
run: yarn install --frozen-lockfile | ||
- name: Run formatter | ||
run: yarn run format | ||
- name: Build test | ||
run: yarn run build | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: applied prettier |
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,8 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
trailingComma: 'none', | ||
semi: false, | ||
tabWidth: 2, | ||
htmlWhitespaceSensitivity: 'ignore', | ||
printWidth: 100 | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import App from './App' | ||
|
||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); | ||
render(<App />) | ||
const linkElement = screen.getByText(/learn react/i) | ||
expect(linkElement).toBeInTheDocument() | ||
}) |
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,35 +1,35 @@ | ||
import React, { createContext, useEffect, useState } from "react"; | ||
import { getUserIdFromLocalStorage, storageAvailable } from "../utils/storage"; | ||
import React, { createContext, useEffect, useState } from 'react' | ||
import { getUserIdFromLocalStorage, storageAvailable } from '../utils/storage' | ||
|
||
export const AuthContext = createContext(); | ||
export const AuthContext = createContext() | ||
|
||
const AppContextProvider = ({ children }) => { | ||
const [initialLoading, setInitialLoading] = useState(true); | ||
const [localStorageAvailable, setLocalStorageAvailable] = useState(false); | ||
const [userId, setUserId] = useState(undefined); | ||
const [initialLoading, setInitialLoading] = useState(true) | ||
const [localStorageAvailable, setLocalStorageAvailable] = useState(false) | ||
const [userId, setUserId] = useState(undefined) | ||
useEffect(() => { | ||
if (storageAvailable()) { | ||
setLocalStorageAvailable(true); | ||
let id = getUserIdFromLocalStorage(); | ||
setLocalStorageAvailable(true) | ||
let id = getUserIdFromLocalStorage() | ||
if (!id) { | ||
// TODO: なまえを入力してIDを取得して保存しておく | ||
} | ||
} | ||
setInitialLoading(false); | ||
}, []); | ||
setInitialLoading(false) | ||
}, []) | ||
return ( | ||
<AuthContext.Provider | ||
value={{ | ||
userId, | ||
setUserId, | ||
initialLoading, | ||
setInitialLoading, | ||
localStorageAvailable, | ||
localStorageAvailable | ||
}} | ||
> | ||
{children} | ||
</AuthContext.Provider> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default AppContextProvider; | ||
export default AppContextProvider |
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,23 +1,23 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import "./index.scss"; | ||
import App from "./App"; | ||
import * as serviceWorkerRegistration from "./serviceWorkerRegistration"; | ||
import reportWebVitals from "./reportWebVitals"; | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import './index.scss' | ||
import App from './App' | ||
import * as serviceWorkerRegistration from './serviceWorkerRegistration' | ||
import reportWebVitals from './reportWebVitals' | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById("root") | ||
); | ||
document.getElementById('root') | ||
) | ||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://cra.link/PWA | ||
serviceWorkerRegistration.unregister(); | ||
serviceWorkerRegistration.unregister() | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); | ||
reportWebVitals() |
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,13 +1,11 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', | ||
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; | ||
} |
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 |
---|---|---|
|
@@ -24,6 +24,6 @@ const Signup = () => { | |
Create account | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
export default Signup; | ||
) | ||
} | ||
export default Signup |
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,13 +1,13 @@ | ||
const reportWebVitals = (onPerfEntry) => { | ||
if (onPerfEntry && onPerfEntry instanceof Function) { | ||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { | ||
getCLS(onPerfEntry); | ||
getFID(onPerfEntry); | ||
getFCP(onPerfEntry); | ||
getLCP(onPerfEntry); | ||
getTTFB(onPerfEntry); | ||
}); | ||
getCLS(onPerfEntry) | ||
getFID(onPerfEntry) | ||
getFCP(onPerfEntry) | ||
getLCP(onPerfEntry) | ||
getTTFB(onPerfEntry) | ||
}) | ||
} | ||
}; | ||
} | ||
|
||
export default reportWebVitals; | ||
export default reportWebVitals |
Oops, something went wrong.