Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,18 @@
max-width: 931px;
width: 100%;
}

.headerErrorWrap {
display: flex;
justify-content: center;
}

.headerError {
display: flex;
align-items: center;
gap: $sp-3;

padding: $sp-4 $sp-8;
border-radius: 10px;
background: $purple-140;
}
45 changes: 35 additions & 10 deletions src/apps/talent-search/src/routes/search-page/SearchPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useRef, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useNavigate, useSearchParams } from 'react-router-dom'

import { ContentLayout } from '~/libs/ui'
import { ContentLayout, IconOutline } from '~/libs/ui'
import { Skill } from '~/libs/shared'

import { SearchInput } from '../../components/search-input'
Expand All @@ -12,6 +12,9 @@ import { encodeUrlQuerySearch } from '../../lib/utils/search-query'
import styles from './SearchPage.module.scss'

export const SearchPage: FC = () => {
const [params] = useSearchParams()
const isMissingProfileRoute = params.get('memberNotFound') !== null

const searchInputRef = useRef<HTMLInputElement>()
const navigate = useNavigate()
const [skillsFilter, setSkillsFilter] = useState<Skill[]>([])
Expand All @@ -26,20 +29,42 @@ export const SearchPage: FC = () => {
searchInputRef.current?.focus()
}

function renderHeader(): JSX.Element {
return isMissingProfileRoute ? (
<>
<div className={styles.headerErrorWrap}>
<div className={styles.headerError}>
<IconOutline.ExclamationCircleIcon className='icon-xxxxl' />
<span>We were unable to locate that profile</span>
</div>
</div>
<div className={styles.subHeader}>
<div className={styles.subHeaderText}>
You can also try finding members through our Talent Search:
</div>
</div>
</>
) : (
<>
<div className={styles.searchHeader}>
<span className={styles.searchHeaderText}>Looking for a technology expert?</span>
</div>
<div className={styles.subHeader}>
<div className={styles.subHeaderText}>
Search thousands of skills to match with our global experts.
</div>
</div>
</>
)
}

return (
<ContentLayout
contentClass={styles.contentLayout}
outerClass={styles['contentLayout-outer']}
innerClass={styles['contentLayout-inner']}
>
<div className={styles.searchHeader}>
<span className={styles.searchHeaderText}>Looking for a technology expert?</span>
</div>
<div className={styles.subHeader}>
<div className={styles.subHeaderText}>
Search thousands of skills to match with our global experts.
</div>
</div>
{renderHeader()}
<div className={styles.searchOptions}>
<span className={styles.searchPrompt}>Search by skills</span>
<SearchInput
Expand Down