Skip to content
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

1093/search redesign #1150

Merged
merged 66 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8726a45
Created new react-aria-component based searchbar with tagbar
Ty-ci Dec 5, 2023
817c82b
Create new components for Search component, no style, no functionalit…
Ty-ci Dec 7, 2023
a220872
Add preliminary real data fetching to Search results
Ty-ci Dec 8, 2023
f98ab9e
Add a variant to search result card with image
Ty-ci Dec 11, 2023
7680fae
Refactor search components and add localization
Ty-ci Dec 11, 2023
1e79f94
Add localization and preliminary pagination
Ty-ci Dec 13, 2023
78314dd
Remove unused files
Ty-ci Dec 13, 2023
c775746
Undo unwanted change in PageCards component
Ty-ci Dec 13, 2023
c21793b
Refactor search result cards to be more composable
Ty-ci Dec 14, 2023
d6f8dd9
Refactor search page content and search results components to remove …
Ty-ci Dec 15, 2023
1adf937
add pictures, fix pagination and metadata
Ty-ci Dec 18, 2023
dc3f830
Remove unused files
Ty-ci Dec 18, 2023
4a6cec1
Add page header, fix style for small screens, fix translations, fix i…
Ty-ci Dec 18, 2023
73d85a8
Add connection for search query and URL
Ty-ci Dec 18, 2023
5e1145c
Merge branch 'master' into 1093/Search-redesign
Ty-ci Dec 18, 2023
7792ffb
Fix bug where cards with no data were shown when switching search opt…
Ty-ci Dec 18, 2023
bfa80f4
Refactor searchDataFetchers (remove redundant code), rename some vari…
Ty-ci Dec 19, 2023
6d45ade
Fix search data fetchers
Ty-ci Dec 19, 2023
c1f2f89
Refactor search page components and update translations based on some…
Ty-ci Dec 19, 2023
dbdc812
Fix small things with accordance to comments in review
Ty-ci Dec 19, 2023
3ee6678
Refactor types used in search components so there's no residual 'any'…
Ty-ci Dec 19, 2023
9d049b4
Refactor - remove usage of index value as React element key property
Ty-ci Dec 19, 2023
e35c4ff
Fix various thing according to review comments
Ty-ci Dec 20, 2023
6781e8a
Add default return from getDataBySearchOptionKey
Ty-ci Dec 20, 2023
a28883f
Isolate findIconByPageColor function to separate file
Ty-ci Dec 20, 2023
83f09fb
Remove unused imports
Ty-ci Dec 20, 2023
c9720cc
Add new search options for contacts and official board
Ty-ci Dec 20, 2023
bdf5c55
Small fixes according to review comments
Ty-ci Dec 20, 2023
0e805d4
Fix pagination and rename some variables to align with repo conventions
Ty-ci Dec 21, 2023
0eaa359
Implemented Typography component
Ty-ci Dec 21, 2023
5f305da
Change breakpoint for mobile screens from sm to lg
Ty-ci Dec 22, 2023
e9613e5
Wrap searchcard title by link and hide official board search option
Ty-ci Dec 22, 2023
d81eec8
address PR comments
radoslavzeman Dec 26, 2023
1c9d31f
fix hooks used outside of hook or component
radoslavzeman Dec 26, 2023
c9eb592
use custom clear button in SearchField
radoslavzeman Dec 26, 2023
1f03c91
better Selection handling in TagGroup
radoslavzeman Dec 26, 2023
c793ec6
fix styling
radoslavzeman Dec 26, 2023
5fd8a07
fix scroll-to-top on page change
radoslavzeman Dec 26, 2023
7d03ac0
improve focus styling
radoslavzeman Dec 26, 2023
1260787
adress some PR comments for SearchCard
Ty-ci Dec 27, 2023
0118b43
Fix key warning in SearchCardComposed and fix typos in some comments
Ty-ci Dec 29, 2023
c98ae95
Merge branch 'master' into 1093/Search-redesign
Ty-ci Jan 2, 2024
5ec2cc9
Add horizontal scrolling to tag list on mobile displays
Ty-ci Jan 2, 2024
064fb5e
Fix runtime errors: key in GeneralSearchResults and undefined otherMa…
Ty-ci Jan 2, 2024
63070a6
Add aria-label to TagGroup
Ty-ci Jan 2, 2024
de4a53b
Add custom icon support
Ty-ci Jan 3, 2024
abe053a
Fix SVG clip-path for kontakty-a-uradne-hodiny icon
Ty-ci Jan 3, 2024
d8bea61
Add icon to official board search result cards
Ty-ci Jan 3, 2024
5df7549
Fix React duplicate key error
Ty-ci Jan 3, 2024
4297b3a
Hide 'more results' button when no search results are found
Ty-ci Jan 3, 2024
91be2dd
Add black color option to Pagination and implement in main search page
Ty-ci Jan 3, 2024
5ea435f
Merge branch 'master' into 1093/Search-redesign
Ty-ci Jan 4, 2024
3d8b2b1
Add paragraph showing number of search results
Ty-ci Jan 4, 2024
5e5193f
Fix plural in translation of 'Showing XY results' message
Ty-ci Jan 5, 2024
6026188
Show number of results in search option chips
Ty-ci Jan 5, 2024
b9f8729
Fix style (contact result card background color)
Ty-ci Jan 8, 2024
5482748
fix minor issues from PR review comments
Ty-ci Jan 8, 2024
710461e
Remove clip path from top-services icons
Ty-ci Jan 8, 2024
22a684d
Fix disappearing ring around search option Tags
Ty-ci Jan 8, 2024
4081aed
Add new dokumenty icon and remove debug elements from search page
Ty-ci Jan 8, 2024
67d030f
Revert changes to pagination, keep default red background
Ty-ci Jan 8, 2024
e2c490c
Change type of resultsCount from Map to Object
Ty-ci Jan 8, 2024
65c8cc5
Change cross icon in search bar
Ty-ci Jan 8, 2024
82bb8fa
Fix resultsCount state
Ty-ci Jan 8, 2024
e058b3b
Use Typography
Ty-ci Jan 9, 2024
fd93624
Merge branch 'master' into 1093/Search-redesign
Ty-ci Jan 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions next/components/forms/simple-components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ import { Tag, TagProps } from 'react-aria-components'

interface ChipProps extends TagProps {
variant?: 'large' | 'small'
className?: string
}

/*
/* FIGMA: https://www.figma.com/file/17wbd0MDQcMW9NbXl6UPs8/DS-ESBS%2BBK%3A-Component-library?node-id=10277%3A26616&mode=dev
/* For Chips to be responsive, we don't have three separate variants as in style guide, but only two which respond to window size.
*/

const Chip = ({ variant = 'large', className, ...props }: ChipProps) => {
const Chip = ({ variant = 'large', ...props }: ChipProps) => {
return (
<Tag
{...props}
className={cx(
'flex cursor-pointer items-center rounded-lg border-2 hover:bg-gray-200 selected:border-category-700 selected:bg-category-700 selected:text-gray-0 hover:selected:bg-category-700',
className,
{
'px-3 py-1.5 text-size-p-small lg:px-4 lg:py-2.5 lg:text-size-p-default':
variant === 'large',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const GeneralSearchResults = ({
estimatedTotalHits <= DEFAULT_PAGE_SIZE && estimatedTotalHits <= filters.pageSize

return (
<div className="flex flex-col gap-y-8 border border-warning-300">
<div className="flex flex-col gap-y-8">
<div className="flex flex-col gap-y-4">
{variant === 'allResults' && (
<SearchResultsHeader
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ArrowRightIcon } from '@assets/ui-icons'
import Button from '@components/forms/simple-components/Button'
import { useTranslations } from 'next-intl'

type SearchResultsHeaderProps = {
Expand All @@ -12,12 +13,10 @@ export const SearchResultsHeader = ({ title, handleShowMore }: SearchResultsHead
return (
<div className="flex flex-col flex-wrap items-baseline justify-between gap-y-2 text-gray-800 sm:flex-row">
<h2 className="text-size-h4">{title}</h2>
<button className="flex items-center gap-2" type="button" onClick={handleShowMore}>
<span className="text-size-p-large font-medium underline">
{t('SearchPage.moreResults')}
</span>
<Button variant="black-link" onPress={handleShowMore}>
{t('SearchPage.moreResults')}
<ArrowRightIcon />
</button>
</Button>
</div>
)
}
15 changes: 4 additions & 11 deletions next/components/pages/searchPageContentNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AdvancedSearchNew from '@components/molecules/SearchPageNew/AdvancedSearc
import GeneralSearchResults from '@components/molecules/SearchPageNew/GeneralSearchResults'
import { SearchFilters } from '@components/molecules/SearchPageNew/searchDataFetchers'
import { SectionContainer } from '@components/ui/SectionContainer/SectionContainer'
import { ColorCategory, getCategoryColorLocalStyle } from '@utils/colors'
import { useRouter } from 'next/router'
import { useTranslations } from 'next-intl'
import React, { useEffect, useLayoutEffect, useMemo, useState } from 'react'
Expand All @@ -21,15 +22,8 @@ export type SearchOption = {
const SearchPageContentNew = () => {
const t = useTranslations()

const { asPath } = useRouter()

const [routerQueryValue, setRouterQueryValue] = useQueryParam(
'keyword',
// FIXME: be better
withDefault(StringParam, asPath.split('keyword=')[1] ?? ''),
// withDefault(StringParam, ''),
)
const [input, setInput] = useState(routerQueryValue)
const [routerQueryValue] = useQueryParam('keyword', withDefault(StringParam, ''))
const [input, setInput] = useState('')
const debouncedInput = useDebounce(input, 300)
const [searchValue, setSearchValue] = useState(debouncedInput)

Expand All @@ -39,7 +33,6 @@ const SearchPageContentNew = () => {

useEffect(() => {
setSearchValue(debouncedInput)
setRouterQueryValue(debouncedInput)
}, [debouncedInput])

const searchOptions: SearchOption[] = [
Expand Down Expand Up @@ -107,10 +100,10 @@ const SearchPageContentNew = () => {
{searchOptions.map((option) => {
return (
<Chip
className="selected:border-gray-700 selected:bg-gray-700 hover:selected:bg-gray-700"
variant="large"
key={option.key}
id={option.key}
style={getCategoryColorLocalStyle({ category: 'gray' })}
>
{`${option.displayName} `}
</Chip>
Expand Down
1 change: 1 addition & 0 deletions next/utils/colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type ColorCategory =
| 'social'
| 'education'
| 'culture'
| 'gray'

const colorCategoryMap = {
red: 'main',
Expand Down