File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { SubmitButton } from "./submit-button" ;
2+ import { text } from "@storybook/addon-knobs" ;
3+ import React from "react" ;
4+
5+ export default {
6+ component : SubmitButton ,
7+ title : "Atoms | Forms / Submit Button" ,
8+ } ;
9+
10+ export const submitButtonKnobs = ( ) => (
11+ < SubmitButton buttonText = { text ( "Button Text" , "Submit" ) } />
12+ ) ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ describe ( "SubmitButton" , ( ) => {
4+ test . skip ( "TODO - https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues/8" , ( ) => { } ) ;
5+ } ) ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ // -----------------------------------------------------------------------------------------
4+ // #region Interfaces
5+ // -----------------------------------------------------------------------------------------
6+
7+ export interface SubmitButtonProps {
8+ buttonText ?: string ;
9+ cssClassName ?: string ;
10+
11+ /**
12+ * Typically you do not need this, but using it can allow you to
13+ * place the button outside of the form for styling purposes.
14+ */
15+ formId ?: string ;
16+ }
17+
18+ // #endregion Interfaces
19+
20+ // -----------------------------------------------------------------------------------------
21+ // #region Component
22+ // -----------------------------------------------------------------------------------------
23+
24+ const SubmitButton : React . FC < SubmitButtonProps > = (
25+ props : SubmitButtonProps
26+ ) => {
27+ return (
28+ < input
29+ className = { props . cssClassName || "c-button" }
30+ form = { props . formId }
31+ type = "submit"
32+ value = { props . buttonText || "Submit" }
33+ />
34+ ) ;
35+ } ;
36+
37+ // #endregion Component
38+
39+ // -----------------------------------------------------------------------------------------
40+ // #region Export
41+ // -----------------------------------------------------------------------------------------
42+
43+ export { SubmitButton } ;
44+
45+ // #endregion Export
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export { Button } from "./atoms/buttons/button";
1010export { CheckboxButton } from "./atoms/forms/checkbox-button" ;
1111export { CheckboxInput } from "./atoms/forms/checkbox-input" ;
1212export { PasswordInput } from "./atoms/forms/password-input" ;
13+ export { SubmitButton } from "./atoms/forms/submit-button" ;
1314
1415// Icons
1516export { Icon } from "./atoms/icons/icon" ;
You can’t perform that action at this time.
0 commit comments