mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Modal Stable / Login View
This commit is contained in:
4
components/ui/Input/Input.module.css
Normal file
4
components/ui/Input/Input.module.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.root {
|
||||
@apply focus:outline-none bg-primary focus:shadow-outline-gray border-none py-2
|
||||
px-6 w-full appearance-none transition duration-150 ease-in-out placeholder-accents-5 pr-10;
|
||||
}
|
25
components/ui/Input/Input.tsx
Normal file
25
components/ui/Input/Input.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import cn from 'classnames'
|
||||
import s from './Input.module.css'
|
||||
import React, { InputHTMLAttributes } from 'react'
|
||||
|
||||
export interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
||||
className?: string
|
||||
onChange?: (...args: any[]) => any
|
||||
}
|
||||
|
||||
const Input: React.FC<Props> = (props) => {
|
||||
const { className, children, onChange, ...rest } = props
|
||||
|
||||
const rootClassName = cn(s.root, {}, className)
|
||||
|
||||
const handleOnChange = (e: any) => {
|
||||
if (onChange) {
|
||||
onChange(e.target.value)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
return <input className={rootClassName} onChange={handleOnChange} {...rest} />
|
||||
}
|
||||
|
||||
export default Input
|
1
components/ui/Input/index.ts
Normal file
1
components/ui/Input/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './Input'
|
Reference in New Issue
Block a user