1
- import { Avatar , Box , Button , Stack , Typography } from "@mui/material" ;
1
+ import { Avatar , Box , Button , Divider , Stack , Typography } from "@mui/material" ;
2
+ import React from "react" ;
2
3
3
4
type ProfileSectionProps = {
4
5
firstName : string ;
@@ -15,11 +16,17 @@ const ProfileSection: React.FC<ProfileSectionProps> = (props) => {
15
16
< Box >
16
17
< Box sx = { { display : "flex" , flexDirection : "column" } } >
17
18
< Box
18
- sx = { { display : "flex" , flexDirection : "row" , alignItems : "center" } }
19
+ sx = { ( theme ) => ( {
20
+ display : "flex" ,
21
+ flexDirection : "row" ,
22
+ alignItems : "center" ,
23
+ marginTop : theme . spacing ( 2 ) ,
24
+ marginBottom : theme . spacing ( 2 ) ,
25
+ } ) }
19
26
>
20
27
< Avatar sx = { { width : 56 , height : 56 } } />
21
28
< Box sx = { ( theme ) => ( { marginLeft : theme . spacing ( 2 ) } ) } >
22
- < Typography fontSize = { "h5 .fontSize" } >
29
+ < Typography fontSize = { "h6 .fontSize" } >
23
30
{ firstName } { lastName }
24
31
</ Typography >
25
32
< Typography > @{ username } </ Typography >
@@ -35,18 +42,21 @@ const ProfileSection: React.FC<ProfileSectionProps> = (props) => {
35
42
</ Typography >
36
43
</ Box >
37
44
{ isCurrentUser && (
38
- < Stack
39
- spacing = { 2 }
40
- sx = { ( theme ) => ( {
41
- marginTop : theme . spacing ( 4 ) ,
42
- marginBottom : theme . spacing ( 4 ) ,
43
- } ) }
44
- >
45
- < Button variant = "contained" > Edit profile</ Button >
46
- < Button variant = "contained" color = "secondary" >
47
- Edit password
48
- </ Button >
49
- </ Stack >
45
+ < >
46
+ < Divider />
47
+ < Stack
48
+ spacing = { 2 }
49
+ sx = { ( theme ) => ( {
50
+ marginTop : theme . spacing ( 4 ) ,
51
+ marginBottom : theme . spacing ( 4 ) ,
52
+ } ) }
53
+ >
54
+ < Button variant = "contained" > Edit profile</ Button >
55
+ < Button variant = "contained" color = "secondary" >
56
+ Edit password
57
+ </ Button >
58
+ </ Stack >
59
+ </ >
50
60
) }
51
61
</ Box >
52
62
) ;
0 commit comments