-
Notifications
You must be signed in to change notification settings - Fork 1
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 #54 from medienhaus/add-component-ConfirmCancelBut…
…tons Add `ConfirmCancelButtons` component
- Loading branch information
Showing
4 changed files
with
78 additions
and
18 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,41 @@ | ||
import styled from 'styled-components'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const ConfirmCancelButtonsWrapper = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-gap: var(--margin); | ||
`; | ||
|
||
const ConfirmButton = styled.button` | ||
color: var(--color-background); | ||
background-color: var(--color-foreground); | ||
&:disabled { | ||
color: var(--color-background); | ||
background-color: var(--color-disabled); | ||
} | ||
`; | ||
|
||
const CancelButton = styled.button` | ||
color: var(--color-foreground); | ||
background-color: var(--color-background); | ||
&:disabled { | ||
color: var(--color-disabled); | ||
background-color: var(--color-background); | ||
} | ||
`; | ||
|
||
const ConfirmCancelButtons = ({ children, disabled, onClick, onCancel }) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<ConfirmCancelButtonsWrapper> | ||
<ConfirmButton type="submit" disabled={disabled} onClick={onClick}>{ children ? children : t('Confirm') }</ConfirmButton> | ||
<CancelButton type="reset" disabled={disabled} onClick={onCancel}>{ t('Cancel') }</CancelButton> | ||
</ConfirmCancelButtonsWrapper> | ||
); | ||
}; | ||
|
||
export default ConfirmCancelButtons; |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
{ | ||
"Password": "Passwort", | ||
"Select action": "Aktion wählen", | ||
"What would you like to do?": "Was möchtest Du tun?", | ||
"{{error}}, please wait {{time}} seconds.": "{{error}}, bitte warte {{time}} sekunden." | ||
} | ||
"Cancel": "Abbrechen", | ||
"Confirm": "Bestätigen", | ||
"Delete": "Löschen", | ||
"Password": "Passwort", | ||
"Upload": "Hochladen", | ||
"Save changes": "Änderungen speichern", | ||
"Select action": "Aktion wählen", | ||
"What would you like to do?": "Was möchtest Du tun?", | ||
"{{error}}, please wait {{time}} seconds.": "{{error}}, bitte warte {{time}} Sekunden." | ||
} |
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,7 +1,6 @@ | ||
{ | ||
"Upload": "Hochladen", | ||
"Delete": "Löschen", | ||
"add your email address": "e-mail adresse hinzufügen", | ||
"add another email address": "weitere e-mail adressen hinzufügen", | ||
"Save changes": "Änderungen speichern" | ||
"We have sent a confirmation email to the provided address.": "Wir haben eine Bestätigungs-E-Mail an eingegebene Adresse gesendet.", | ||
"Please enter your account password to confirm adding the given email address:": "Bitte bestätige das Hinzufügen der eingegebenen E-Mail-Adresse mit deinem Passwort:", | ||
"add another email address": "weitere E-Mail-Adressen hinzufügen", | ||
"add your email address": "E-Mail-Adresse hinzufügen" | ||
} |