-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: path alias to electron and optimize src path (#342)
* feat: path alias to electron and optimize src path * fix: eslint errors
- Loading branch information
Showing
11 changed files
with
82 additions
and
85 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
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
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,29 +1,34 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { AnimatePresence, motion } from 'framer-motion'; | ||
import { useError } from 'stores/useError/useError'; | ||
|
||
import { useError } from '~stores/useError/useError'; | ||
|
||
import Icon from '~components/Icon/Icon'; | ||
|
||
import scss from './FeedbackError.module.scss'; | ||
|
||
import { animationVariants } from './FeedbackError.data'; | ||
|
||
function FeedbackError() { | ||
function FeedbackError(): ReactNode { | ||
const errorMessage = useError((state) => state.errorMessage); | ||
|
||
const renderError = () => ( | ||
const renderError = (): ReactNode => ( | ||
<motion.div | ||
initial="hidden" | ||
animate="visible" | ||
exit="hidden" | ||
className={scss.wrapper} | ||
variants={animationVariants} | ||
data-testid="error-container" | ||
exit="hidden" | ||
initial="hidden" | ||
variants={animationVariants} | ||
> | ||
<Icon icon="error" size="large" className={scss.errorIcon} /> | ||
<Icon className={scss.errorIcon} icon="error" size="large" /> | ||
<p className={scss.errorMessage}>{errorMessage}</p> | ||
</motion.div> | ||
); | ||
return <AnimatePresence>{errorMessage && renderError()}</AnimatePresence>; | ||
return ( | ||
<AnimatePresence>{errorMessage ? renderError() : null}</AnimatePresence> | ||
); | ||
} | ||
|
||
export default FeedbackError; |
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
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,19 +1,21 @@ | ||
import React from 'react'; | ||
import { ReactNode } from 'react'; | ||
|
||
import { usePostsStore } from 'stores/usePostsStore'; | ||
import { usePostsStore } from '~stores/usePostsStore'; | ||
|
||
const Testinho = ({ name = 'World' }) => { | ||
function Testinho(props: { name?: string }): ReactNode { | ||
const posts = usePostsStore((state) => state.postsQuantity); | ||
|
||
const increaseValue = usePostsStore((state) => state.increase); | ||
const increaseQuantity = 1; | ||
|
||
return ( | ||
<> | ||
<button onClick={() => increaseValue(1)}>Change value of posts</button> | ||
<button onClick={() => increaseValue(increaseQuantity)} type="button"> | ||
Change value of posts | ||
</button> | ||
<p>Number of posts: {posts}</p> | ||
<h1>Hello, {name}!</h1> | ||
<h1>Hello, {props.name ?? 'World'}!</h1> | ||
</> | ||
); | ||
}; | ||
} | ||
|
||
export default Testinho; |
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
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