mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 12:11:22 +00:00
styles: input search
This commit is contained in:
parent
71eaa424ec
commit
6d828280a0
@ -1,6 +1,6 @@
|
||||
|
||||
import { ButtonCommon, Inputcommon, Layout } from 'src/components/common';
|
||||
import { IconBuy, IconSearch } from 'src/components/icons';
|
||||
import { ButtonCommon, Inputcommon, InputSearch, Layout } from 'src/components/common';
|
||||
import { IconBuy } from 'src/components/icons';
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
@ -13,7 +13,7 @@ export default function Home() {
|
||||
{/* demo */}
|
||||
<div style={{ display: 'flex' }}>
|
||||
<Inputcommon placeholder="Enter here" />
|
||||
<Inputcommon placeholder="Enter here" styleType='custom' icon={<IconSearch />}/>
|
||||
<InputSearch/>
|
||||
</div>
|
||||
|
||||
<ButtonCommon type='ghost' icon={<IconBuy />}>Button</ButtonCommon>
|
||||
|
22
src/components/common/InputSearch/InputSearch.tsx
Normal file
22
src/components/common/InputSearch/InputSearch.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { IconSearch } from 'src/components/icons';
|
||||
import { LANGUAGE } from 'src/utils/language.utils';
|
||||
import { Inputcommon } from '..';
|
||||
|
||||
interface Props {
|
||||
onChange?: (value: string | number) => void,
|
||||
onEnter?: (value: string | number) => void,
|
||||
}
|
||||
|
||||
const InputSearch = ({ onChange, onEnter }: Props) => {
|
||||
return (
|
||||
<Inputcommon placeholder={LANGUAGE.PLACE_HOLDER.SEARCH}
|
||||
styleType='custom'
|
||||
icon={<IconSearch />}
|
||||
onChange={onChange}
|
||||
onEnter={onEnter}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default InputSearch
|
@ -5,3 +5,4 @@ export { default as ViewAllItem} from './ViewAllItem/ViewAllItem'
|
||||
export { default as ItemWishList} from './ItemWishList/ItemWishList'
|
||||
export { default as Logo} from './Logo/Logo'
|
||||
export { default as Inputcommon} from './InputCommon/InputCommon'
|
||||
export { default as InputSearch} from './InputSearch/InputSearch'
|
||||
|
@ -3,4 +3,7 @@ export const LANGUAGE = {
|
||||
BUY_NOW: 'Buy now',
|
||||
SHOP_NOW: 'Shop now',
|
||||
},
|
||||
PLACE_HOLDER: {
|
||||
SEARCH: 'Search',
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user