Переглянути джерело

added reusable edit mode enable button

pull/88/head
meris.ahmatovic 3 роки тому
джерело
коміт
3e4da2abba

+ 34
- 0
src/components/Button/EditButton.js Переглянути файл

import { IconButton } from "@mui/material";
import PropTypes from "prop-types";
import React from "react";
import userPageBtnIcon from "../../assets/images/userPageBtnIcon.png";
import { useTheme } from "@mui/system";
import { useMediaQuery } from "@mui/material";

const EditButton = ({ onEnableEdit }) => {
const theme = useTheme();
const matches = useMediaQuery(theme.breakpoints.down("sm"));

return (
<IconButton
className={"c-btn--primary-outlined c-btn userPageBtn ml-20px no-padding"}
onClick={onEnableEdit}
>
{!matches && "Rezim uredjivanja"}
<img
style={{
position: "relative",
top: -0.25,
paddingLeft: matches ? "0px" : "10px",
}}
src={userPageBtnIcon}
/>
</IconButton>
);
};

EditButton.propTypes = {
onEnableEdit: PropTypes.func,
};

export default EditButton;

+ 1
- 1
src/components/MUI/InviteDialog.js Переглянути файл

lastName: Yup.string().required(t("login.lastnameRequired")), lastName: Yup.string().required(t("login.lastnameRequired")),
email: Yup.string() email: Yup.string()
.required(t("login.emailRequired")) .required(t("login.emailRequired"))
.matches(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/, "Invalid email format."),
.matches(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/, t("login.invalidEmail")),
}), }),
onSubmit: handleSubmit, onSubmit: handleSubmit,
validateOnBlur: true, validateOnBlur: true,

+ 10
- 9
src/i18n/resources/en.js Переглянути файл

forgotPasswordEmail: "Email", forgotPasswordEmail: "Email",
useDifferentEmail: "Use different email address or username", useDifferentEmail: "Use different email address or username",
signInWithGoogle: "Continue with google", signInWithGoogle: "Continue with google",
invalidEmail: "Invalid email format",
}, },
password: { password: {
weak: "weak", weak: "weak",
users: { users: {
management: "User management", management: "User management",
fullName: "Name and surname", fullName: "Name and surname",
position: 'Position',
invite: 'Invite',
inviteUser: 'Invite user',
regLink: 'Registration link',
receiver: 'Receiver',
user: 'User',
contact: 'Contact',
phone: 'Phone',
socials: 'Social Media',
position: "Position",
invite: "Invite",
inviteUser: "Invite user",
regLink: "Registration link",
receiver: "Receiver",
user: "User",
contact: "Contact",
phone: "Phone",
socials: "Social Media",
}, },
selectionLevels: { selectionLevels: {
done: { done: {

+ 1
- 0
src/i18n/resources/rs.js Переглянути файл

// this._useDifferentEmail = value; // this._useDifferentEmail = value;
// }, // },
signInWithGoogle: "Prijava putem Google-a", signInWithGoogle: "Prijava putem Google-a",
invalidEmail:"Format adrese nije validan"
}, },
// password: { // password: {
// weak: 'weak', // weak: 'weak',

Завантаження…
Відмінити
Зберегти