mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { Button } from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
buttons: {
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
justifyContent: "flex-end",
|
||||
alignItems: "justify-content",
|
||||
marginRight: "15px",
|
||||
},
|
||||
close: {
|
||||
marginLeft: "8px",
|
||||
},
|
||||
}));
|
||||
|
||||
export const ControlButtons = ({
|
||||
showImagePrompt,
|
||||
showEmoji,
|
||||
onCloseClick,
|
||||
onPrimaryClick,
|
||||
}) => {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const imagePromptVisible = showImagePrompt && !showEmoji;
|
||||
const primaryButtonText = imagePromptVisible
|
||||
? t("APPS_TWITTER_SUBMIT_IMAGE")
|
||||
: t("APPS_TWITTER_TWEET");
|
||||
const showCloseButton = showImagePrompt || showEmoji;
|
||||
|
||||
return (
|
||||
<div className={classes.buttons}>
|
||||
<Button variant="contained" color="primary" onClick={onPrimaryClick}>
|
||||
{primaryButtonText}
|
||||
</Button>
|
||||
{showCloseButton && (
|
||||
<Button
|
||||
className={classes.close}
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
onClick={onCloseClick}
|
||||
>
|
||||
{t("APPS_TWITTER_CLOSE_IMAGE")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ControlButtons;
|
||||
Reference in new issue
Block a user