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: add scale to password component #685

Merged
merged 2 commits into from
Jan 25, 2022
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
8 changes: 5 additions & 3 deletions components/input/password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useImperativeHandle, useMemo, useRef, useState } from 'react'
import { Props, defaultProps } from './input-props'
import PasswordIcon from './password-icon'
import Input from './input'
import { withScaleable } from '../use-scaleable'

interface PasswordProps extends Props {
hideToggle?: boolean
Expand All @@ -15,7 +16,7 @@ const passwordDefaultProps = {
type NativeAttrs = Omit<React.InputHTMLAttributes<any>, keyof PasswordProps>
export type InputPasswordProps = PasswordProps & NativeAttrs

const InputPassword = React.forwardRef<
const InputPasswordComponent = React.forwardRef<
HTMLInputElement,
React.PropsWithChildren<InputPasswordProps>
>(
Expand Down Expand Up @@ -62,6 +63,7 @@ const InputPassword = React.forwardRef<
},
)

InputPassword.defaultProps = passwordDefaultProps
InputPassword.displayName = 'GeistInputPassword'
InputPasswordComponent.defaultProps = passwordDefaultProps
InputPasswordComponent.displayName = 'GeistInputPassword'
const InputPassword = withScaleable(InputPasswordComponent)
export default InputPassword
2 changes: 1 addition & 1 deletion pages/en-us/components/button-dropdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from 'lib/components/layout'
import Attributes from 'lib/components/attributes'
import Playground from 'lib/components/playground'
import { ButtonDropdown, Spacer } from 'components'
import Plus from '@geist-ui/react-icons/plus'
import Plus from '@geist-ui/icons/plus'

export const meta = {
title: 'Button Dropdown',
Expand Down
2 changes: 1 addition & 1 deletion pages/zh-cn/components/button-dropdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Layout from 'lib/components/layout'
import Attributes from 'lib/components/attributes'
import Playground from 'lib/components/playground'
import { ButtonDropdown, Spacer } from 'components'
import Plus from '@geist-ui/react-icons/plus'
import Plus from '@geist-ui/icons/plus'

export const meta = {
title: '下拉按钮 Btn Dropdown',
Expand Down