-
Notifications
You must be signed in to change notification settings - Fork 0
[scratch-off] fix error #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6cca81e
d1b9e05
c90d791
0bf18bb
b02a132
f816101
c52fea6
4fbb8fb
3f26257
23fe685
bde2150
40f3404
8ab07bc
60be04f
1e23154
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,13 @@ | ||||||
| import React from 'react'; | ||||||
| import React, { memo } from 'react'; | ||||||
| import styled from 'styled-components'; | ||||||
| import useItemTransition, { ItemStyle } from '../hooks/useItemTransition'; | ||||||
| import { User } from '../types'; | ||||||
|
|
||||||
| export interface Props { | ||||||
| export interface TransitionLeaderboardWrapperProps { | ||||||
| user: User[]; | ||||||
| rowCount: number; | ||||||
| itemStyle: ItemStyle; | ||||||
| children: string | React.ReactNode; | ||||||
| } | ||||||
|
|
||||||
| const Wrapper = styled.div` | ||||||
|
|
@@ -19,7 +20,7 @@ | |||||
| transition: 'all 0.5s ease 0.3s', | ||||||
| }; | ||||||
|
|
||||||
| export const TransitionLeaderboardWrapper: React.FC<Props> = React.memo( | ||||||
| export const TransitionLeaderboardWrapper: React.FC<TransitionLeaderboardWrapperProps> = | ||||||
|
Check notice on line 23 in lib/components/TransitionLeaderboardWrapper.tsx
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ℹ️ Codacy found a minor Code Style issue: Replace The issue reported by the ESLint linter is related to the formatting of the TypeScript code, specifically regarding the placement of the type annotation for the To fix the issue, you should move the type annotation Here’s the suggested change:
Suggested change
This should be changed to: export const TransitionLeaderboardWrapper: React.FC<TransitionLeaderboardWrapperProps>
=This comment was generated by an experimental AI tool. |
||||||
| ({ user, itemStyle, rowCount, children }) => { | ||||||
| const { itemTransitionStyle } = useItemTransition( | ||||||
| itemStyle, | ||||||
|
|
@@ -45,7 +46,6 @@ | |||||
| } | ||||||
|
|
||||||
| return <Wrapper>{renderChild()}</Wrapper>; | ||||||
| }, | ||||||
| ); | ||||||
| }; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Delete
Suggested change
|
||||||
|
|
||||||
| export default TransitionLeaderboardWrapper; | ||||||
| export default memo(TransitionLeaderboardWrapper); | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| import { TransitionLeaderboardWrapper } from './TransitionLeaderboardWrapper'; | ||
| import { VirtualizedList } from './VirtualizedList'; | ||
| import TransitionLeaderboardWrapper from './TransitionLeaderboardWrapper'; | ||
| import VirtualizedList from './VirtualizedList'; | ||
| import ScratchOffCard from './ScratchOffCard'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 這邊這樣寫的話,vmo-frontend應該沒辦用
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| export * from './TransitionLeaderboardWrapper'; | ||
| export * from './VirtualizedList'; | ||
| export * from './ScratchOffCard'; | ||
|
|
||
| export default { TransitionLeaderboardWrapper, VirtualizedList }; | ||
| export default { | ||
| TransitionLeaderboardWrapper, | ||
| VirtualizedList, | ||
| ScratchOffCard, | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Codacy found a minor Code Style issue: Function component is not a function declaration
The ESLint issue indicates that the linter prefers function declarations over function expressions for defining React components. This is a stylistic preference that can help with readability and consistency in codebases.
To resolve this issue, you can change the function component from a function expression to a function declaration. Here's the suggested code change:
This comment was generated by an experimental AI tool.