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
Share option #8
Share option #8
Conversation
setShowMenu(prev => !prev) | ||
} | ||
const openMenu = () => { | ||
setShowMenu((prev) => !prev) |
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.
just setShowMenu(true)
|
||
if (!inputValue) { | ||
setErrors('Email required') | ||
} else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(inputValue)) { |
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.
const isValid = !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,}$/i.test(inputValue)
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.
You need to think about separating TodoList app ShareModal from MenuButton since MenuButton is a reusable/common component and ShareModal is TodoList app only.
Let's make a meeting to discuss it more.
@@ -23,7 +23,7 @@ function App() { | |||
|
|||
useEffect(() => { | |||
const inStorage = localStorage.getItem('theme') | |||
const initialValue: any = inStorage ? inStorage : 'light' | |||
const initialValue: any = inStorage ? inStorage : Theme.light |
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.
Type any
?
|
||
|
||
|
||
import { ShareModal } from './MenuOptions/ShareModal' | ||
export const MenuButton = () => { |
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.
How is this a reusable component? According to the task it should be Add a Menu button to each App with an ability to provide different menu options"
} | ||
|
||
export const MenuModal = ({ open, onClose, openShareModal }: Props) => { | ||
const modalRef = React.createRef<HTMLInputElement>() |
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.
Why not useRef?
[modalRef, onClose, open], | ||
) | ||
|
||
useEffect(() => { |
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.
It would be nice to have it as a separate hook something like useOutsideClick
Netlify - https://deploy-preview-8--optimistic-fermat-7ff6ec.netlify.app/