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

feat: homepage ui with bb #292

Merged
merged 1 commit into from
Mar 27, 2024
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
52 changes: 17 additions & 35 deletions apps/dsep/components/landingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from 'react'
import Router from 'next/router'
import { SearchInput } from '@beckn-ui/becknified-components'
import { Box, Flex, Text, Image } from '@chakra-ui/react'

import ImageCard from './ImageCard'
import { useLanguage } from '../../hooks/useLanguage'
import { Box, Flex, Text, Input, Image } from '@chakra-ui/react'

import beckenFooter from '../../public/images/beckenFooterLogo.svg'
import couresImageWhite from '../../public/images/landing-page-icons/CoursesWhite.svg'
import coursesImageBlack from '../../public/images/landing-page-icons/CoursesBlack.svg'
Expand All @@ -29,6 +29,13 @@ const LandingPage: React.FC = () => {
setActiveCard(type)
}

const searchIconClickHandler = (e: any) => {
if (searchTerm) {
navigateToSearchResults()
}
e.preventDefault()
}

return (
<Box p={'20px'}>
<Text
Expand Down Expand Up @@ -76,41 +83,16 @@ const LandingPage: React.FC = () => {
))}
</Flex>

<Flex pt={'25px'}>
<Input
boxShadow="0px 0px 24px rgba(0, 0, 0, 0.10)"
borderRightRadius={'unset'}
p={'26px 15px'}
type="text"
<Box pt={'25px'}>
<SearchInput
name="search_input"
placeholder={`Search for ${activeCard}`}
onChange={(e: React.BaseSyntheticEvent) => setSearchTerm(e.target.value)}
onKeyDown={event => event.key === 'Enter' && navigateToSearchResults()}
_focusVisible={{
borderColor: 'transparent',
boxShadow: 'transparent'
}}
onChangeHandler={(e: React.BaseSyntheticEvent) => setSearchTerm(e.target.value)}
searchIcon={'/images/searchIcon.svg'}
searchIconClickHandler={searchIconClickHandler}
onEnterHandler={(e: { key: string }) => e.key === 'Enter' && navigateToSearchResults()}
placeHolder={`Search for ${activeCard}`}
/>
<Flex
bg={'rgba(var(--color-primary))'}
borderRightRadius={'6px'}
boxShadow="0px 0px 24px rgba(0, 0, 0, 0.10)"
justifyContent={'center'}
alignItems="center"
width={'55px'}
>
<Image
src="/images/searchIcon.svg"
onClick={e => {
if (searchTerm) {
navigateToSearchResults()
}
e.preventDefault()
}}
alt={'search icon'}
/>
</Flex>
</Flex>
</Box>
<Flex
justifyContent={'center'}
alignItems="center"
Expand Down
4 changes: 1 addition & 3 deletions apps/dsep/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function MyApp({ Component, pageProps }: AppProps) {
theme={{
color: {
primary: '#3AA5E1',
secondary: '#84B3F9',
textPrimary: '#1A202C',
textSecondary: '#6B7280'
secondary: '#84B3F9'
}
}}
>
Expand Down