Refactor announcement components and styles
parent
cbca462893
commit
4ab78e51cd
|
@ -1,17 +1,16 @@
|
|||
import React from "react";
|
||||
import { makeStyles } from "@mui/material/styles";
|
||||
import { Alert, AlertTitle } from "@mui/material";
|
||||
import styles from "../styles";
|
||||
import { getStyles } from "../styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const useStyles = makeStyles(styles);
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
export default function GuestAnnouncement() {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const styles = getStyles(theme);
|
||||
|
||||
return (
|
||||
<div className={classes.alert}>
|
||||
<div style={styles.alert}>
|
||||
<Alert variant="outlined" severity="warning">
|
||||
<AlertTitle>{t("Dashboard.Announcements.Guest.Title")}</AlertTitle>
|
||||
{t("Dashboard.Announcements.Guest.Message")}
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
import React from "react";
|
||||
import { makeStyles } from "@mui/material/styles";
|
||||
import { Alert, AlertTitle } from "@mui/material";
|
||||
import styles from "../styles";
|
||||
import { getStyles } from "../styles";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTuitioUser } from "@flare/tuitio-client-react";
|
||||
|
||||
const useStyles = makeStyles(styles);
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
export default function UserAnnouncement() {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { userName } = useTuitioUser();
|
||||
const theme = useTheme();
|
||||
const styles = getStyles(theme);
|
||||
|
||||
return (
|
||||
<div className={classes.alert}>
|
||||
<div style={styles.alert}>
|
||||
<Alert variant="outlined" severity="info">
|
||||
<AlertTitle>
|
||||
{t("Dashboard.Announcements.User.Title", {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const styles = theme => ({
|
||||
const getStyles = theme => ({
|
||||
alert: {
|
||||
width: "100%",
|
||||
"& > * + *": {
|
||||
|
@ -7,4 +7,4 @@ const styles = theme => ({
|
|||
}
|
||||
});
|
||||
|
||||
export default styles;
|
||||
export { getStyles };
|
||||
|
|
Loading…
Reference in New Issue