feat(frontend): added more localized strings
This commit is contained in:
@@ -8,6 +8,13 @@ import {
|
||||
import { useSWRInfinite } from 'swr';
|
||||
import ListView from '../Common/ListView';
|
||||
import { LanguageContext } from '../../context/LanguageContext';
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
import Header from '../Common/Header';
|
||||
import globalMessages from '../../i18n/globalMessages';
|
||||
|
||||
const messages = defineMessages({
|
||||
searchresults: 'Search Results',
|
||||
});
|
||||
|
||||
interface SearchResult {
|
||||
page: number;
|
||||
@@ -17,6 +24,7 @@ interface SearchResult {
|
||||
}
|
||||
|
||||
const Search: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const { locale } = useContext(LanguageContext);
|
||||
const router = useRouter();
|
||||
const { data, error, size, setSize } = useSWRInfinite<SearchResult>(
|
||||
@@ -58,25 +66,21 @@ const Search: React.FC = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="md:flex md:items-center md:justify-between mb-8 mt-6">
|
||||
<div className="flex-1 min-w-0">
|
||||
<h2 className="text-xl leading-7 text-white sm:text-2xl sm:leading-9 sm:truncate">
|
||||
Search Results
|
||||
</h2>
|
||||
</div>
|
||||
<div className="md:flex md:items-center md:justify-between mb-6 sm:mb-0 mt-6">
|
||||
<Header>{intl.formatMessage(messages.searchresults)}</Header>
|
||||
<div className="mt-4 flex md:mt-0 md:ml-4">
|
||||
<span className="relative z-0 inline-flex shadow-sm rounded-md">
|
||||
<button
|
||||
type="button"
|
||||
className="relative inline-flex items-center px-4 py-2 rounded-l-md border border-indigo-900 bg-indigo-500 hover:bg-indigo-400 text-sm leading-5 font-medium text-gray-100 hover:text-white focus:z-10 focus:outline-none focus:border-blue-300 focus:ring-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150"
|
||||
>
|
||||
Movies
|
||||
{intl.formatMessage(globalMessages.movies)}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="-ml-px relative inline-flex items-center px-4 py-2 rounded-r-md border border-indigo-900 bg-indigo-500 text-sm leading-5 font-medium text-gray-100 hover:text-white focus:z-10 focus:outline-none focus:border-blue-300 focus:ring-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150"
|
||||
>
|
||||
TV Shows
|
||||
{intl.formatMessage(globalMessages.tvshows)}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user