Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Styled TeamSettings #1888

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Grid from "@mui/material/Grid";
import IconButton from "@mui/material/IconButton";
import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import makeStyles from "@mui/styles/makeStyles";
import { useFormik } from "formik";
import React from "react";
import Input from "ui/Input";
Expand All @@ -18,30 +18,26 @@ import InputRowItem from "ui/InputRowItem";
import OptionButton from "ui/OptionButton";
import SelectInput from "ui/SelectInput";

interface ITeam {}
const StyledAvatar = styled(Avatar)(({ theme }) => ({
width: theme.spacing(8),
height: theme.spacing(8),
}));

export const teamStyles = makeStyles((theme) => ({
root: {
color: "currentColor",
},
avatar: {
width: theme.spacing(8),
height: theme.spacing(8),
},
grow: {
flexGrow: 1,
},
inputLabel: {
position: "absolute",
color: theme.palette.text.primary,
const StyledGrid = styled(Grid)(() => ({
flexGrow: 1,
}));

const StyledInputLabel = styled(InputLabel)(({ theme }) => ({
position: "absolute",
color: theme.palette.text.primary,
[theme.breakpoints.up("xs")]: {
fontSize: 12,
top: -18,
},
top: -18,
}));

const TeamMember = ({ name, email, userRole }: any) => {
const [role, setRole] = React.useState(userRole);
const classes = teamStyles();
return (
<Box mb={1.5}>
<Grid
Expand All @@ -51,12 +47,12 @@ const TeamMember = ({ name, email, userRole }: any) => {
alignItems="center"
>
<Grid item>
<Avatar className={classes.avatar}>{name[0]}</Avatar>
<StyledAvatar>{name[0]}</StyledAvatar>
</Grid>
<Grid item className={classes.grow}>
<StyledGrid item>
<Typography variant="h5">{name}</Typography>
<Box fontSize="h5.fontSize">{email}</Box>
</Grid>
</StyledGrid>
<Grid item>
<SelectInput
value={role}
Expand All @@ -78,8 +74,7 @@ const TeamMember = ({ name, email, userRole }: any) => {
);
};

const Team: React.FC<ITeam> = () => {
const classes = teamStyles();
const Team: React.FC = () => {
const formik = useFormik({
initialValues: {},
onSubmit: (values) => {
Expand Down Expand Up @@ -123,16 +118,16 @@ const Team: React.FC<ITeam> = () => {
wrap="nowrap"
>
<Grid item>
<Avatar className={classes.avatar}>
<StyledAvatar>
<Add />
</Avatar>
</StyledAvatar>
</Grid>
<Grid item className={classes.grow}>
<StyledGrid item>
<Box position="relative">
<InputLabel className={classes.inputLabel}>Invite new</InputLabel>
<StyledInputLabel>Invite new</StyledInputLabel>
<Input placeholder="enter new email address" fullWidth />
</Box>
</Grid>
</StyledGrid>
<Grid item>
<SelectInput value="admin">
<MenuItem value="admin">Admin</MenuItem>
Expand Down