Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Commits
da32dd0d
Commit
da32dd0d
authored
3 years ago
by
Francesco
Browse files
Options
Downloads
Patches
Plain Diff
Adjust ChoseRole not finished THO
parent
2bbdc4f3
No related branches found
No related tags found
1 merge request
!73
Fix choserole style.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Auth/ChoseRole/ChoseRole.tsx
+47
-14
47 additions, 14 deletions
src/components/Auth/ChoseRole/ChoseRole.tsx
with
47 additions
and
14 deletions
src/components/Auth/ChoseRole/ChoseRole.tsx
+
47
−
14
View file @
da32dd0d
import
React
,
{
FC
,
useEffect
,
useState
}
from
'
react
'
;
import
Button
from
'
@material-ui/core/Button
'
;
import
{
Grid
,
Typography
,
Hidden
}
from
'
@material-ui/core
'
;
import
{
getRoles
}
from
'
api/getRoles
'
;
import
{
setRole
}
from
'
api/setRole
'
;
import
{
useHistory
}
from
'
react-router-dom
'
;
import
{
AuthRoutes
}
from
'
api/routes
'
;
import
{
choseRoleStyle
}
from
'
./ChoseRoleStyle.style
'
;
/**
* Page that let's users decide role between available roles.
...
...
@@ -11,6 +13,8 @@ import { AuthRoutes } from 'api/routes';
* @returns ChoseRole component.
*/
export
const
ChoseRole
:
FC
=
()
=>
{
const
classes
=
choseRoleStyle
();
const
history
=
useHistory
();
const
[
userRoles
,
setUserRoles
]
=
useState
<
string
[]
>
([
''
]);
...
...
@@ -26,20 +30,49 @@ export const ChoseRole: FC = () => {
return
(
<
div
data-testid
=
"ChoseRole"
>
{
userRoles
?
(
userRoles
.
map
((
role
)
=>
(
<
Button
variant
=
"outlined"
color
=
"default"
key
=
{
role
}
onClick
=
{
()
=>
choseAndForward
(
role
)
}
>
{
role
}
</
Button
>
))
)
:
(
<
h1
>
No roles were returned.
</
h1
>
)
}
<
Grid
container
direction
=
"column"
className
=
{
classes
.
paddingBottom
}
>
<
div
className
=
{
classes
.
root
}
>
<
header
>
<
Grid
item
container
className
=
{
classes
.
paddingBottom
}
>
<
Grid
item
xs
=
{
1
}
md
=
{
2
}
lg
=
{
2
}
/>
<
Grid
item
xs
=
{
10
}
md
=
{
6
}
lg
=
{
4
}
>
<
Typography
variant
=
"h2"
className
=
{
classes
.
whiteText
}
>
Choose Your
</
Typography
>
<
Typography
variant
=
"h2"
className
=
{
classes
.
whiteText
}
>
ROLE
</
Typography
>
</
Grid
>
<
Grid
item
xs
=
{
1
}
/>
</
Grid
>
</
header
>
</
div
>
</
Grid
>
<
Grid
container
>
<
Grid
item
xs
=
{
1
}
lg
=
{
2
}
/>
<
Grid
item
xs
=
{
10
}
lg
=
{
8
}
>
{
userRoles
?
(
userRoles
.
map
((
role
)
=>
(
<
Button
variant
=
"outlined"
fullWidth
color
=
"default"
key
=
{
role
}
onClick
=
{
()
=>
choseAndForward
(
role
)
}
className
=
{
classes
.
paddingTopKlein
}
>
{
role
}
</
Button
>
))
)
:
(
<
h1
>
No roles were returned.
</
h1
>
)
}
</
Grid
>
<
Grid
item
xs
=
{
1
}
lg
=
{
2
}
/>
</
Grid
>
</
div
>
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment