-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract various components (#868)
* feat(frontend) add delete confirmation modal * ref(frontend) move form status message to a separate component * ref(frontend) move form input to a separate component * fix(frontend) allow fullName be empty in user edit form * fix(frontend) fix sidebar active routes display * feat(frontend) add statusmessage and inputfield stories * fix(frontend) remove unnecessary console log * feat(frontend) add inputfield form usage stroy * fix(frontend) change status message prop naming * refactor(frontend) change status message style formation * fix(frontend) fix input field label typo * ref(frontend) add sweetalert wrapper Co-authored-by: Egor Mozheiko <egormozheiko@gmail.com>
- Loading branch information
1 parent
dc9b3e7
commit fb4c2fc
Showing
22 changed files
with
334 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import React from 'react'; | ||
import InputField from '@ui/InputField'; | ||
import Button from '@ui/Button'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
const Template: ComponentStory<typeof InputField> = (args) => ( | ||
<InputField type="password" {...args} /> | ||
); | ||
|
||
export default { | ||
title: 'Components/InputField', | ||
component: InputField, | ||
argTypes: { | ||
type: { | ||
options: ['text', 'password'], | ||
control: { type: 'select' }, | ||
}, | ||
}, | ||
} as ComponentMeta<typeof InputField>; | ||
|
||
export const AsFormInput = ({ type, label, placeholder }) => { | ||
return ( | ||
<form> | ||
<p>Example of component usage in a form</p> | ||
<InputField type={type} label={label} placeholder={placeholder} /> | ||
<InputField type={type} label={label} placeholder={placeholder} /> | ||
<Button>Submit</Button> | ||
</form> | ||
); | ||
}; | ||
AsFormInput.args = { | ||
label: 'Sample text', | ||
placeholder: 'Sample text', | ||
type: 'text', | ||
}; | ||
|
||
export const Inputfield = Template.bind({}); | ||
Inputfield.args = { | ||
label: 'Sample text', | ||
placeholder: 'Sample text', | ||
type: 'text', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import React from 'react'; | ||
import StatusMessage from '@ui/StatusMessage'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
const Template: ComponentStory<typeof StatusMessage> = (args) => ( | ||
<StatusMessage {...args} /> | ||
); | ||
|
||
export default { | ||
title: 'Components/StatusMessage', | ||
component: StatusMessage, | ||
} as ComponentMeta<typeof StatusMessage>; | ||
|
||
export const Statusmessage = Template.bind({}); | ||
Statusmessage.args = { | ||
type: 'success', | ||
message: 'Example message', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
webapp/javascript/components/Settings/APIKeys/APIKeyForm.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
.addForm { | ||
} | ||
|
||
.addForm > div:not(:last-child) { | ||
display: flex; | ||
margin: 10px 0px; | ||
flex-direction: column; | ||
width: 30%; | ||
min-width: 150px; | ||
} | ||
|
||
.success { | ||
background-color: #28a745; | ||
color: white; | ||
padding: 10px; | ||
margin: 15px 0; | ||
} | ||
|
||
.keyOutput { | ||
max-width: 40%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
webapp/javascript/components/Settings/Preferences.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.