Skip to content

Commit

Permalink
edit only for logged profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Fmar committed Aug 24, 2023
1 parent 70f0bfa commit e6bdc80
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions lib/ui/user/metadata_top_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,22 @@ class _MetadataTopComponent extends State<MetadataTopComponent> {
)
];

topBtnList.add(wrapBtn(
MetadataIconBtn(
iconData: Icons.edit_square,
onTap: jumpToProfileEdit,
),
)
// if (!PlatformUtil.isTableMode() && widget.pubkey == nostr!.publicKey) {
// // is phont and local
// topBtnList.add(wrapBtn(MetadataIconBtn(
// iconData: Icons.qr_code_scanner,
// onTap: handleScanner,
// )));
// }
);
if (widget.isLocal) {
topBtnList.add(wrapBtn(
MetadataIconBtn(
iconData: Icons.edit_square,
onTap: jumpToProfileEdit,
),
)
// if (!PlatformUtil.isTableMode() && widget.pubkey == nostr!.publicKey) {
// // is phont and local
// topBtnList.add(wrapBtn(MetadataIconBtn(
// iconData: Icons.qr_code_scanner,
// onTap: handleScanner,
// )));
// }
);
}

topBtnList.add(wrapBtn(MetadataIconBtn(
iconData: Icons.qr_code,
Expand Down Expand Up @@ -340,7 +342,7 @@ class _MetadataTopComponent extends State<MetadataTopComponent> {
topList.add(userNameComponent);
if (widget.metadata != null) {
topList.add(MetadataIconDataComp(
leftWidget: Container() ,
leftWidget: Container(),
text: nip19PubKey,
textBG: true,
onTap: copyPubKey,
Expand Down Expand Up @@ -520,7 +522,8 @@ class MetadataIconBtn extends StatelessWidget {
IconData iconData;
Color? iconColor;

MetadataIconBtn({required this.iconData, this.iconColor, this.onTap, this.onLongPress});
MetadataIconBtn(
{required this.iconData, this.iconColor, this.onTap, this.onLongPress});

@override
Widget build(BuildContext context) {
Expand All @@ -531,13 +534,9 @@ class MetadataIconBtn extends StatelessWidget {
border: Border.all(width: 1),
);
var main = Container(
height: 34,
width: 34,
child: Icon(
iconData,
size: 22,
color: iconColor?? iconTheme.color
),
// height: 34,
// width: 34,
child: Icon(iconData, size: 22, color: iconColor ?? iconTheme.color),
);

if (onTap != null || onLongPress != null) {
Expand Down Expand Up @@ -593,12 +592,12 @@ class MetadataTextBtn extends StatelessWidget {
onTap: onTap,
child: Container(
height: 28,
padding: EdgeInsets.only(left: 8, right: 8),
padding: EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
child: Text(
text,
style: TextStyle(
fontSize: Base.BASE_FONT_SIZE+6,
fontSize: Base.BASE_FONT_SIZE + 6,
// fontWeight: FontWeight.bold,
color: borderColor,
),
Expand Down Expand Up @@ -685,10 +684,9 @@ class MetadataIconDataComp extends StatelessWidget {
borderRadius: BorderRadius.circular(10),
),
child: Text(
style: TextStyle(color: textColor?? themeData.hintColor),
style: TextStyle(color: textColor ?? themeData.hintColor),
text,
overflow: TextOverflow.ellipsis,

),
),
),
Expand Down

0 comments on commit e6bdc80

Please sign in to comment.