diff --git a/CHANGELOGS.md b/CHANGELOGS.md index faf4896d..76e5f17a 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,6 +1,15 @@ ## Changelogs -## 0.0.43 +## 0.0.44 + +[EditText] + +- Added missing callBack props `onSubmitEditing`. +- Set default `placeholderTextColor`. +- Added `labelColor`. +- Dark mode example in story. + +- ## 0.0.43 [EditText] diff --git a/lib/package.json b/lib/package.json index 194fefeb..a16eb975 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "dooboo-ui", - "version": "0.0.43", + "version": "0.0.44", "main": "index.js", "types": "index.d.ts", "author": "dooboolab", diff --git a/main/EditText.tsx b/main/EditText.tsx index 6c9d1188..91d85dfa 100644 --- a/main/EditText.tsx +++ b/main/EditText.tsx @@ -43,6 +43,7 @@ export type EditTextProps = { hoverColor?: string; errorColor?: string; disableColor?: string; + labelColor?: string; type?: 'row' | 'column'; }; @@ -56,18 +57,20 @@ const Component: FC = ({ errorText = '', value = '', placeholder, - placeholderTextColor, onChange, onChangeText, onFocus, onBlur, + onSubmitEditing, autoCapitalize = 'none', secureTextEntry = false, editable = true, + placeholderTextColor = theme.placeholder, focusColor = theme.primary, hoverColor = theme.primaryDark, errorColor = theme.negative, disableColor = theme.disabled, + labelColor = theme.secondaryText, type = 'row', }) => { const [focused, setFocused] = useState(false); @@ -75,7 +78,6 @@ const Component: FC = ({ const hovered = useHover(ref); const borderColor = disableColor; - const labelColor = disableColor; const hoveredColor = theme.primary; const textColor = theme.text; @@ -257,6 +259,7 @@ const Component: FC = ({ placeholderTextColor={placeholderTextColor} onChange={onChange} onChangeText={onChangeText} + onSubmitEditing={onSubmitEditing} /> {errorText ? ( diff --git a/main/__tests__/__snapshots__/EditText.test.tsx.snap b/main/__tests__/__snapshots__/EditText.test.tsx.snap index 7e494651..29310146 100644 --- a/main/__tests__/__snapshots__/EditText.test.tsx.snap +++ b/main/__tests__/__snapshots__/EditText.test.tsx.snap @@ -40,6 +40,7 @@ exports[`[EditText] interactions Type: [column] renders custom styles without cr editable={true} onBlur={[Function]} onFocus={[Function]} + placeholderTextColor="#CFCED0" rejectResponderTermination={true} secureTextEntry={false} style={ @@ -104,6 +105,7 @@ exports[`[EditText] interactions Type: [column] renders without crashing 1`] = ` editable={true} onBlur={[Function]} onFocus={[Function]} + placeholderTextColor="#CFCED0" rejectResponderTermination={true} secureTextEntry={false} style={ @@ -169,6 +171,7 @@ exports[`[EditText] interactions Type: [row] - default should render without cra editable={true} onBlur={[Function]} onFocus={[Function]} + placeholderTextColor="#CFCED0" rejectResponderTermination={true} secureTextEntry={false} style={ @@ -235,6 +238,7 @@ exports[`[EditText] interactions web renders without crashing 1`] = ` editable={true} onBlur={[Function]} onFocus={[Function]} + placeholderTextColor="#CFCED0" rejectResponderTermination={true} secureTextEntry={false} style={ diff --git a/stories/dooboo-ui/Button.stories.tsx b/stories/dooboo-ui/Button.stories.tsx index ad69da4b..130a1a72 100644 --- a/stories/dooboo-ui/Button.stories.tsx +++ b/stories/dooboo-ui/Button.stories.tsx @@ -1,145 +1,10 @@ -import 'react-native-get-random-values'; +import React, {ReactElement} from 'react'; -import {IC_FACEBOOK, IC_GOOGLE} from '../Icon'; -import {Image, View} from 'react-native'; -import React, {ReactElement, useState} from 'react'; -import {ThemeType, light} from '../../main/theme'; - -import {Button} from '../../main'; +import ButtonDefault from './ButtonStories/ButtonDefaultStory'; import {ContainerDeco} from '../../storybook/decorators'; import {ThemeProvider} from '../../main/theme/ThemeProvider'; -import {action} from '@storybook/addon-actions'; +import {ThemeType} from '../../main/theme'; import {storiesOf} from '@storybook/react-native'; -import styled from 'styled-components/native'; -import {text} from '@storybook/addon-knobs'; - -const ScrollContainer = styled.ScrollView` - width: 100%; -`; - -const Container = styled.View` - background-color: transparent; - align-items: center; - justify-content: center; - width: 100%; - margin-top: 20px; - margin-bottom: 20px; - flex-direction: column; -`; - -function Default(): React.ReactElement { - const [facebookLoading, setFacebookLoading] = useState(false); - const [googleLoading, setGoogleLoading] = useState(false); - - return ( - - -