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: Manage users component #4

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
30 changes: 28 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/base": "^5.0.0-beta.40",
"@mui/icons-material": "^5.16.4",
"@mui/material": "^5.4.0",
"@mui/styled-engine": "^5.4.0",
"react": "^18.3.1",
Expand Down
10 changes: 9 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import React from 'react';
import { CssBaseline } from '@mui/material';
import { ManageUsers } from './manageUsers/manageUsers';
const App = () => {
return <h1>Univent Planner</h1>
return (
<>
<CssBaseline />
<ManageUsers />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ManageUsers do usunięcia z app.tsx

</>
);
};

export default App;
57 changes: 57 additions & 0 deletions src/manageUsers/manageUsers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moduły powinny być umieszczone w src/screens/{nazwa modułu} będziesz musiał przenieść manageUseres

import List from '@mui/material/List';
import ListItemAvatar from '@mui/material/ListItemAvatar';
import ListItemText from '@mui/material/ListItemText';
import Avatar from '@mui/material/Avatar';
import Typography from '@mui/material/Typography';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import GroupRemoveIcon from '@mui/icons-material/GroupRemove';
import { BackButton, Item, RemoveButton, Wrapper } from './manageUsersStyle';

export const ManageUsers = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exportuj na końcu pliku przy użyciu export default ManageUsers

function generate(element: React.ReactElement) {
return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((value) =>
React.cloneElement(element, {
key: value,
})
);
}
const [secondary, setSecondary] = React.useState(false);
return (
<Wrapper>
<BackButton>
<ArrowBackIcon></ArrowBackIcon>
</BackButton>
<Typography sx={{ mt: 8, mb: 2, ml: 1 }} variant="h6" component="div">
Członkowie
<Typography
variant="h6"
component="div"
fontStyle={'italic'}
fontWeight={600}
>
NAZWA_GRUPY
</Typography>
</Typography>
<List>
{generate(
<Item
secondaryAction={
<RemoveButton edge="end" aria-label="delete">
<GroupRemoveIcon />
</RemoveButton>
}
>
<ListItemAvatar>
<Avatar src={''}></Avatar>
</ListItemAvatar>
<ListItemText
primary="Użytkownik"
secondary={secondary ? 'Secondary text' : null}
/>
</Item>
)}
</List>
</Wrapper>
);
};
51 changes: 51 additions & 0 deletions src/manageUsers/manageUsersStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { styled } from '@mui/material';
import { ListItem, IconButton, Box } from '@mui/material';

export const Wrapper = styled(Box)`
display: flex;
flex-direction: column;
height: 100vh;
padding: 32px;
box-sizing: border-box;
position: relative;
@media (max-width: 600px) {
padding: 16px;
}
`;
export const Content = styled(Box)`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
width: 100%;
padding: 16px;
@media (max-width: 600px) {
padding: 8px;
}
`;

export const BackButton = styled(IconButton)`\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\ i tab do usunięcia. Po rebasie na nowego developa prettier powinien to naprawić, sprawdź od razu inne pliki.

position: absolute;
border-radius: 9999px;
border: 2px solid #bbbbbb;
@media {
color: black;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

każdy kolor musi być importowane z pliku theme. Możesz go znaleźć na nowym developie. w razie potrzeby możesz do niego dopisać nowe kolory

}
`;
export const RemoveButton = styled(IconButton)`
position: relative;
`;

export const Item = styled(ListItem)`
position absolute;
background-color: #ffcccc;
border-radius: 12px;
margin-bottom: 8px;
`;

export const BackButtonWrapper = styled(Box)`
display: flex;
justify-content: flex-start;
background-color: #;
`;