fix(frontend): run initial props for children components after getting the user

This commit is contained in:
sct
2020-09-18 01:03:04 +00:00
parent 9131254f33
commit fdf9f38776
11 changed files with 158 additions and 71 deletions

View File

@@ -1,7 +1,13 @@
import React from 'react';
import useSearchInput from '../../../hooks/useSearchInput';
import { defineMessages, useIntl } from 'react-intl';
const messages = defineMessages({
searchPlaceholder: 'Search Movies & TV',
});
const SearchInput: React.FC = () => {
const intl = useIntl();
const { searchValue, setSearchValue, setIsOpen } = useSearchInput();
return (
<div className="flex-1 flex">
@@ -22,7 +28,7 @@ const SearchInput: React.FC = () => {
<input
id="search_field"
className="block w-full h-full pl-8 pr-3 py-2 rounded-md bg-cool-gray-600 text-white placeholder-gray-300 focus:outline-none focus:placeholder-gray-400 sm:text-base"
placeholder="Search"
placeholder={intl.formatMessage(messages.searchPlaceholder)}
type="search"
value={searchValue}
onChange={(e) => setSearchValue(e.target.value)}