-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from lizardkingLK/lizardkinglk
Lizardkinglk
- Loading branch information
Showing
13 changed files
with
275 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Close from '@/components/svgs/close'; | ||
import Send from '@/components/svgs/send'; | ||
import { IUIProps } from '@/types'; | ||
import { actions } from '@/utils/enums'; | ||
import React from 'react'; | ||
|
||
const SubmitButton = (props: { | ||
context: actions; | ||
onSubmitHandler: Function; | ||
ui: IUIProps; | ||
}) => { | ||
const { context, onSubmitHandler, ui } = props; | ||
if (context === actions.create || context === actions.edit) { | ||
return ( | ||
<button | ||
type="submit" | ||
className="p-2 md:p-4 rounded-r-full bg-green-500 hover:bg-green-600 text-white" | ||
title="Send Message" | ||
onClick={() => onSubmitHandler(context)} | ||
> | ||
<Send size={ui.iconSize} /> | ||
</button> | ||
); | ||
} else if (context === actions.beforeEdit) { | ||
return ( | ||
<button | ||
type="submit" | ||
className="p-2 md:p-4 rounded-r-full bg-green-500 hover:bg-green-600 text-white" | ||
title="Cancel Edit" | ||
onClick={() => onSubmitHandler(context)} | ||
> | ||
<Close size={ui.iconSize} /> | ||
</button> | ||
); | ||
} else return null; | ||
}; | ||
|
||
export default SubmitButton; |
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
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
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
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.