mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +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
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSnackbar } from '../hooks/useSnackbar';
|
||||
import Alert from './Alert';
|
||||
|
||||
@@ -22,12 +21,11 @@ const useStyles = makeStyles({
|
||||
|
||||
export const Snackbar = () => {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { alert } = useSnackbar();
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
{alert ? <Alert severity={alert.type}>{t('APPS_' + alert.message)}</Alert> : null}
|
||||
{alert ? <Alert severity={alert.type}>{alert.message}</Alert> : null}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user