mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(phone/snackbar-provider): Altered API to expect a string for message, not a key (#135)
Change SnackbarProviderAlert message property to allow for any string rather than a explicit translation key
This commit is contained in:
10 files changed
+87
-19
No files matched your search
@@ -4,6 +4,7 @@ import { Grid, makeStyles, Box, Paper, Fab } from '@material-ui/core';
|
||||
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
||||
import FileCopyIcon from '@material-ui/icons/FileCopy';
|
||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
button: {
|
||||
@@ -59,6 +60,8 @@ export const Calculator = ({ ...props }) => {
|
||||
[result],
|
||||
);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Box flexGrow={1} component={Paper} p={4} className={classes.result}>
|
||||
@@ -66,7 +69,12 @@ export const Calculator = ({ ...props }) => {
|
||||
size="small"
|
||||
onClick={() => {
|
||||
setClipboard(resultStr);
|
||||
addAlert({ message: 'CALCULATOR_COPIED', type: 'info' });
|
||||
addAlert({
|
||||
message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
|
||||
content: 'number',
|
||||
}),
|
||||
type: 'success',
|
||||
});
|
||||
}}
|
||||
className={classes.copyFab}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user