Skip to content
Snippets Groups Projects
Commit fe8cefa9 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

own profile role only if admin

parent 20ee2176
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import { Card, CardContent, Grid, Typography, useTheme } from '@material-ui/core ...@@ -2,7 +2,7 @@ import { Card, CardContent, Grid, Typography, useTheme } from '@material-ui/core
import { GroupRole, Member } from '../../types/graphqlSchema'; import { GroupRole, Member } from '../../types/graphqlSchema';
import React from 'react'; import React from 'react';
import { StyledLink } from '../../utils/StyledLink'; import { StyledLink } from '../utils/StyledLink';
export const GroupHomeDetails: React.FC<{ membership: Member }> = ({ membership }) => { export const GroupHomeDetails: React.FC<{ membership: Member }> = ({ membership }) => {
const theme = useTheme(); const theme = useTheme();
......
...@@ -30,13 +30,6 @@ const TableRowWithData: React.FC<{ field: string; value?: string | number }> = ( ...@@ -30,13 +30,6 @@ const TableRowWithData: React.FC<{ field: string; value?: string | number }> = (
); );
}; };
const userRoleAdminString = 'Admin';
const userRoleNormalString = 'Normál';
const getUserRoleString = (role: UserRole | undefined = undefined) => {
return role === UserRole.Admin ? userRoleAdminString : userRoleNormalString;
};
export const OwnProfile: React.FC = () => { export const OwnProfile: React.FC = () => {
const { loading: userDataIsLoading, data: userData } = useQuery<IOwnUserGQL>(ownUserGQL); const { loading: userDataIsLoading, data: userData } = useQuery<IOwnUserGQL>(ownUserGQL);
...@@ -60,7 +53,7 @@ export const OwnProfile: React.FC = () => { ...@@ -60,7 +53,7 @@ export const OwnProfile: React.FC = () => {
<TableRowWithData field="Név" value={`${userData?.me.familyName} ${userData?.me.givenName}`} /> <TableRowWithData field="Név" value={`${userData?.me.familyName} ${userData?.me.givenName}`} />
<TableRowWithData field="E-mail" value={userData?.me.googleEmail} /> <TableRowWithData field="E-mail" value={userData?.me.googleEmail} />
<TableRowWithData field="ID" value={userData?.me.id} /> <TableRowWithData field="ID" value={userData?.me.id} />
<TableRowWithData field="Jogkör" value={getUserRoleString(userData?.me.role)} /> {userData?.me.role === UserRole.Admin && <TableRowWithData field="Jogkör" value="Admin" />}
</TableBody> </TableBody>
</Table> </Table>
</Loading> </Loading>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment